@magic-xpa/angular 4.800.0-dev480.20 → 4.800.0-dev480.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/magic-xpa-angular.umd.js +612 -1883
- package/bundles/magic-xpa-angular.umd.js.map +1 -1
- package/bundles/magic-xpa-angular.umd.min.js +2 -2
- package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/magic-xpa-angular.js +1 -4
- package/esm2015/src/controls.metadata.model.js +3 -36
- package/esm2015/src/interfaces/sub-form-definition.iterface.js +1 -1
- package/esm2015/src/magic.core.module.js +4 -14
- package/esm2015/src/services/ISubformMagicService.js +1 -1
- package/esm2015/src/services/OverlayWindowService.js +4 -29
- package/esm2015/src/services/StylesMapManager.js +1 -4
- package/esm2015/src/services/accessor.magic.service.js +41 -249
- package/esm2015/src/services/commands-collector.magic.service.js +4 -7
- package/esm2015/src/services/component-list.magic.service.js +1 -25
- package/esm2015/src/services/confirmation.components.magic.provider.js +4 -24
- package/esm2015/src/services/engine.magic.service.js +7 -10
- package/esm2015/src/services/exit.magic.service.js +4 -10
- package/esm2015/src/services/magic.providers.js +1 -4
- package/esm2015/src/services/magic.services.js +4 -10
- package/esm2015/src/services/mg-date-adapter.js +5 -5
- package/esm2015/src/services/overlay.conainer.magic.provider.js +4 -8
- package/esm2015/src/services/router-commands.magic.service.js +4 -10
- package/esm2015/src/services/subform.magic.service.js +37 -56
- package/esm2015/src/services/table.magic.service.js +5 -61
- package/esm2015/src/services/task.magics.service.js +14 -282
- package/esm2015/src/services/title.magic.service.js +4 -15
- package/esm2015/src/ui/GuiInteractiveExecutor.js +8 -6
- package/esm2015/src/ui/components/base-magic-alert.component.js +4 -14
- package/esm2015/src/ui/components/base-magic-confirm.component.js +4 -16
- package/esm2015/src/ui/components/magic-alert.component.js +5 -8
- package/esm2015/src/ui/components/magic-confirmation-box.component.js +5 -8
- package/esm2015/src/ui/directives/NonMagicControlDirective.js +4 -31
- package/esm2015/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/checkbox.magic.directive.js +4 -13
- package/esm2015/src/ui/directives/magic/combobox.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.js +4 -16
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/input.noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/nocontrol.magic.directive.js +6 -16
- package/esm2015/src/ui/directives/magic/row.magic.directive.js +4 -22
- package/esm2015/src/ui/directives/magic-focus.directive.js +4 -7
- package/esm2015/src/ui/directives/magic.directive.js +8 -81
- package/esm2015/src/ui/directives/magicViewContainerRef.directive.js +4 -8
- package/esm2015/src/ui/directives/mgformat.magic.directive.js +4 -57
- package/esm2015/src/ui/directives/range-validator.magic.directive.js +4 -20
- package/esm2015/src/ui/magic-confirmationBox.js +1 -25
- package/esm2015/src/ui/magic-modal/base-magic-overlay-container.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-modal-form.js +1 -4
- package/esm2015/src/ui/magic-modal/magic-modal-interface.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-overlay-container-wrapper.js +4 -21
- package/esm2015/src/ui/magic-modal/magic-overlay-container.js +4 -46
- package/esm2015/src/ui/magic-root.component.js +10 -53
- package/esm2015/src/ui/mgerror.magic.component.js +4 -21
- package/esm2015/src/ui/pipes/date.magic.pipe.js +5 -12
- package/esm2015/src/ui/pipes/time.magic.pipe.js +4 -7
- package/esm2015/src/ui/router-container.magic.component.js +14 -35
- package/esm2015/src/ui/subform.magic.component.js +4 -23
- package/esm2015/src/ui/task-base.magic.component.js +4 -74
- package/esm2015/src/ui/utils.js +1 -20
- package/fesm2015/magic-xpa-angular.js +602 -1881
- package/fesm2015/magic-xpa-angular.js.map +1 -1
- package/magic-xpa-angular.d.ts +0 -3
- package/package.json +3 -3
- package/src/controls.metadata.model.d.ts +0 -16
- package/src/interfaces/sub-form-definition.iterface.d.ts +0 -6
- package/src/magic.core.module.d.ts +0 -3
- package/src/services/OverlayWindowService.d.ts +0 -19
- package/src/services/StylesMapManager.d.ts +0 -3
- package/src/services/accessor.magic.service.d.ts +15 -208
- package/src/services/commands-collector.magic.service.d.ts +0 -3
- package/src/services/component-list.magic.service.d.ts +0 -27
- package/src/services/confirmation.components.magic.provider.d.ts +0 -16
- package/src/services/engine.magic.service.d.ts +1 -3
- package/src/services/exit.magic.service.d.ts +0 -6
- package/src/services/magic.providers.d.ts +0 -3
- package/src/services/magic.services.d.ts +0 -6
- package/src/services/router-commands.magic.service.d.ts +0 -6
- package/src/services/subform.magic.service.d.ts +5 -30
- package/src/services/table.magic.service.d.ts +0 -55
- package/src/services/task.magics.service.d.ts +1 -294
- package/src/services/title.magic.service.d.ts +0 -11
- package/src/ui/GuiInteractiveExecutor.d.ts +1 -3
- package/src/ui/components/base-magic-alert.component.d.ts +0 -16
- package/src/ui/components/base-magic-confirm.component.d.ts +0 -18
- package/src/ui/components/magic-alert.component.d.ts +0 -3
- package/src/ui/components/magic-confirmation-box.component.d.ts +0 -3
- package/src/ui/directives/NonMagicControlDirective.d.ts +0 -41
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +0 -9
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +0 -12
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +0 -3
- package/src/ui/directives/magic/row.magic.directive.d.ts +0 -15
- package/src/ui/directives/magic-focus.directive.d.ts +0 -3
- package/src/ui/directives/magic.directive.d.ts +0 -78
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +0 -3
- package/src/ui/directives/mgformat.magic.directive.d.ts +0 -40
- package/src/ui/directives/range-validator.magic.directive.d.ts +0 -16
- package/src/ui/magic-confirmationBox.d.ts +0 -19
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +0 -9
- package/src/ui/magic-modal/magic-modal-form.d.ts +0 -3
- package/src/ui/magic-modal/magic-modal-interface.d.ts +0 -27
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +0 -20
- package/src/ui/magic-modal/magic-overlay-container.d.ts +0 -51
- package/src/ui/magic-root.component.d.ts +0 -42
- package/src/ui/mgerror.magic.component.d.ts +0 -19
- package/src/ui/pipes/date.magic.pipe.d.ts +0 -6
- package/src/ui/pipes/time.magic.pipe.d.ts +0 -3
- package/src/ui/router-container.magic.component.d.ts +5 -21
- package/src/ui/subform.magic.component.d.ts +0 -21
- package/src/ui/task-base.magic.component.d.ts +0 -72
- package/src/ui/utils.d.ts +0 -3
|
@@ -296,21 +296,16 @@
|
|
|
296
296
|
return value;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
/**
|
|
300
|
-
* @ignore
|
|
301
|
-
*/
|
|
302
299
|
var ControlMetadata = /** @class */ (function () {
|
|
303
300
|
function ControlMetadata() {
|
|
304
301
|
this.properties = new Map();
|
|
305
302
|
this.classesMap = new Map();
|
|
306
303
|
this.stylesMap = new Map();
|
|
307
|
-
// user properties
|
|
308
304
|
this.userProperties = new Map();
|
|
309
305
|
this.customValidators = new Map();
|
|
310
306
|
}
|
|
311
307
|
ControlMetadata.prototype.setClass = function (key, value) {
|
|
312
308
|
var e_1, _a;
|
|
313
|
-
// for no-control - hold the name of the class to be removed later
|
|
314
309
|
if (this.classesMap.has(key)) {
|
|
315
310
|
this.removedClass = this.classesMap.get(key);
|
|
316
311
|
}
|
|
@@ -336,14 +331,9 @@
|
|
|
336
331
|
};
|
|
337
332
|
return ControlMetadata;
|
|
338
333
|
}());
|
|
339
|
-
/**
|
|
340
|
-
* @ignore
|
|
341
|
-
*/
|
|
342
334
|
var ControlsMetadata = /** @class */ (function () {
|
|
343
335
|
function ControlsMetadata() {
|
|
344
|
-
//values of control
|
|
345
336
|
this.values = new Map();
|
|
346
|
-
// dictionary of controls with there properties
|
|
347
337
|
this.ControlsProperties = new Map();
|
|
348
338
|
this.isCreated = false;
|
|
349
339
|
this.isEditing = false;
|
|
@@ -361,8 +351,6 @@
|
|
|
361
351
|
return this.ControlsProperties.get(controlId);
|
|
362
352
|
};
|
|
363
353
|
ControlsMetadata.prototype.update = function (obj) {
|
|
364
|
-
//should we keep the values here ?
|
|
365
|
-
//this.values = obj.ControlsValues;
|
|
366
354
|
var props = obj.ControlsMetaData;
|
|
367
355
|
for (var controlName in props) {
|
|
368
356
|
if (!this.ControlsProperties.has(controlName))
|
|
@@ -392,16 +380,13 @@
|
|
|
392
380
|
};
|
|
393
381
|
return ControlsMetadata;
|
|
394
382
|
}());
|
|
395
|
-
/**
|
|
396
|
-
* @ignore
|
|
397
|
-
*/
|
|
398
383
|
var Records = /** @class */ (function () {
|
|
399
384
|
function Records() {
|
|
400
385
|
this.data = new Map();
|
|
401
|
-
this.list = [];
|
|
386
|
+
this.list = [];
|
|
402
387
|
this.recordsBeforeCurrentView = 0;
|
|
403
388
|
this.isEmptyDataView = false;
|
|
404
|
-
this.sizeUpdated = false;
|
|
389
|
+
this.sizeUpdated = false;
|
|
405
390
|
}
|
|
406
391
|
Records.prototype.getRow = function (dvRowId) {
|
|
407
392
|
return this.list[dvRowId + this.recordsBeforeCurrentView];
|
|
@@ -425,24 +410,14 @@
|
|
|
425
410
|
}
|
|
426
411
|
return false;
|
|
427
412
|
};
|
|
428
|
-
/*
|
|
429
|
-
* for row editing
|
|
430
|
-
* */
|
|
431
413
|
Records.prototype.startRowEditing = function (guiRowId) {
|
|
432
414
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
|
433
415
|
this.data.get(guiRowId).isEditing = true;
|
|
434
416
|
};
|
|
435
|
-
/*
|
|
436
|
-
* stop row editing on row Id
|
|
437
|
-
* */
|
|
438
417
|
Records.prototype.stopRowEditing = function (guiRowId) {
|
|
439
418
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
|
440
419
|
this.data.get(guiRowId).isEditing = false;
|
|
441
420
|
};
|
|
442
|
-
/*
|
|
443
|
-
* return if row is in editing
|
|
444
|
-
* Called by the HTML code, so parameter is a string, not a numebr
|
|
445
|
-
* */
|
|
446
421
|
Records.prototype.isRowInRowEditing = function (guiRowId) {
|
|
447
422
|
if (+guiRowId < this.list.length) {
|
|
448
423
|
if (!this.data.has(+guiRowId) || util.isNullOrUndefined(this.data.get(+guiRowId)))
|
|
@@ -482,7 +457,6 @@
|
|
|
482
457
|
Records.prototype.updateSize = function (len) {
|
|
483
458
|
if (this.list.length != len) {
|
|
484
459
|
if (len < this.list.length) {
|
|
485
|
-
//remove rows
|
|
486
460
|
for (var i = len; i < this.list.length; i++) {
|
|
487
461
|
this.data.delete(i);
|
|
488
462
|
}
|
|
@@ -491,10 +465,6 @@
|
|
|
491
465
|
this.sizeUpdated = true;
|
|
492
466
|
}
|
|
493
467
|
};
|
|
494
|
-
/**
|
|
495
|
-
* crears data for the first record
|
|
496
|
-
* @param template
|
|
497
|
-
*/
|
|
498
468
|
Records.prototype.clearFirstTableRecord = function (template) {
|
|
499
469
|
if (this.list.length >= 1) {
|
|
500
470
|
for (var key in template) {
|
|
@@ -533,16 +503,11 @@
|
|
|
533
503
|
HtmlClasses["HintColor"] = "hintcolor";
|
|
534
504
|
})(exports.HtmlClasses || (exports.HtmlClasses = {}));
|
|
535
505
|
|
|
536
|
-
/**
|
|
537
|
-
* @ignore
|
|
538
|
-
*/
|
|
539
506
|
var EngineMagicService = /** @class */ (function () {
|
|
540
507
|
function EngineMagicService() {
|
|
541
508
|
this.magicBridge = engine.MagicBridge;
|
|
542
509
|
this.isStub = false;
|
|
543
|
-
// true when user is logged in magic
|
|
544
510
|
this.isLoggedIn = false;
|
|
545
|
-
//TODO - unregister
|
|
546
511
|
this.refreshDom = new rxjs.Subject();
|
|
547
512
|
this.interactiveCommands = new rxjs.Subject();
|
|
548
513
|
}
|
|
@@ -604,6 +569,9 @@
|
|
|
604
569
|
EngineMagicService.prototype.GetControlPictureMask = function (taskId, controlName) {
|
|
605
570
|
return this.magicBridge.GetControlPictureMask(taskId, controlName);
|
|
606
571
|
};
|
|
572
|
+
EngineMagicService.prototype.GetFormattedValue = function (taskId, controlName, value) {
|
|
573
|
+
return this.magicBridge.GetFormattedValue(taskId, controlName, value);
|
|
574
|
+
};
|
|
607
575
|
EngineMagicService.prototype.ValidateControlValue = function (taskId, controlName, value) {
|
|
608
576
|
return this.magicBridge.ValidateControlValue(taskId, controlName, value);
|
|
609
577
|
};
|
|
@@ -611,7 +579,6 @@
|
|
|
611
579
|
return this.magicBridge.GetFldRanges(taskId, controlName);
|
|
612
580
|
};
|
|
613
581
|
EngineMagicService.prototype.saveData = function (data) {
|
|
614
|
-
//this.magicBridge.saveData(data);
|
|
615
582
|
};
|
|
616
583
|
EngineMagicService.prototype.getIsLoggedIn = function () {
|
|
617
584
|
return this.isLoggedIn;
|
|
@@ -627,26 +594,17 @@
|
|
|
627
594
|
};
|
|
628
595
|
return EngineMagicService;
|
|
629
596
|
}());
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
597
|
+
EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
|
|
598
|
+
EngineMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
|
|
599
|
+
(function () {
|
|
633
600
|
i0.ɵsetClassMetadata(EngineMagicService, [{
|
|
634
601
|
type: i0.Injectable
|
|
635
602
|
}], null, null);
|
|
636
603
|
})();
|
|
637
604
|
|
|
638
|
-
/**
|
|
639
|
-
* Manages the list of components in a project, and the project title
|
|
640
|
-
*/
|
|
641
605
|
var ComponentListMagicService = /** @class */ (function () {
|
|
642
606
|
function ComponentListMagicService() {
|
|
643
|
-
/**
|
|
644
|
-
* Map of project components
|
|
645
|
-
*/
|
|
646
607
|
this.components = new Map();
|
|
647
|
-
/**
|
|
648
|
-
* Map of project dialogs
|
|
649
|
-
*/
|
|
650
608
|
this.dialogs = new Map();
|
|
651
609
|
this.lazyLoadModulesMap = null;
|
|
652
610
|
}
|
|
@@ -660,11 +618,6 @@
|
|
|
660
618
|
data = this.components.get(name);
|
|
661
619
|
return data;
|
|
662
620
|
};
|
|
663
|
-
/**
|
|
664
|
-
* Return a component according to name
|
|
665
|
-
* @param name Name of requested component
|
|
666
|
-
* @returns The requested component
|
|
667
|
-
*/
|
|
668
621
|
ComponentListMagicService.prototype.getComponent = function (name, mustHaveData) {
|
|
669
622
|
if (mustHaveData === void 0) { mustHaveData = true; }
|
|
670
623
|
var data = this.getData(name, mustHaveData);
|
|
@@ -676,30 +629,17 @@
|
|
|
676
629
|
this.components.set(key, data);
|
|
677
630
|
}
|
|
678
631
|
};
|
|
679
|
-
/**
|
|
680
|
-
* Return a component according to name
|
|
681
|
-
* @param name Name of requested component
|
|
682
|
-
* @returns The requested component
|
|
683
|
-
*/
|
|
684
632
|
ComponentListMagicService.prototype.getModuleRef = function (name) {
|
|
685
633
|
var data = this.getData(name, false);
|
|
686
634
|
return data ? data.moduleRef : null;
|
|
687
635
|
;
|
|
688
636
|
};
|
|
689
|
-
/**
|
|
690
|
-
* Return the lazy load module details of the specified component
|
|
691
|
-
* @param name: Name of requested component
|
|
692
|
-
* @returns: lazy load module details
|
|
693
|
-
*/
|
|
694
637
|
ComponentListMagicService.prototype.getLazyLoadModuleData = function (name) {
|
|
695
638
|
return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
|
|
696
639
|
};
|
|
697
640
|
return ComponentListMagicService;
|
|
698
641
|
}());
|
|
699
642
|
|
|
700
|
-
/**
|
|
701
|
-
* @ignore
|
|
702
|
-
*/
|
|
703
643
|
var StylesMapManager = /** @class */ (function () {
|
|
704
644
|
function StylesMapManager() {
|
|
705
645
|
}
|
|
@@ -714,29 +654,368 @@
|
|
|
714
654
|
style = mscorelib.NString.Format(value.toString(), magicValue);
|
|
715
655
|
}
|
|
716
656
|
}
|
|
717
|
-
return style;
|
|
657
|
+
return style;
|
|
658
|
+
};
|
|
659
|
+
return StylesMapManager;
|
|
660
|
+
}());
|
|
661
|
+
StylesMapManager.StylesMap = new Map([
|
|
662
|
+
[utils$1.MagicProperties.LineDivider, new Map([[true, "solid"], [false, "hidden"]])],
|
|
663
|
+
[utils$1.MagicProperties.ImageFile, "url('\{0}\')"],
|
|
664
|
+
[utils$1.MagicProperties.Wallpaper, "url('\{0}\')"]
|
|
665
|
+
]);
|
|
666
|
+
StylesMapManager.MagicPropertyToHtmlAttributeMap = new Map([
|
|
667
|
+
[utils$1.MagicProperties.LineDivider, "border-bottom-style"],
|
|
668
|
+
[utils$1.MagicProperties.ImageFile, "background-image"],
|
|
669
|
+
[utils$1.MagicProperties.Wallpaper, "background-image"]
|
|
670
|
+
]);
|
|
671
|
+
|
|
672
|
+
var CommandsCollectorMagicService = /** @class */ (function () {
|
|
673
|
+
function CommandsCollectorMagicService(magic) {
|
|
674
|
+
this.magic = magic;
|
|
675
|
+
this.count = 0;
|
|
676
|
+
this.commands = new mscorelib.List();
|
|
677
|
+
this.subscription = null;
|
|
678
|
+
}
|
|
679
|
+
CommandsCollectorMagicService.prototype.startCollecting = function () {
|
|
680
|
+
var _this = this;
|
|
681
|
+
this.count++;
|
|
682
|
+
utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- " + this.count);
|
|
683
|
+
if (this.subscription === null) {
|
|
684
|
+
this.subscription = this.magic.refreshDom
|
|
685
|
+
.subscribe(function (command) {
|
|
686
|
+
_this.commands.push(command);
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
CommandsCollectorMagicService.prototype.stopCollecting = function () {
|
|
691
|
+
this.count--;
|
|
692
|
+
utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- " + this.count);
|
|
693
|
+
if (this.count === 0) {
|
|
694
|
+
this.subscription.unsubscribe();
|
|
695
|
+
this.subscription = null;
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
CommandsCollectorMagicService.prototype.GetCommands = function (taskId) {
|
|
699
|
+
var _this = this;
|
|
700
|
+
var commands = this.commands.filter(function (command) { return command.TaskTag === taskId; });
|
|
701
|
+
commands.forEach(function (command) { _this.commands.Remove(command); });
|
|
702
|
+
return commands;
|
|
703
|
+
};
|
|
704
|
+
return CommandsCollectorMagicService;
|
|
705
|
+
}());
|
|
706
|
+
CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
|
|
707
|
+
CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
|
|
708
|
+
(function () {
|
|
709
|
+
i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
|
710
|
+
type: i0.Injectable
|
|
711
|
+
}], function () { return [{ type: EngineMagicService }]; }, null);
|
|
712
|
+
})();
|
|
713
|
+
|
|
714
|
+
var RouteCommand = /** @class */ (function () {
|
|
715
|
+
function RouteCommand() {
|
|
716
|
+
}
|
|
717
|
+
return RouteCommand;
|
|
718
|
+
}());
|
|
719
|
+
var RouterCommandsMagicService = /** @class */ (function () {
|
|
720
|
+
function RouterCommandsMagicService() {
|
|
721
|
+
this.pendingRouteCommands = [];
|
|
722
|
+
}
|
|
723
|
+
RouterCommandsMagicService.prototype.AddRouteCommand = function (routeCommand) {
|
|
724
|
+
this.pendingRouteCommands.push(routeCommand);
|
|
725
|
+
};
|
|
726
|
+
RouterCommandsMagicService.prototype.ExecuteNextCommand = function () {
|
|
727
|
+
var pendingRouteCommand = this.pendingRouteCommands.shift();
|
|
728
|
+
if (!util.isNullOrUndefined(pendingRouteCommand)) {
|
|
729
|
+
pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
return RouterCommandsMagicService;
|
|
733
|
+
}());
|
|
734
|
+
RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
|
|
735
|
+
RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
|
|
736
|
+
(function () {
|
|
737
|
+
i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
|
|
738
|
+
type: i0.Injectable
|
|
739
|
+
}], null, null);
|
|
740
|
+
})();
|
|
741
|
+
|
|
742
|
+
var SubformMagicService = /** @class */ (function () {
|
|
743
|
+
function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector) {
|
|
744
|
+
this.task = task;
|
|
745
|
+
this.activatedRoute = activatedRoute;
|
|
746
|
+
this.componentList = componentList;
|
|
747
|
+
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
748
|
+
this.router = router;
|
|
749
|
+
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
750
|
+
this.componentListMagicService = componentListMagicService;
|
|
751
|
+
this.loader = loader;
|
|
752
|
+
this.injector = injector;
|
|
753
|
+
this.subformsDict = {};
|
|
754
|
+
this.routesDict = {};
|
|
755
|
+
this.currentRouteDefinition = null;
|
|
756
|
+
}
|
|
757
|
+
SubformMagicService.prototype.mgGetComp = function (subformName) {
|
|
758
|
+
if (subformName in this.subformsDict) {
|
|
759
|
+
var formName = this.subformsDict[subformName].formName;
|
|
760
|
+
if (formName)
|
|
761
|
+
return this.componentList.getComponent(formName);
|
|
762
|
+
}
|
|
763
|
+
return null;
|
|
764
|
+
};
|
|
765
|
+
SubformMagicService.prototype.mgGetParameters = function (subformName) {
|
|
766
|
+
if (subformName in this.subformsDict) {
|
|
767
|
+
return this.subformsDict[subformName].parameters;
|
|
768
|
+
}
|
|
769
|
+
else
|
|
770
|
+
return "";
|
|
771
|
+
};
|
|
772
|
+
SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
|
|
773
|
+
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
774
|
+
if (this.subformsDict[subformControlName].formName === formName) {
|
|
775
|
+
this.subformsDict[subformControlName] = {};
|
|
776
|
+
this.task.refreshView();
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
|
781
|
+
var _this = this;
|
|
782
|
+
this.pendingCommandsCollector.startCollecting();
|
|
783
|
+
var refreshNeeded = false;
|
|
784
|
+
if (util.isNullOrUndefined(routerPath)) {
|
|
785
|
+
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
786
|
+
if (this.subformsDict[subformControlName].formName === formName) {
|
|
787
|
+
this.subformsDict[subformControlName] = {};
|
|
788
|
+
this.task.refreshView();
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
var moduleRef_1 = this.componentListMagicService.getModuleRef(formName);
|
|
792
|
+
if (moduleRef_1 == null) {
|
|
793
|
+
var lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
|
794
|
+
if (lazyLoadModule != null) {
|
|
795
|
+
this.loader
|
|
796
|
+
.load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
|
|
797
|
+
.then(function (moduleFactory) {
|
|
798
|
+
moduleRef_1 = moduleFactory.create(_this.injector);
|
|
799
|
+
_this.subformsDict[subformControlName] = {
|
|
800
|
+
formName: formName,
|
|
801
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
802
|
+
};
|
|
803
|
+
_this.task.refreshView();
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
this.subformsDict[subformControlName] = {
|
|
809
|
+
formName: formName,
|
|
810
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
811
|
+
};
|
|
812
|
+
refreshNeeded = true;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
if (inDefaultOutlet)
|
|
817
|
+
subformControlName = "primary";
|
|
818
|
+
var routeParams = new mscorelib.List();
|
|
819
|
+
routeParams.push(routerPath);
|
|
820
|
+
if (params !== null) {
|
|
821
|
+
routeParams = routeParams.concat(params);
|
|
822
|
+
}
|
|
823
|
+
var routeCommand = {
|
|
824
|
+
callerMgSubformServiceRef: this,
|
|
825
|
+
routerOutletName: subformControlName,
|
|
826
|
+
formName: formName,
|
|
827
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
|
828
|
+
routeParams: routeParams
|
|
829
|
+
};
|
|
830
|
+
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
831
|
+
this.ExecuteRouteCommand(routeCommand);
|
|
832
|
+
else
|
|
833
|
+
this.routerCommandsMagicService.AddRouteCommand(routeCommand);
|
|
834
|
+
}
|
|
835
|
+
if (refreshNeeded)
|
|
836
|
+
this.task.refreshView();
|
|
837
|
+
};
|
|
838
|
+
SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
|
|
839
|
+
var _a;
|
|
840
|
+
var reusingComponent = false;
|
|
841
|
+
var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
|
842
|
+
var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
|
843
|
+
if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
|
|
844
|
+
currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
|
|
845
|
+
.then(function (result) {
|
|
846
|
+
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
847
|
+
currentSubformMagicService.currentRouteDefinition = {
|
|
848
|
+
formName: routeCommand.formName,
|
|
849
|
+
parameters: routeCommand.parameters
|
|
850
|
+
};
|
|
851
|
+
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
else {
|
|
855
|
+
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
856
|
+
currentSubformMagicService.currentRouteDefinition = {
|
|
857
|
+
formName: routeCommand.formName,
|
|
858
|
+
parameters: routeCommand.parameters
|
|
859
|
+
};
|
|
860
|
+
if (SubformMagicService.routerContainers.length > 0) {
|
|
861
|
+
var routeContainer = SubformMagicService.routerContainers[0];
|
|
862
|
+
SubformMagicService.routerContainers.shift();
|
|
863
|
+
routeContainer.initializeComponent();
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
SubformMagicService.prototype.PerformRouterNavigate = function (routerOutletName, routeParams) {
|
|
871
|
+
var _a;
|
|
872
|
+
var relativeRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
873
|
+
this.router.navigate([{ outlets: (_a = {}, _a[routerOutletName] = routeParams, _a) }], { relativeTo: relativeRoute })
|
|
874
|
+
.then(function (result) {
|
|
875
|
+
if (result !== null && !result) {
|
|
876
|
+
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
877
|
+
subformMagicService.currentRouteDefinition = null;
|
|
878
|
+
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
879
|
+
subformMagicService.pendingCommandsCollector.stopCollecting();
|
|
880
|
+
subformMagicService.routerCommandsMagicService.ExecuteNextCommand();
|
|
881
|
+
}
|
|
882
|
+
});
|
|
883
|
+
};
|
|
884
|
+
SubformMagicService.prototype.init = function () {
|
|
885
|
+
var _this = this;
|
|
886
|
+
var pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
|
887
|
+
if (pendingCommands.length > 0) {
|
|
888
|
+
pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
|
|
889
|
+
this.task.refreshView();
|
|
890
|
+
}
|
|
891
|
+
this.pendingCommandsCollector.stopCollecting();
|
|
892
|
+
};
|
|
893
|
+
SubformMagicService.prototype.refreshView = function () {
|
|
894
|
+
this.task.refreshView();
|
|
895
|
+
};
|
|
896
|
+
SubformMagicService.getRelativeRoute = function (sendActivatedRoute) {
|
|
897
|
+
var currentActiveRoute = sendActivatedRoute;
|
|
898
|
+
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
|
899
|
+
currentActiveRoute = currentActiveRoute.parent;
|
|
900
|
+
if (!currentActiveRoute.snapshot.routeConfig.loadChildren)
|
|
901
|
+
console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.");
|
|
902
|
+
}
|
|
903
|
+
return currentActiveRoute;
|
|
904
|
+
};
|
|
905
|
+
return SubformMagicService;
|
|
906
|
+
}());
|
|
907
|
+
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
908
|
+
SubformMagicService.routerContainers = new Array();
|
|
909
|
+
SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(i0.NgModuleFactoryLoader), i0.ɵɵinject(i0.Injector)); };
|
|
910
|
+
SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
911
|
+
(function () {
|
|
912
|
+
i0.ɵsetClassMetadata(SubformMagicService, [{
|
|
913
|
+
type: i0.Injectable
|
|
914
|
+
}], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: i0.NgModuleFactoryLoader }, { type: i0.Injector }]; }, null);
|
|
915
|
+
})();
|
|
916
|
+
|
|
917
|
+
var RouterContainerMagicComponent = /** @class */ (function () {
|
|
918
|
+
function RouterContainerMagicComponent(activatedRoute, router, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
919
|
+
this.activatedRoute = activatedRoute;
|
|
920
|
+
this.router = router;
|
|
921
|
+
this.magic = magic;
|
|
922
|
+
this.containerTaskService = containerTaskService;
|
|
923
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
924
|
+
this.viewContainerRef = viewContainerRef;
|
|
925
|
+
this.componentList = componentList;
|
|
926
|
+
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
927
|
+
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
928
|
+
this.componentRef = null;
|
|
929
|
+
this.parentMgSubformService = null;
|
|
930
|
+
}
|
|
931
|
+
Object.defineProperty(RouterContainerMagicComponent, "LastRoute", {
|
|
932
|
+
get: function () {
|
|
933
|
+
return RouterContainerMagicComponent.lastRoute;
|
|
934
|
+
},
|
|
935
|
+
enumerable: false,
|
|
936
|
+
configurable: true
|
|
937
|
+
});
|
|
938
|
+
RouterContainerMagicComponent.prototype.ngOnInit = function () {
|
|
939
|
+
var outletname = this.activatedRoute.outlet;
|
|
940
|
+
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
941
|
+
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
942
|
+
RouterContainerMagicComponent.lastRoute = this.router.url;
|
|
943
|
+
if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
|
|
944
|
+
this.insertRouteEvent(currentActiveRoute);
|
|
945
|
+
SubformMagicService.routerContainers.push(this);
|
|
946
|
+
}
|
|
947
|
+
else {
|
|
948
|
+
this.initializeComponent();
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
RouterContainerMagicComponent.prototype.insertRouteEvent = function (currentActiveRoute) {
|
|
952
|
+
var guiEvent = engine.getGuiEventObj('RouterNavigate', null, 0);
|
|
953
|
+
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
954
|
+
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
955
|
+
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
|
956
|
+
var calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
957
|
+
if (calcRouterPath.length > 0) {
|
|
958
|
+
var routerPath = calcRouterPath;
|
|
959
|
+
var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
|
|
960
|
+
guiEvent.RouterPath = tokens[0];
|
|
961
|
+
guiEvent.RouterParams = new mscorelib.List();
|
|
962
|
+
for (var i = 1; i < tokens.length; i++) {
|
|
963
|
+
guiEvent.RouterParams.push(this.activatedRoute.snapshot.params[tokens[i]]);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
this.containerTaskService.insertEvent(guiEvent);
|
|
967
|
+
};
|
|
968
|
+
RouterContainerMagicComponent.prototype.initializeComponent = function () {
|
|
969
|
+
var _this = this;
|
|
970
|
+
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
971
|
+
if (subformMagicService.currentRouteDefinition !== null) {
|
|
972
|
+
var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
973
|
+
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
|
|
974
|
+
this.componentRef = this.viewContainerRef.createComponent(componentFactory);
|
|
975
|
+
Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
|
|
976
|
+
var myActiveRoute_1 = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
977
|
+
var routeParams = utils$1.StrUtil.tokenize(myActiveRoute_1.snapshot.routeConfig.path, "/:");
|
|
978
|
+
subformMagicService.routesDict[myActiveRoute_1.snapshot.outlet] = routeParams[0];
|
|
979
|
+
this.parentMgSubformService = subformMagicService;
|
|
980
|
+
subformMagicService.currentRouteDefinition = null;
|
|
981
|
+
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
982
|
+
var ignoreParamChange_1 = true;
|
|
983
|
+
myActiveRoute_1.paramMap.subscribe(function (params) {
|
|
984
|
+
if (!ignoreParamChange_1)
|
|
985
|
+
_this.insertRouteEvent(myActiveRoute_1);
|
|
986
|
+
ignoreParamChange_1 = false;
|
|
987
|
+
});
|
|
988
|
+
this.parentMgSubformService.refreshView();
|
|
989
|
+
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
990
|
+
}
|
|
718
991
|
};
|
|
719
|
-
|
|
992
|
+
RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
|
|
993
|
+
if (this.componentRef != null) {
|
|
994
|
+
this.componentRef.instance.task.close();
|
|
995
|
+
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
996
|
+
this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
|
|
997
|
+
RouterContainerMagicComponent.lastRoute = this.router.url;
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
return RouterContainerMagicComponent;
|
|
720
1001
|
}());
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
1002
|
+
RouterContainerMagicComponent.lastRoute = "/";
|
|
1003
|
+
RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
|
|
1004
|
+
RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
1005
|
+
(function () {
|
|
1006
|
+
i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
1007
|
+
type: i0.Component,
|
|
1008
|
+
args: [{
|
|
1009
|
+
selector: 'magic-route-outlet',
|
|
1010
|
+
template: "\n "
|
|
1011
|
+
}]
|
|
1012
|
+
}], function () { return [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
|
|
1013
|
+
})();
|
|
731
1014
|
|
|
732
|
-
/**
|
|
733
|
-
* @ignore
|
|
734
|
-
*/
|
|
735
1015
|
var GuiInteractiveExecutor = /** @class */ (function () {
|
|
736
1016
|
function GuiInteractiveExecutor() {
|
|
737
1017
|
}
|
|
738
1018
|
GuiInteractiveExecutor.prototype.Run = function () {
|
|
739
|
-
// Sets the currentContextID
|
|
740
1019
|
try {
|
|
741
1020
|
switch (this.command._commandType) {
|
|
742
1021
|
case gui.InteractiveCommandType.GET_VALUE:
|
|
@@ -763,11 +1042,13 @@
|
|
|
763
1042
|
case gui.InteractiveCommandType.REFRESH_PAGE:
|
|
764
1043
|
this.OnRefreshPage();
|
|
765
1044
|
break;
|
|
1045
|
+
case gui.InteractiveCommandType.GET_LAST_ROUTE:
|
|
1046
|
+
this.OnGetLastRoute();
|
|
1047
|
+
break;
|
|
766
1048
|
}
|
|
767
1049
|
}
|
|
768
1050
|
catch (ex) {
|
|
769
1051
|
throw ex;
|
|
770
|
-
//want to see all the exceptions for now
|
|
771
1052
|
}
|
|
772
1053
|
};
|
|
773
1054
|
GuiInteractiveExecutor.executeInteractiveCommand = function (task, guiIntactiveCommand, overlayService) {
|
|
@@ -823,6 +1104,9 @@
|
|
|
823
1104
|
else
|
|
824
1105
|
this.command._boolVal = this.task.Records.list[guiRowIndex].isEditing;
|
|
825
1106
|
};
|
|
1107
|
+
GuiInteractiveExecutor.prototype.OnGetLastRoute = function () {
|
|
1108
|
+
this.command.resultString = RouterContainerMagicComponent.LastRoute;
|
|
1109
|
+
};
|
|
826
1110
|
return GuiInteractiveExecutor;
|
|
827
1111
|
}());
|
|
828
1112
|
|
|
@@ -848,30 +1132,18 @@
|
|
|
848
1132
|
i0.Output()
|
|
849
1133
|
], exports.BaseMagicOverlayContainer);
|
|
850
1134
|
|
|
851
|
-
/**
|
|
852
|
-
* This is a base class for the magic confirm components
|
|
853
|
-
*/
|
|
854
1135
|
var BaseMagicConfirmComponent = /** @class */ (function () {
|
|
855
1136
|
function BaseMagicConfirmComponent() {
|
|
856
|
-
/**
|
|
857
|
-
* onClose Event - to be raised when the component is closed
|
|
858
|
-
* should pass true when OK is pressed and false when cancel is pressed
|
|
859
|
-
*/
|
|
860
1137
|
this.onClose = new i0.EventEmitter();
|
|
861
1138
|
}
|
|
862
|
-
/**
|
|
863
|
-
* raises close Event
|
|
864
|
-
* @param result true when OK is pressed and false when cancel is pressed
|
|
865
|
-
*
|
|
866
|
-
*/
|
|
867
1139
|
BaseMagicConfirmComponent.prototype.OnClose = function (result) {
|
|
868
1140
|
this.onClose.emit(result);
|
|
869
1141
|
};
|
|
870
1142
|
return BaseMagicConfirmComponent;
|
|
871
1143
|
}());
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1144
|
+
BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
|
|
1145
|
+
BaseMagicConfirmComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, styles: [""] });
|
|
1146
|
+
(function () {
|
|
875
1147
|
i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
|
876
1148
|
type: i0.Component,
|
|
877
1149
|
args: [{
|
|
@@ -888,28 +1160,18 @@
|
|
|
888
1160
|
}] });
|
|
889
1161
|
})();
|
|
890
1162
|
|
|
891
|
-
/**
|
|
892
|
-
* This is a base class for the magic alert components
|
|
893
|
-
*/
|
|
894
1163
|
var BaseMagicAlertComponent = /** @class */ (function () {
|
|
895
1164
|
function BaseMagicAlertComponent() {
|
|
896
|
-
/**
|
|
897
|
-
* onClose Event - to be raised when the component is closed
|
|
898
|
-
|
|
899
|
-
*/
|
|
900
1165
|
this.onClose = new i0.EventEmitter();
|
|
901
1166
|
}
|
|
902
|
-
/**
|
|
903
|
-
* close magic alert
|
|
904
|
-
*/
|
|
905
1167
|
BaseMagicAlertComponent.prototype.OnClose = function () {
|
|
906
1168
|
this.onClose.emit();
|
|
907
1169
|
};
|
|
908
1170
|
return BaseMagicAlertComponent;
|
|
909
1171
|
}());
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
1172
|
+
BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
|
|
1173
|
+
BaseMagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, styles: [""] });
|
|
1174
|
+
(function () {
|
|
913
1175
|
i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
|
914
1176
|
type: i0.Component,
|
|
915
1177
|
args: [{
|
|
@@ -926,9 +1188,6 @@
|
|
|
926
1188
|
}] });
|
|
927
1189
|
})();
|
|
928
1190
|
|
|
929
|
-
/**
|
|
930
|
-
* Directive for setting focus on element
|
|
931
|
-
*/
|
|
932
1191
|
var MagicFocusDirective = /** @class */ (function () {
|
|
933
1192
|
function MagicFocusDirective(hostElement) {
|
|
934
1193
|
this.hostElement = hostElement;
|
|
@@ -938,9 +1197,9 @@
|
|
|
938
1197
|
};
|
|
939
1198
|
return MagicFocusDirective;
|
|
940
1199
|
}());
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1200
|
+
MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
1201
|
+
MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
|
|
1202
|
+
(function () {
|
|
944
1203
|
i0.ɵsetClassMetadata(MagicFocusDirective, [{
|
|
945
1204
|
type: i0.Directive,
|
|
946
1205
|
args: [{
|
|
@@ -949,22 +1208,18 @@
|
|
|
949
1208
|
}], function () { return [{ type: i0.ElementRef }]; }, null);
|
|
950
1209
|
})();
|
|
951
1210
|
|
|
952
|
-
/**
|
|
953
|
-
* Directive for setting ViewContainerRef on element
|
|
954
|
-
*/
|
|
955
1211
|
var MagicViewContainerRef = /** @class */ (function () {
|
|
956
1212
|
function MagicViewContainerRef(vcRef, resolver) {
|
|
957
1213
|
this.vcRef = vcRef;
|
|
958
1214
|
this.resolver = resolver;
|
|
959
|
-
// For angular 10 - find the component from the views
|
|
960
1215
|
var comp = (this.vcRef._hostView).find(function (v) { return v != null && !util.isNullOrUndefined(v.setViewContainerRef); });
|
|
961
1216
|
comp.setViewContainerRef(vcRef);
|
|
962
1217
|
}
|
|
963
1218
|
return MagicViewContainerRef;
|
|
964
1219
|
}());
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1220
|
+
MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
1221
|
+
MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
|
|
1222
|
+
(function () {
|
|
968
1223
|
i0.ɵsetClassMetadata(MagicViewContainerRef, [{
|
|
969
1224
|
type: i0.Directive,
|
|
970
1225
|
args: [{
|
|
@@ -975,29 +1230,16 @@
|
|
|
975
1230
|
|
|
976
1231
|
var _c0 = ["overlayContainerWrapper"];
|
|
977
1232
|
var MagicOverlayContainerWrapper = /** @class */ (function () {
|
|
978
|
-
/**
|
|
979
|
-
*
|
|
980
|
-
* @param componentFactoryResolver
|
|
981
|
-
*/
|
|
982
1233
|
function MagicOverlayContainerWrapper(componentListMagicService, loader, injector, componentFactoryResolver, changeDetectorRef) {
|
|
983
1234
|
this.componentListMagicService = componentListMagicService;
|
|
984
1235
|
this.loader = loader;
|
|
985
1236
|
this.injector = injector;
|
|
986
1237
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
987
1238
|
this.changeDetectorRef = changeDetectorRef;
|
|
988
|
-
/**
|
|
989
|
-
*
|
|
990
|
-
*/
|
|
991
1239
|
this.Component = null;
|
|
992
|
-
/**
|
|
993
|
-
*
|
|
994
|
-
*/
|
|
995
1240
|
this.Parameters = {};
|
|
996
1241
|
this.onClose = new i0.EventEmitter();
|
|
997
1242
|
}
|
|
998
|
-
/**
|
|
999
|
-
*
|
|
1000
|
-
*/
|
|
1001
1243
|
MagicOverlayContainerWrapper.prototype.ngOnInit = function () {
|
|
1002
1244
|
var _this = this;
|
|
1003
1245
|
var moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
|
@@ -1050,17 +1292,13 @@
|
|
|
1050
1292
|
};
|
|
1051
1293
|
return MagicOverlayContainerWrapper;
|
|
1052
1294
|
}());
|
|
1053
|
-
/**
|
|
1054
|
-
* @ignore
|
|
1055
|
-
* contais data of allowed base components to use
|
|
1056
|
-
*/
|
|
1057
1295
|
MagicOverlayContainerWrapper.allowedBaseComps = new Map([
|
|
1058
1296
|
[gui.OverlayType.Overlay, { comp: exports.BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
|
|
1059
1297
|
[gui.OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
|
1060
1298
|
[gui.OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
|
1061
1299
|
]);
|
|
1062
|
-
|
|
1063
|
-
|
|
1300
|
+
MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.NgModuleFactoryLoader), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
1301
|
+
MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) {
|
|
1064
1302
|
if (rf & 1) {
|
|
1065
1303
|
i0.ɵɵstaticViewQuery(_c0, true);
|
|
1066
1304
|
}
|
|
@@ -1079,7 +1317,7 @@
|
|
|
1079
1317
|
i0.ɵɵelementEnd();
|
|
1080
1318
|
}
|
|
1081
1319
|
}, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }"] });
|
|
1082
|
-
|
|
1320
|
+
(function () {
|
|
1083
1321
|
i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
|
|
1084
1322
|
type: i0.Component,
|
|
1085
1323
|
args: [{
|
|
@@ -1101,17 +1339,10 @@
|
|
|
1101
1339
|
}] });
|
|
1102
1340
|
})();
|
|
1103
1341
|
|
|
1104
|
-
/**
|
|
1105
|
-
* Displays a message-box
|
|
1106
|
-
*/
|
|
1107
1342
|
var confirmationBox = /** @class */ (function () {
|
|
1108
1343
|
function confirmationBox() {
|
|
1109
1344
|
}
|
|
1110
|
-
/**
|
|
1111
|
-
* @ignore
|
|
1112
|
-
*/
|
|
1113
1345
|
confirmationBox.isConfirmBox = function (style) {
|
|
1114
|
-
// button format mask is in first nibble from right
|
|
1115
1346
|
var buttonMode = style & 0x0F;
|
|
1116
1347
|
var isConfirm = (buttonMode === gui.Styles.MSGBOX_BUTTON_OK_CANCEL) ||
|
|
1117
1348
|
(buttonMode === gui.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
|
|
@@ -1120,14 +1351,7 @@
|
|
|
1120
1351
|
(buttonMode === gui.Styles.MSGBOX_BUTTON_RETRY_CANCEL);
|
|
1121
1352
|
return (isConfirm);
|
|
1122
1353
|
};
|
|
1123
|
-
/**
|
|
1124
|
-
* Converts the result from the HTML window to the expected result type
|
|
1125
|
-
* @param style Result received from HTML window
|
|
1126
|
-
* @param okWasPressed Was the "OK" pressed
|
|
1127
|
-
* @returns MessageBox result type
|
|
1128
|
-
*/
|
|
1129
1354
|
confirmationBox.convertToExcpectedResultBox = function (style, okWasPressed) {
|
|
1130
|
-
// button format mask is in first nibble from right
|
|
1131
1355
|
var buttonMode = style & 0x0F;
|
|
1132
1356
|
var retValue = gui.Styles.MSGBOX_RESULT_OK;
|
|
1133
1357
|
if (buttonMode === gui.Styles.MSGBOX_BUTTON_OK)
|
|
@@ -1144,19 +1368,10 @@
|
|
|
1144
1368
|
retValue = okWasPressed ? gui.Styles.MSGBOX_RESULT_RETRY : gui.Styles.MSGBOX_RESULT_CANCEL;
|
|
1145
1369
|
return retValue;
|
|
1146
1370
|
};
|
|
1147
|
-
/**
|
|
1148
|
-
* Show a message box as an HTML window
|
|
1149
|
-
* @param title Title of the message box
|
|
1150
|
-
* @param message Message that will be display in the message box
|
|
1151
|
-
* @param style Style that include buttons \ Icons
|
|
1152
|
-
* @returns MessageBox result
|
|
1153
|
-
*/
|
|
1154
1371
|
confirmationBox.showConfirmationBox = function (title, message, style) {
|
|
1155
1372
|
var okWasPressed = false;
|
|
1156
1373
|
var retValue = gui.Styles.MSGBOX_RESULT_OK;
|
|
1157
|
-
// check if it is confirmation box
|
|
1158
1374
|
var isConfirm = this.isConfirmBox(style);
|
|
1159
|
-
// the title will be added to the string and we will add new line after the title
|
|
1160
1375
|
var titleAndString = title + '\n' + '\n' + message;
|
|
1161
1376
|
if (isConfirm)
|
|
1162
1377
|
okWasPressed = confirm(titleAndString);
|
|
@@ -1164,7 +1379,6 @@
|
|
|
1164
1379
|
alert(titleAndString);
|
|
1165
1380
|
okWasPressed = true;
|
|
1166
1381
|
}
|
|
1167
|
-
// return the result from the user
|
|
1168
1382
|
return okWasPressed;
|
|
1169
1383
|
};
|
|
1170
1384
|
return confirmationBox;
|
|
@@ -1198,38 +1412,18 @@
|
|
|
1198
1412
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
|
1199
1413
|
}
|
|
1200
1414
|
}
|
|
1201
|
-
/**
|
|
1202
|
-
* Creates a modal window for Magic modal window components
|
|
1203
|
-
*/
|
|
1204
1415
|
var MagicOverlayContainer = /** @class */ (function (_super) {
|
|
1205
1416
|
__extends(MagicOverlayContainer, _super);
|
|
1206
|
-
/**
|
|
1207
|
-
*
|
|
1208
|
-
* @param injector
|
|
1209
|
-
* @param componentFactoryResolver
|
|
1210
|
-
*/
|
|
1211
1417
|
function MagicOverlayContainer(injector, componentFactoryResolver) {
|
|
1212
1418
|
var _this = _super.call(this) || this;
|
|
1213
1419
|
_this.injector = injector;
|
|
1214
1420
|
_this.componentFactoryResolver = componentFactoryResolver;
|
|
1215
|
-
/**
|
|
1216
|
-
*
|
|
1217
|
-
*/
|
|
1218
1421
|
_this.ModalComp = null;
|
|
1219
|
-
/**
|
|
1220
|
-
*
|
|
1221
|
-
*/
|
|
1222
1422
|
_this.ModalCompParameters = {};
|
|
1223
1423
|
_this.onClose = new i0.EventEmitter();
|
|
1224
|
-
/**
|
|
1225
|
-
*
|
|
1226
|
-
*/
|
|
1227
1424
|
_this.componentRef = null;
|
|
1228
1425
|
return _this;
|
|
1229
1426
|
}
|
|
1230
|
-
/**
|
|
1231
|
-
*
|
|
1232
|
-
*/
|
|
1233
1427
|
MagicOverlayContainer.prototype.ngOnInit = function () {
|
|
1234
1428
|
var factory = this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);
|
|
1235
1429
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(factory);
|
|
@@ -1238,10 +1432,6 @@
|
|
|
1238
1432
|
MagicOverlayContainer.prototype.setViewContainerRef = function (vcRef) {
|
|
1239
1433
|
this.modalbodyViewContainerRef = vcRef;
|
|
1240
1434
|
};
|
|
1241
|
-
/**
|
|
1242
|
-
* Returns the form name
|
|
1243
|
-
* @returns
|
|
1244
|
-
*/
|
|
1245
1435
|
MagicOverlayContainer.prototype.getText = function () {
|
|
1246
1436
|
if (this.componentRef !== null) {
|
|
1247
1437
|
var comp = this.componentRef.instance;
|
|
@@ -1250,10 +1440,6 @@
|
|
|
1250
1440
|
else
|
|
1251
1441
|
return "";
|
|
1252
1442
|
};
|
|
1253
|
-
/**
|
|
1254
|
-
* Returns CSS styles for the window
|
|
1255
|
-
* @returns
|
|
1256
|
-
*/
|
|
1257
1443
|
MagicOverlayContainer.prototype.getStyle = function () {
|
|
1258
1444
|
var styles = {};
|
|
1259
1445
|
if (this.componentRef != undefined) {
|
|
@@ -1270,10 +1456,6 @@
|
|
|
1270
1456
|
}
|
|
1271
1457
|
return styles;
|
|
1272
1458
|
};
|
|
1273
|
-
/**
|
|
1274
|
-
* Returns the CSS styles for the client area
|
|
1275
|
-
* @returns
|
|
1276
|
-
*/
|
|
1277
1459
|
MagicOverlayContainer.prototype.getClientAreaStyles = function () {
|
|
1278
1460
|
var styles = {};
|
|
1279
1461
|
if (this.componentRef != undefined) {
|
|
@@ -1289,25 +1471,15 @@
|
|
|
1289
1471
|
}
|
|
1290
1472
|
return styles;
|
|
1291
1473
|
};
|
|
1292
|
-
/**
|
|
1293
|
-
* Should the title bar be displayed
|
|
1294
|
-
* @returns
|
|
1295
|
-
*/
|
|
1296
1474
|
MagicOverlayContainer.prototype.getShowTitleBar = function () {
|
|
1297
1475
|
if (this.componentRef != undefined) {
|
|
1298
1476
|
var comp = this.componentRef.instance;
|
|
1299
1477
|
return comp.ShowTitleBar();
|
|
1300
1478
|
}
|
|
1301
1479
|
};
|
|
1302
|
-
/**
|
|
1303
|
-
*
|
|
1304
|
-
*/
|
|
1305
1480
|
MagicOverlayContainer.prototype.OnClose = function () {
|
|
1306
1481
|
this.onClose.emit();
|
|
1307
1482
|
};
|
|
1308
|
-
/**
|
|
1309
|
-
* Handles click in the background window
|
|
1310
|
-
*/
|
|
1311
1483
|
MagicOverlayContainer.prototype.OnBackgroundClick = function () {
|
|
1312
1484
|
var comp = this.componentRef.instance;
|
|
1313
1485
|
if (comp.ShouldCloseOnBackgroundClick())
|
|
@@ -1315,8 +1487,8 @@
|
|
|
1315
1487
|
};
|
|
1316
1488
|
return MagicOverlayContainer;
|
|
1317
1489
|
}(exports.BaseMagicOverlayContainer));
|
|
1318
|
-
|
|
1319
|
-
|
|
1490
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
1491
|
+
MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
|
|
1320
1492
|
if (rf & 1) {
|
|
1321
1493
|
i0.ɵɵviewQuery(_c0$1, true);
|
|
1322
1494
|
i0.ɵɵviewQuery(_c1, true);
|
|
@@ -1352,7 +1524,7 @@
|
|
|
1352
1524
|
i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
|
1353
1525
|
}
|
|
1354
1526
|
}, directives: [i1.NgIf, i1.NgStyle, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{background-color:#fff}.modal-background[_ngcontent-%COMP%], .modal-foreground[_ngcontent-%COMP%]{bottom:0;left:0;position:fixed;right:0;top:0}.modal-background[_ngcontent-%COMP%]{background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"] });
|
|
1355
|
-
|
|
1527
|
+
(function () {
|
|
1356
1528
|
i0.ɵsetClassMetadata(MagicOverlayContainer, [{
|
|
1357
1529
|
type: i0.Component,
|
|
1358
1530
|
args: [{
|
|
@@ -1375,10 +1547,6 @@
|
|
|
1375
1547
|
}] });
|
|
1376
1548
|
})();
|
|
1377
1549
|
|
|
1378
|
-
/**
|
|
1379
|
-
* Service managing overlay windows
|
|
1380
|
-
* This is Magic's default provider
|
|
1381
|
-
*/
|
|
1382
1550
|
var OverlayContainerMagicProvider = /** @class */ (function () {
|
|
1383
1551
|
function OverlayContainerMagicProvider() {
|
|
1384
1552
|
}
|
|
@@ -1387,17 +1555,14 @@
|
|
|
1387
1555
|
};
|
|
1388
1556
|
return OverlayContainerMagicProvider;
|
|
1389
1557
|
}());
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1558
|
+
OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
|
|
1559
|
+
OverlayContainerMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
|
1560
|
+
(function () {
|
|
1393
1561
|
i0.ɵsetClassMetadata(OverlayContainerMagicProvider, [{
|
|
1394
1562
|
type: i0.Injectable
|
|
1395
1563
|
}], null, null);
|
|
1396
1564
|
})();
|
|
1397
1565
|
|
|
1398
|
-
/***
|
|
1399
|
-
* This is sample component for the alert message
|
|
1400
|
-
*/
|
|
1401
1566
|
var MagicAlertComponent = /** @class */ (function (_super) {
|
|
1402
1567
|
__extends(MagicAlertComponent, _super);
|
|
1403
1568
|
function MagicAlertComponent() {
|
|
@@ -1405,8 +1570,8 @@
|
|
|
1405
1570
|
}
|
|
1406
1571
|
return MagicAlertComponent;
|
|
1407
1572
|
}(BaseMagicAlertComponent));
|
|
1408
|
-
|
|
1409
|
-
|
|
1573
|
+
MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
|
|
1574
|
+
MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) {
|
|
1410
1575
|
if (rf & 1) {
|
|
1411
1576
|
i0.ɵɵelementStart(0, "div");
|
|
1412
1577
|
i0.ɵɵelementStart(1, "div", 0);
|
|
@@ -1430,8 +1595,8 @@
|
|
|
1430
1595
|
i0.ɵɵtextInterpolate1("", ctx.message, " ");
|
|
1431
1596
|
}
|
|
1432
1597
|
}, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }"] });
|
|
1433
|
-
var ɵMagicAlertComponent_BaseFactory =
|
|
1434
|
-
|
|
1598
|
+
var ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent);
|
|
1599
|
+
(function () {
|
|
1435
1600
|
i0.ɵsetClassMetadata(MagicAlertComponent, [{
|
|
1436
1601
|
type: i0.Component,
|
|
1437
1602
|
args: [{
|
|
@@ -1442,9 +1607,6 @@
|
|
|
1442
1607
|
}], null, null);
|
|
1443
1608
|
})();
|
|
1444
1609
|
|
|
1445
|
-
/***
|
|
1446
|
-
* This is sample component for the confirmation box
|
|
1447
|
-
*/
|
|
1448
1610
|
var MagicConfirmationBoxComponent = /** @class */ (function (_super) {
|
|
1449
1611
|
__extends(MagicConfirmationBoxComponent, _super);
|
|
1450
1612
|
function MagicConfirmationBoxComponent() {
|
|
@@ -1452,8 +1614,8 @@
|
|
|
1452
1614
|
}
|
|
1453
1615
|
return MagicConfirmationBoxComponent;
|
|
1454
1616
|
}(BaseMagicConfirmComponent));
|
|
1455
|
-
|
|
1456
|
-
|
|
1617
|
+
MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
|
|
1618
|
+
MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) {
|
|
1457
1619
|
if (rf & 1) {
|
|
1458
1620
|
i0.ɵɵelementStart(0, "div");
|
|
1459
1621
|
i0.ɵɵelementStart(1, "div", 0);
|
|
@@ -1481,8 +1643,8 @@
|
|
|
1481
1643
|
i0.ɵɵtextInterpolate1(" ", ctx.message, " ");
|
|
1482
1644
|
}
|
|
1483
1645
|
}, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel[_ngcontent-%COMP%] {\n background-color: #C1C1C1;\n }"] });
|
|
1484
|
-
var ɵMagicConfirmationBoxComponent_BaseFactory =
|
|
1485
|
-
|
|
1646
|
+
var ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
|
|
1647
|
+
(function () {
|
|
1486
1648
|
i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
|
|
1487
1649
|
type: i0.Component,
|
|
1488
1650
|
args: [{
|
|
@@ -1493,51 +1655,28 @@
|
|
|
1493
1655
|
}], null, null);
|
|
1494
1656
|
})();
|
|
1495
1657
|
|
|
1496
|
-
/**
|
|
1497
|
-
* Service managing overlay windows
|
|
1498
|
-
* This is Magic's default provider
|
|
1499
|
-
*/
|
|
1500
|
-
/**
|
|
1501
|
-
* Service managing alert and confirmation windows
|
|
1502
|
-
* This is Magic's default provider
|
|
1503
|
-
*/
|
|
1504
1658
|
var ConfirmationComponentsMagicProvider = /** @class */ (function () {
|
|
1505
1659
|
function ConfirmationComponentsMagicProvider() {
|
|
1506
1660
|
}
|
|
1507
|
-
/**
|
|
1508
|
-
* Return true when use default javascript alert and confirmation or return false to provide custom components
|
|
1509
|
-
* @returns true is we want to use default javascript alert and confirmation
|
|
1510
|
-
*/
|
|
1511
1661
|
ConfirmationComponentsMagicProvider.prototype.showDefaultConfirmations = function () {
|
|
1512
1662
|
return true;
|
|
1513
1663
|
};
|
|
1514
|
-
/**
|
|
1515
|
-
* Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
|
|
1516
|
-
* @returns component that will replace javascript Alert
|
|
1517
|
-
*/
|
|
1518
1664
|
ConfirmationComponentsMagicProvider.prototype.getAlertComponent = function () {
|
|
1519
1665
|
return MagicAlertComponent;
|
|
1520
1666
|
};
|
|
1521
|
-
/**
|
|
1522
|
-
* Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
|
|
1523
|
-
* @returns component that will replace javascript confirmation box
|
|
1524
|
-
*/
|
|
1525
1667
|
ConfirmationComponentsMagicProvider.prototype.getConfirmtionComponent = function () {
|
|
1526
1668
|
return MagicConfirmationBoxComponent;
|
|
1527
1669
|
};
|
|
1528
1670
|
return ConfirmationComponentsMagicProvider;
|
|
1529
1671
|
}());
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1672
|
+
ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
|
|
1673
|
+
ConfirmationComponentsMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
|
1674
|
+
(function () {
|
|
1533
1675
|
i0.ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
|
|
1534
1676
|
type: i0.Injectable
|
|
1535
1677
|
}], null, null);
|
|
1536
1678
|
})();
|
|
1537
1679
|
|
|
1538
|
-
/**
|
|
1539
|
-
* Service managing overlay windows
|
|
1540
|
-
*/
|
|
1541
1680
|
var OverlayWindowService = /** @class */ (function () {
|
|
1542
1681
|
function OverlayWindowService(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
|
|
1543
1682
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
@@ -1553,7 +1692,6 @@
|
|
|
1553
1692
|
};
|
|
1554
1693
|
OverlayWindowService.prototype.open = function (formName, taskId, taskDescription) {
|
|
1555
1694
|
var _this = this;
|
|
1556
|
-
// for overlay which are lazy loaded don't find data in component-list
|
|
1557
1695
|
var comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
|
|
1558
1696
|
var parameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
|
1559
1697
|
var componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), gui.OverlayType.Overlay);
|
|
@@ -1564,28 +1702,19 @@
|
|
|
1564
1702
|
});
|
|
1565
1703
|
};
|
|
1566
1704
|
OverlayWindowService.prototype.close = function (commandStr) {
|
|
1567
|
-
// Close the overlay by removing the overlay window from its container
|
|
1568
1705
|
this.overlayWindowsContainerViewRef.remove();
|
|
1569
1706
|
this.overlayWindowFocusManager.popDialog();
|
|
1570
1707
|
var guiEvent1 = engine.getGuiEventObj("dispose", null, 0);
|
|
1571
1708
|
guiEvent1.TaskID = commandStr;
|
|
1572
1709
|
this.engineMagicService.insertEvent(guiEvent1);
|
|
1573
1710
|
};
|
|
1574
|
-
/**
|
|
1575
|
-
* Open Confirmation box
|
|
1576
|
-
* @param title title of the box
|
|
1577
|
-
* @param msg message
|
|
1578
|
-
* @param style Magic style
|
|
1579
|
-
*/
|
|
1580
1711
|
OverlayWindowService.prototype.openConfirmationBox = function (title, msg, style) {
|
|
1581
1712
|
var _this = this;
|
|
1582
|
-
//show default confirmations
|
|
1583
1713
|
if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
|
|
1584
1714
|
var res = confirmationBox.showConfirmationBox(title, msg, style);
|
|
1585
1715
|
this.finishConfirmation(style, res);
|
|
1586
1716
|
}
|
|
1587
1717
|
else {
|
|
1588
|
-
//show custom confirmations
|
|
1589
1718
|
var comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
|
|
1590
1719
|
var overlayType = confirmationBox.isConfirmBox(style) ? gui.OverlayType.ConfirmationBox : gui.OverlayType.Alert;
|
|
1591
1720
|
var componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
|
|
@@ -1596,21 +1725,11 @@
|
|
|
1596
1725
|
});
|
|
1597
1726
|
}
|
|
1598
1727
|
};
|
|
1599
|
-
/**
|
|
1600
|
-
* This method is called on close of the confirmation
|
|
1601
|
-
* @param style Magic style
|
|
1602
|
-
* @param result
|
|
1603
|
-
*/
|
|
1604
1728
|
OverlayWindowService.prototype.finishConfirmation = function (style, result) {
|
|
1605
1729
|
var guiEvent = engine.getGuiEventObj("confirmationClosed", null, 0);
|
|
1606
1730
|
guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
|
|
1607
1731
|
this.engineMagicService.insertEvent(guiEvent);
|
|
1608
1732
|
};
|
|
1609
|
-
/**
|
|
1610
|
-
* creates a modal component. Can be used for overlay, message box or confirmation box
|
|
1611
|
-
* @param parameters component's parameters
|
|
1612
|
-
* @param component components to create
|
|
1613
|
-
*/
|
|
1614
1733
|
OverlayWindowService.prototype.createModalComponent = function (parameters, component, overlayType) {
|
|
1615
1734
|
var componentRef;
|
|
1616
1735
|
var magicModalContainerParameters = {
|
|
@@ -1618,11 +1737,9 @@
|
|
|
1618
1737
|
Parameters: parameters,
|
|
1619
1738
|
OverlayTypeParam: overlayType
|
|
1620
1739
|
};
|
|
1621
|
-
// Create the UI component of modal window
|
|
1622
1740
|
var factory = this.componentFactoryResolver.resolveComponentFactory(MagicOverlayContainerWrapper);
|
|
1623
1741
|
var viewCRef = this.overlayWindowsContainerViewRef;
|
|
1624
1742
|
componentRef = viewCRef.createComponent(factory);
|
|
1625
|
-
// Set the data to newly created component
|
|
1626
1743
|
Object.assign(componentRef.instance, magicModalContainerParameters);
|
|
1627
1744
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
|
1628
1745
|
componentRef.instance.DetectChanges();
|
|
@@ -1630,9 +1747,9 @@
|
|
|
1630
1747
|
};
|
|
1631
1748
|
return OverlayWindowService;
|
|
1632
1749
|
}());
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1750
|
+
OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(i0.ɵɵinject(i0.ComponentFactoryResolver), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
|
|
1751
|
+
OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
|
|
1752
|
+
(function () {
|
|
1636
1753
|
i0.ɵsetClassMetadata(OverlayWindowService, [{
|
|
1637
1754
|
type: i0.Injectable
|
|
1638
1755
|
}], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null);
|
|
@@ -1765,103 +1882,45 @@
|
|
|
1765
1882
|
return DialogInfo;
|
|
1766
1883
|
}());
|
|
1767
1884
|
|
|
1768
|
-
/**
|
|
1769
|
-
* Main service to connect the UI with the Magic WebCLient
|
|
1770
|
-
*/
|
|
1771
1885
|
var TaskMagicService = /** @class */ (function () {
|
|
1772
|
-
/**
|
|
1773
|
-
*
|
|
1774
|
-
* @param magic
|
|
1775
|
-
*/
|
|
1776
1886
|
function TaskMagicService(magic, overlayWindowService) {
|
|
1777
1887
|
this.magic = magic;
|
|
1778
1888
|
this.overlayWindowService = overlayWindowService;
|
|
1779
|
-
/**
|
|
1780
|
-
* Collection of data for all controls
|
|
1781
|
-
*/
|
|
1782
1889
|
this.Records = new Records();
|
|
1783
|
-
/**
|
|
1784
|
-
* FormGroup collection for line mode
|
|
1785
|
-
*/
|
|
1786
1890
|
this.formGroups = [];
|
|
1787
|
-
/**
|
|
1788
|
-
* @ignore
|
|
1789
|
-
*/
|
|
1790
1891
|
this.refreshDom = new rxjs.Subject();
|
|
1791
|
-
/**
|
|
1792
|
-
* @ignore
|
|
1793
|
-
*/
|
|
1794
1892
|
this.detectChanges = new rxjs.Subject();
|
|
1795
|
-
/**
|
|
1796
|
-
* @ignore
|
|
1797
|
-
*/
|
|
1798
1893
|
this.interactiveCommands = new rxjs.Subject();
|
|
1799
|
-
/**
|
|
1800
|
-
* @ignore
|
|
1801
|
-
* This event is emitted when the selected row in a table changes.
|
|
1802
|
-
*/
|
|
1803
1894
|
this.OnSelectedRowChanged = new i0.EventEmitter();
|
|
1804
|
-
/**
|
|
1805
|
-
* @ignore
|
|
1806
|
-
*/
|
|
1807
1895
|
this.customPropertiesSubject = new rxjs.Subject();
|
|
1808
|
-
/**
|
|
1809
|
-
* @ignore
|
|
1810
|
-
*/
|
|
1811
1896
|
this.recordsCountChangeSubject = new rxjs.Subject();
|
|
1812
|
-
/**
|
|
1813
|
-
* @ignore
|
|
1814
|
-
*/
|
|
1815
1897
|
this.oldPageSize = 0;
|
|
1816
1898
|
this.Records.setGuiTopIndex(0);
|
|
1817
1899
|
this.mgInputDateFormat = null;
|
|
1818
1900
|
}
|
|
1819
|
-
/**
|
|
1820
|
-
* returns true if used is logged in
|
|
1821
|
-
* @returns
|
|
1822
|
-
*/
|
|
1823
1901
|
TaskMagicService.prototype.getIsLoggenIn = function () {
|
|
1824
1902
|
return this.magic.getIsLoggedIn();
|
|
1825
1903
|
};
|
|
1826
1904
|
Object.defineProperty(TaskMagicService.prototype, "taskId", {
|
|
1827
|
-
/**
|
|
1828
|
-
* returns the task Id
|
|
1829
|
-
* @returns
|
|
1830
|
-
*/
|
|
1831
1905
|
get: function () {
|
|
1832
1906
|
return this._taskId;
|
|
1833
1907
|
},
|
|
1834
|
-
/**
|
|
1835
|
-
* Sets the task Id
|
|
1836
|
-
* @param value the task id to set
|
|
1837
|
-
*/
|
|
1838
1908
|
set: function (value) {
|
|
1839
|
-
// debugger;
|
|
1840
1909
|
this._taskId = value;
|
|
1841
1910
|
},
|
|
1842
1911
|
enumerable: false,
|
|
1843
1912
|
configurable: true
|
|
1844
1913
|
});
|
|
1845
1914
|
Object.defineProperty(TaskMagicService.prototype, "ScreenControlsData", {
|
|
1846
|
-
/**
|
|
1847
|
-
* Returns the task's data in Screen mode
|
|
1848
|
-
* @returns
|
|
1849
|
-
*/
|
|
1850
1915
|
get: function () {
|
|
1851
1916
|
return this.Records.list['0'];
|
|
1852
1917
|
},
|
|
1853
1918
|
enumerable: false,
|
|
1854
1919
|
configurable: true
|
|
1855
1920
|
});
|
|
1856
|
-
/**
|
|
1857
|
-
* @ignore
|
|
1858
|
-
*/
|
|
1859
1921
|
TaskMagicService.prototype.settemplate = function (value) {
|
|
1860
1922
|
this.template = value;
|
|
1861
1923
|
};
|
|
1862
|
-
/**
|
|
1863
|
-
* Builds the FormControl for each and every control
|
|
1864
|
-
*/
|
|
1865
1924
|
TaskMagicService.prototype.buildScreenModeControls = function () {
|
|
1866
1925
|
var group = new forms.FormGroup({});
|
|
1867
1926
|
for (var key in this.template) {
|
|
@@ -1873,21 +1932,10 @@
|
|
|
1873
1932
|
}
|
|
1874
1933
|
this.ScreenModeControls = group;
|
|
1875
1934
|
};
|
|
1876
|
-
/**
|
|
1877
|
-
* Is the control a table control
|
|
1878
|
-
* @param id Id of the control
|
|
1879
|
-
* @returns
|
|
1880
|
-
*/
|
|
1881
1935
|
TaskMagicService.prototype.isTableControl = function (id) {
|
|
1882
1936
|
return this.template[id] == '1';
|
|
1883
1937
|
};
|
|
1884
1938
|
TaskMagicService.prototype.getMgInputDateFormat = function () { return this.mgInputDateFormat; };
|
|
1885
|
-
/**
|
|
1886
|
-
* Returns the FormControl of a control
|
|
1887
|
-
* @param guiRowid Id of the requested row
|
|
1888
|
-
* @param id Id of the control
|
|
1889
|
-
* @returns
|
|
1890
|
-
*/
|
|
1891
1939
|
TaskMagicService.prototype.getFormControl = function (guiRowid, id) {
|
|
1892
1940
|
var c;
|
|
1893
1941
|
var group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
|
|
@@ -1897,21 +1945,12 @@
|
|
|
1897
1945
|
}
|
|
1898
1946
|
return c;
|
|
1899
1947
|
};
|
|
1900
|
-
/**
|
|
1901
|
-
* handle the change of text for input control inside table
|
|
1902
|
-
* @param guiRowId Id of the row for which the FormControls are built
|
|
1903
|
-
* set the new value of the formcontrol
|
|
1904
|
-
*/
|
|
1905
1948
|
TaskMagicService.prototype.setInputTextValue = function (controlId, guiRowid, val) {
|
|
1906
1949
|
this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
|
|
1907
1950
|
var fc = this.getFormControl(guiRowid, controlId);
|
|
1908
1951
|
if (!util.isNullOrUndefined(val))
|
|
1909
1952
|
fc.setValue(val);
|
|
1910
1953
|
};
|
|
1911
|
-
/**
|
|
1912
|
-
* Build the FormControls for a table row
|
|
1913
|
-
* @param guiRowId Id of the row for which the FormControls are built
|
|
1914
|
-
*/
|
|
1915
1954
|
TaskMagicService.prototype.buildTableRowControls = function (guiRowId) {
|
|
1916
1955
|
var group = new forms.FormGroup({});
|
|
1917
1956
|
for (var key in this.template) {
|
|
@@ -1923,58 +1962,30 @@
|
|
|
1923
1962
|
}
|
|
1924
1963
|
this.formGroups[guiRowId] = group;
|
|
1925
1964
|
};
|
|
1926
|
-
/**
|
|
1927
|
-
*
|
|
1928
|
-
* @ignore
|
|
1929
|
-
*/
|
|
1930
1965
|
TaskMagicService.prototype.updateRecordsBeforeCurrentView = function (value) {
|
|
1931
1966
|
this.Records.recordsBeforeCurrentView = value;
|
|
1932
1967
|
};
|
|
1933
|
-
/**
|
|
1934
|
-
* @ignore
|
|
1935
|
-
*/
|
|
1936
1968
|
TaskMagicService.prototype.setIncludesFirst = function (value) {
|
|
1937
1969
|
this.Records.includesFirst = value;
|
|
1938
1970
|
};
|
|
1939
|
-
/**
|
|
1940
|
-
* @ignore
|
|
1941
|
-
*/
|
|
1942
1971
|
TaskMagicService.prototype.setIncludesLast = function (value) {
|
|
1943
1972
|
this.Records.includesLast = value;
|
|
1944
1973
|
};
|
|
1945
|
-
/**
|
|
1946
|
-
* @ignore
|
|
1947
|
-
*/
|
|
1948
1974
|
TaskMagicService.prototype.markRowAsCreated = function (guiRowId) {
|
|
1949
1975
|
this.Records.markRowAsCreated(guiRowId);
|
|
1950
1976
|
};
|
|
1951
|
-
/**
|
|
1952
|
-
* @ignore
|
|
1953
|
-
*/
|
|
1954
1977
|
TaskMagicService.prototype.markRowAsNotCreated = function (guiRowId) {
|
|
1955
1978
|
this.Records.markRowAsNotCreated(guiRowId);
|
|
1956
1979
|
};
|
|
1957
|
-
/**
|
|
1958
|
-
* @ignore
|
|
1959
|
-
*/
|
|
1960
1980
|
TaskMagicService.prototype.startRowEditing = function (guiRowId) {
|
|
1961
1981
|
this.Records.startRowEditing(guiRowId);
|
|
1962
1982
|
};
|
|
1963
|
-
/**
|
|
1964
|
-
* @ignore
|
|
1965
|
-
*/
|
|
1966
1983
|
TaskMagicService.prototype.stopRowEditing = function (guiRowId) {
|
|
1967
1984
|
this.Records.stopRowEditing(guiRowId);
|
|
1968
1985
|
};
|
|
1969
|
-
/**
|
|
1970
|
-
* @ignore
|
|
1971
|
-
*/
|
|
1972
1986
|
TaskMagicService.prototype.isRowInRowEditing = function (guiRowId) {
|
|
1973
1987
|
return this.Records.isRowInRowEditing(guiRowId);
|
|
1974
1988
|
};
|
|
1975
|
-
/**
|
|
1976
|
-
* @ignore
|
|
1977
|
-
*/
|
|
1978
1989
|
TaskMagicService.prototype.setIsEmptyDataView = function (isEmpty) {
|
|
1979
1990
|
if (this.Records.isEmptyDataView !== isEmpty) {
|
|
1980
1991
|
if (isEmpty)
|
|
@@ -1984,11 +1995,6 @@
|
|
|
1984
1995
|
this.refreshView();
|
|
1985
1996
|
}
|
|
1986
1997
|
};
|
|
1987
|
-
/**
|
|
1988
|
-
* Initialize the service to work with the task
|
|
1989
|
-
* @param taskId Id of the task
|
|
1990
|
-
* @param taskDescription
|
|
1991
|
-
*/
|
|
1992
1998
|
TaskMagicService.prototype.initTask = function (taskId, taskDescription) {
|
|
1993
1999
|
var _this = this;
|
|
1994
2000
|
this.Records.createFirst();
|
|
@@ -2001,71 +2007,39 @@
|
|
|
2001
2007
|
this.settemplate(taskDescription);
|
|
2002
2008
|
}
|
|
2003
2009
|
this.buildScreenModeControls();
|
|
2004
|
-
// remove previous subscriptions
|
|
2005
2010
|
if (!util.isNullOrUndefined(this.subscribeRefreshDom))
|
|
2006
2011
|
this.subscribeRefreshDom.unsubscribe();
|
|
2007
2012
|
if (!util.isNullOrUndefined(this.subscribeInteractiveCommands))
|
|
2008
2013
|
this.subscribeInteractiveCommands.unsubscribe();
|
|
2009
2014
|
this.subscribeRefreshDom = this.magic.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
|
|
2010
2015
|
.subscribe(function (command) {
|
|
2011
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
2012
2016
|
_this.executeCommand(command);
|
|
2013
2017
|
});
|
|
2014
2018
|
this.subscribeInteractiveCommands = this.magic.interactiveCommands
|
|
2015
2019
|
.pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
|
|
2016
2020
|
.subscribe(function (command) {
|
|
2017
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
2018
2021
|
_this.executeInteractiveCommand(command);
|
|
2019
2022
|
});
|
|
2020
2023
|
};
|
|
2021
|
-
/**
|
|
2022
|
-
* @ignore
|
|
2023
|
-
*/
|
|
2024
2024
|
TaskMagicService.prototype.refreshView = function () {
|
|
2025
2025
|
this.detectChanges.next('');
|
|
2026
2026
|
};
|
|
2027
|
-
/**
|
|
2028
|
-
* Insert an event to the Magic WebClient event queue
|
|
2029
|
-
* @param guiEvent The event to insert
|
|
2030
|
-
*/
|
|
2031
2027
|
TaskMagicService.prototype.insertEvent = function (guiEvent) {
|
|
2032
2028
|
guiEvent.TaskID = this.taskId;
|
|
2033
2029
|
this.magic.insertEvent(guiEvent);
|
|
2034
2030
|
};
|
|
2035
|
-
/**
|
|
2036
|
-
* @ignore
|
|
2037
|
-
*/
|
|
2038
2031
|
TaskMagicService.prototype.GetControlPictureMask = function (controlName) {
|
|
2039
2032
|
return this.magic.GetControlPictureMask(this.taskId, controlName);
|
|
2040
2033
|
};
|
|
2041
|
-
/**
|
|
2042
|
-
* Validates the control value, using the Magic WebClient
|
|
2043
|
-
* @param controlName Id of validated control
|
|
2044
|
-
* @param value value to be validated
|
|
2045
|
-
* @returns If validation fails, returns error message, else returns null
|
|
2046
|
-
*/
|
|
2047
2034
|
TaskMagicService.prototype.ValidateControlValue = function (controlName, value) {
|
|
2048
2035
|
return this.magic.ValidateControlValue(this.taskId, controlName, value);
|
|
2049
2036
|
};
|
|
2050
|
-
/**
|
|
2051
|
-
* @ignore
|
|
2052
|
-
*/
|
|
2053
2037
|
TaskMagicService.prototype.GetRangedValue = function (controlName, value) {
|
|
2054
2038
|
return this.magic.GetRangedValue(this.taskId, controlName, value);
|
|
2055
2039
|
};
|
|
2056
|
-
/**
|
|
2057
|
-
* @ignore
|
|
2058
|
-
*/
|
|
2059
2040
|
TaskMagicService.prototype.GetFldRanges = function (controlName) {
|
|
2060
2041
|
return this.magic.GetFldRanges(this.taskId, controlName);
|
|
2061
2042
|
};
|
|
2062
|
-
/**
|
|
2063
|
-
* returns the value of a property of the control
|
|
2064
|
-
* @param controlId Id of control
|
|
2065
|
-
* @param prop Property
|
|
2066
|
-
* @param guiRowId Row Id, if applicable
|
|
2067
|
-
* @returns Property value
|
|
2068
|
-
*/
|
|
2069
2043
|
TaskMagicService.prototype.getProperty = function (controlId, prop, guiRowId) {
|
|
2070
2044
|
if (util.isNullOrUndefined(guiRowId))
|
|
2071
2045
|
guiRowId = '0';
|
|
@@ -2079,9 +2053,6 @@
|
|
|
2079
2053
|
return this.Records.list[guiRowId].getProperty(controlId, prop);
|
|
2080
2054
|
}
|
|
2081
2055
|
};
|
|
2082
|
-
/**
|
|
2083
|
-
* @ignore
|
|
2084
|
-
*/
|
|
2085
2056
|
TaskMagicService.prototype.getPropertyStub = function (ControlsProperties, controlId, prop) {
|
|
2086
2057
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
2087
2058
|
if (controlId in ControlsProperties) {
|
|
@@ -2091,31 +2062,15 @@
|
|
|
2091
2062
|
}
|
|
2092
2063
|
return '';
|
|
2093
2064
|
};
|
|
2094
|
-
/**
|
|
2095
|
-
* @ignore
|
|
2096
|
-
*/
|
|
2097
2065
|
TaskMagicService.prototype.getStyleStub = function (ControlsProperties, controlId, styleName) {
|
|
2098
2066
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
2099
2067
|
return ControlsProperties[controlId].stylesMap.get(styleName);
|
|
2100
2068
|
};
|
|
2101
|
-
/**
|
|
2102
|
-
* Return the CSS classes used for this control
|
|
2103
|
-
* @param controlId Id of control
|
|
2104
|
-
* @param guiRowId Row Id, if applicable
|
|
2105
|
-
* @returns String containing the classes currently defined for this control
|
|
2106
|
-
*/
|
|
2107
2069
|
TaskMagicService.prototype.getClasses = function (controlId, guiRowId) {
|
|
2108
2070
|
if (util.isNullOrUndefined(guiRowId))
|
|
2109
2071
|
guiRowId = '0';
|
|
2110
2072
|
return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
|
|
2111
2073
|
};
|
|
2112
|
-
/**
|
|
2113
|
-
* Return the value of a style used for a control
|
|
2114
|
-
* @param controlId Id of control
|
|
2115
|
-
* @param styleName Name of style
|
|
2116
|
-
* @param guiRowId Row Id, if applicable
|
|
2117
|
-
* @returns value of style of the control
|
|
2118
|
-
*/
|
|
2119
2074
|
TaskMagicService.prototype.getStyle = function (controlId, styleName, guiRowId) {
|
|
2120
2075
|
if (util.isNullOrUndefined(guiRowId))
|
|
2121
2076
|
guiRowId = '0';
|
|
@@ -2126,36 +2081,21 @@
|
|
|
2126
2081
|
return StylesMapManager.magicValueGetStyle(styleName, magicValue);
|
|
2127
2082
|
}
|
|
2128
2083
|
};
|
|
2129
|
-
/**
|
|
2130
|
-
* Return the value of a control
|
|
2131
|
-
* @param controlId Id of control
|
|
2132
|
-
* @param guiRowId Row Id, if applicable
|
|
2133
|
-
* @returns value of the control
|
|
2134
|
-
*/
|
|
2135
2084
|
TaskMagicService.prototype.getValue = function (controlId, guiRowId) {
|
|
2136
2085
|
if (util.isNullOrUndefined(guiRowId))
|
|
2137
2086
|
guiRowId = '0';
|
|
2138
2087
|
return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
|
|
2139
2088
|
};
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
* @param guiRowId Row Id, if applicable
|
|
2144
|
-
* @param value Value to set
|
|
2145
|
-
*/
|
|
2089
|
+
TaskMagicService.prototype.getFormattedValue = function (controlName, val) {
|
|
2090
|
+
return this.magic.GetFormattedValue(this.taskId, controlName, val);
|
|
2091
|
+
};
|
|
2146
2092
|
TaskMagicService.prototype.setValue = function (controlId, guiRowId, value) {
|
|
2147
2093
|
return this.Records.list[guiRowId].setValue(controlId, value);
|
|
2148
2094
|
};
|
|
2149
|
-
/**
|
|
2150
|
-
* @ignore
|
|
2151
|
-
*/
|
|
2152
2095
|
TaskMagicService.prototype.executeInteractiveCommand = function (guiInteractiveCommand) {
|
|
2153
2096
|
GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
|
|
2154
2097
|
this.interactiveCommands.next(guiInteractiveCommand);
|
|
2155
2098
|
};
|
|
2156
|
-
/**
|
|
2157
|
-
* @ignore
|
|
2158
|
-
*/
|
|
2159
2099
|
TaskMagicService.prototype.handleSetProperty = function (command, isTableChild) {
|
|
2160
2100
|
var controlId = command.CtrlName;
|
|
2161
2101
|
var dvRowId = (command.line || 0);
|
|
@@ -2192,7 +2132,6 @@
|
|
|
2192
2132
|
var controlId = command.CtrlName;
|
|
2193
2133
|
var properties;
|
|
2194
2134
|
var isTableChild = this.isTableControl(controlId);
|
|
2195
|
-
// For non-input type controls on table.
|
|
2196
2135
|
if (command.obj !== null)
|
|
2197
2136
|
isTableChild = isTableChild || command.obj.IsTableChild;
|
|
2198
2137
|
guiRowId = this.getGuiRowId(dvRowId, isTableChild);
|
|
@@ -2243,13 +2182,13 @@
|
|
|
2243
2182
|
break;
|
|
2244
2183
|
case gui.CommandType.SET_PROPERTY:
|
|
2245
2184
|
this.handleSetProperty(command, isTableChild);
|
|
2185
|
+
if (command.Operation == gui.HtmlProperties.ReadOnly)
|
|
2186
|
+
this.refreshDom.next(command);
|
|
2246
2187
|
break;
|
|
2247
2188
|
case gui.CommandType.PROP_SET_USER_PROPERTY:
|
|
2248
2189
|
properties = this.Records.list[guiRowId].getControlMetadata(controlId);
|
|
2249
|
-
// if the property has changed, set the property and raise the subject
|
|
2250
2190
|
if (properties.userProperties.get(command.Operation) !== command.obj1) {
|
|
2251
2191
|
properties.userProperties.set(command.Operation, command.obj1);
|
|
2252
|
-
// the property name is of format <controlName>~<propertyName>
|
|
2253
2192
|
this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
|
|
2254
2193
|
}
|
|
2255
2194
|
break;
|
|
@@ -2275,7 +2214,7 @@
|
|
|
2275
2214
|
properties.setStyle(command.Operation, command.obj1);
|
|
2276
2215
|
break;
|
|
2277
2216
|
case gui.CommandType.SET_ATTRIBUTE:
|
|
2278
|
-
properties = this.Records.list[
|
|
2217
|
+
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
2279
2218
|
properties.dataType = String.fromCharCode(command.number);
|
|
2280
2219
|
break;
|
|
2281
2220
|
case gui.CommandType.SET_VALUE:
|
|
@@ -2294,12 +2233,11 @@
|
|
|
2294
2233
|
case gui.CommandType.SET_EMPTY_DATAVIEW:
|
|
2295
2234
|
this.setIsEmptyDataView(command.Bool1);
|
|
2296
2235
|
break;
|
|
2236
|
+
case gui.CommandType.SET_FOCUS:
|
|
2237
|
+
this.refreshDom.next(command);
|
|
2238
|
+
break;
|
|
2297
2239
|
}
|
|
2298
|
-
this.refreshDom.next(command);
|
|
2299
2240
|
};
|
|
2300
|
-
/**
|
|
2301
|
-
custom validator
|
|
2302
|
-
*/
|
|
2303
2241
|
TaskMagicService.prototype.customValidator = function (rowid, id) {
|
|
2304
2242
|
var _this = this;
|
|
2305
2243
|
return function (control) {
|
|
@@ -2325,13 +2263,6 @@
|
|
|
2325
2263
|
return null;
|
|
2326
2264
|
};
|
|
2327
2265
|
};
|
|
2328
|
-
/**
|
|
2329
|
-
* COnvert a value from Magic format to native format
|
|
2330
|
-
* @param controlId Id of control
|
|
2331
|
-
* @param rowId Row Id, if applicable
|
|
2332
|
-
* @param val Value to convert
|
|
2333
|
-
* @returns Converted value
|
|
2334
|
-
*/
|
|
2335
2266
|
TaskMagicService.prototype.ConvertValToNative = function (controlId, rowId, val) {
|
|
2336
2267
|
var properties;
|
|
2337
2268
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2380,13 +2311,6 @@
|
|
|
2380
2311
|
return val;
|
|
2381
2312
|
}
|
|
2382
2313
|
};
|
|
2383
|
-
/**
|
|
2384
|
-
* Convert a value from native to Magic format
|
|
2385
|
-
* @param controlId Id of control
|
|
2386
|
-
* @param rowId Row Id, if applicable
|
|
2387
|
-
* @param val Value to convert
|
|
2388
|
-
* @returns Converted value
|
|
2389
|
-
*/
|
|
2390
2314
|
TaskMagicService.prototype.ConvertValFromNative = function (controlId, rowId, val) {
|
|
2391
2315
|
var properties;
|
|
2392
2316
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2429,22 +2353,12 @@
|
|
|
2429
2353
|
return val;
|
|
2430
2354
|
}
|
|
2431
2355
|
};
|
|
2432
|
-
/**
|
|
2433
|
-
* Handle resize and also fetch chunk of records if having an empty view.
|
|
2434
|
-
* @ignore
|
|
2435
|
-
* @param pageSize : PageSize
|
|
2436
|
-
* @param topGuiRowId : GuiRowId of first record in view.
|
|
2437
|
-
*/
|
|
2438
2356
|
TaskMagicService.prototype.resize = function (pageSize, topGuiRowId) {
|
|
2439
2357
|
var guiEvent = engine.getGuiEventObj('resize', 'table', 0);
|
|
2440
2358
|
guiEvent.PageSize = pageSize;
|
|
2441
|
-
//As 'getRows' event also gets executed, set the guiEvent.Line parameter.
|
|
2442
2359
|
guiEvent.Line = topGuiRowId;
|
|
2443
2360
|
this.insertEvent(guiEvent);
|
|
2444
2361
|
};
|
|
2445
|
-
/**
|
|
2446
|
-
* Fetches data for new table rows when scrolling done
|
|
2447
|
-
*/
|
|
2448
2362
|
TaskMagicService.prototype.onScrollDown = function () {
|
|
2449
2363
|
if (!this.Records.includesLast) {
|
|
2450
2364
|
var guiEvent = engine.getGuiEventObj('getRows', 'table', 0);
|
|
@@ -2452,29 +2366,15 @@
|
|
|
2452
2366
|
this.insertEvent(guiEvent);
|
|
2453
2367
|
}
|
|
2454
2368
|
};
|
|
2455
|
-
/**
|
|
2456
|
-
* Sets the new browser window title
|
|
2457
|
-
* @param newTitle New window title
|
|
2458
|
-
*/
|
|
2459
2369
|
TaskMagicService.prototype.setTitle = function (newTitle) {
|
|
2460
2370
|
this.mgTitleService.setTitle(newTitle);
|
|
2461
2371
|
};
|
|
2462
|
-
/**
|
|
2463
|
-
* @ignore
|
|
2464
|
-
*/
|
|
2465
2372
|
TaskMagicService.prototype.getGuiRowId = function (dvRowId, isTableControl) {
|
|
2466
2373
|
return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
|
|
2467
2374
|
};
|
|
2468
|
-
/**
|
|
2469
|
-
*
|
|
2470
|
-
* @ignore
|
|
2471
|
-
*/
|
|
2472
2375
|
TaskMagicService.prototype.getDvRowId = function (guiRowId) {
|
|
2473
2376
|
return (guiRowId - this.Records.recordsBeforeCurrentView);
|
|
2474
2377
|
};
|
|
2475
|
-
/**
|
|
2476
|
-
* Clean up the service when it is no longer needed
|
|
2477
|
-
*/
|
|
2478
2378
|
TaskMagicService.prototype.dispose = function () {
|
|
2479
2379
|
this.refreshDom.complete();
|
|
2480
2380
|
this.detectChanges.complete();
|
|
@@ -2484,14 +2384,6 @@
|
|
|
2484
2384
|
this.customPropertiesSubject.complete();
|
|
2485
2385
|
this.OnSelectedRowChanged.complete();
|
|
2486
2386
|
};
|
|
2487
|
-
///////////////////////////////
|
|
2488
|
-
//Events:
|
|
2489
|
-
/**
|
|
2490
|
-
* Handle the Combobox "change" event
|
|
2491
|
-
* @param event The event received from the UI
|
|
2492
|
-
* @param idx Id of the control raising the event
|
|
2493
|
-
* @param line Row Id, if applicable
|
|
2494
|
-
*/
|
|
2495
2387
|
TaskMagicService.prototype.onComboboxSelectionChanged = function (event, idx, line) {
|
|
2496
2388
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, line);
|
|
2497
2389
|
if (typeof (event) == 'number') {
|
|
@@ -2510,11 +2402,6 @@
|
|
|
2510
2402
|
}
|
|
2511
2403
|
this.insertEvent(guiEvent);
|
|
2512
2404
|
};
|
|
2513
|
-
/**
|
|
2514
|
-
* Handle the Listbox "change" event
|
|
2515
|
-
* @param event The event received from the UI
|
|
2516
|
-
* @param idx Id of the control raising the event
|
|
2517
|
-
*/
|
|
2518
2405
|
TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
|
|
2519
2406
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2520
2407
|
var selectedOptions;
|
|
@@ -2530,456 +2417,113 @@
|
|
|
2530
2417
|
else
|
|
2531
2418
|
indexes[i] = (selectedOptions[i]).value;
|
|
2532
2419
|
}
|
|
2533
|
-
guiEvent.Value = indexes;
|
|
2534
|
-
this.insertEvent(guiEvent);
|
|
2535
|
-
};
|
|
2536
|
-
/**
|
|
2537
|
-
* Handle the Checkbox "change" event
|
|
2538
|
-
* @param event The event received from the UI
|
|
2539
|
-
* @param idx Id of the control raising the event
|
|
2540
|
-
* @param rowId Row Id, if applicable
|
|
2541
|
-
*/
|
|
2542
|
-
TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
|
|
2543
|
-
if (typeof rowId === 'undefined')
|
|
2544
|
-
rowId = 0;
|
|
2545
|
-
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, rowId);
|
|
2546
|
-
if (typeof (event) == 'boolean') {
|
|
2547
|
-
guiEvent.Value = event;
|
|
2548
|
-
}
|
|
2549
|
-
else {
|
|
2550
|
-
if (typeof event.target === 'undefined')
|
|
2551
|
-
guiEvent.Value = (event).checked;
|
|
2552
|
-
else
|
|
2553
|
-
guiEvent.Value = (event.target).checked;
|
|
2554
|
-
}
|
|
2555
|
-
this.insertEvent(guiEvent);
|
|
2556
|
-
};
|
|
2557
|
-
/**
|
|
2558
|
-
* Handle tab selection change, caused by UI events
|
|
2559
|
-
* @param idx Id of the control raising the event
|
|
2560
|
-
* @param layer Id of selected tabpage
|
|
2561
|
-
*/
|
|
2562
|
-
TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
|
|
2563
|
-
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2564
|
-
guiEvent.Value = layer.toString();
|
|
2565
|
-
this.insertEvent(guiEvent);
|
|
2566
|
-
};
|
|
2567
|
-
/**
|
|
2568
|
-
* Handle the Radio button "change" event
|
|
2569
|
-
* @param event The event received from the UI
|
|
2570
|
-
* @param idx Id of the control raising the event
|
|
2571
|
-
*/
|
|
2572
|
-
TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
|
|
2573
|
-
var result = this.getFormControl('0', idx);
|
|
2574
|
-
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2575
|
-
if (typeof result.value !== 'string')
|
|
2576
|
-
guiEvent.Value = result.value.index;
|
|
2577
|
-
else
|
|
2578
|
-
guiEvent.Value = result.value;
|
|
2420
|
+
guiEvent.Value = indexes;
|
|
2579
2421
|
this.insertEvent(guiEvent);
|
|
2580
2422
|
};
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
///////////////////////////////
|
|
2588
|
-
/**
|
|
2589
|
-
* @ignore
|
|
2590
|
-
*/
|
|
2591
|
-
TaskMagicService.prototype.IsStub = function () {
|
|
2592
|
-
return this.magic.isStub;
|
|
2593
|
-
};
|
|
2594
|
-
/**
|
|
2595
|
-
* @ignore
|
|
2596
|
-
*/
|
|
2597
|
-
TaskMagicService.prototype.saveData = function (data) {
|
|
2598
|
-
this.magic.saveData(data);
|
|
2599
|
-
};
|
|
2600
|
-
/**
|
|
2601
|
-
* @ignore
|
|
2602
|
-
*/
|
|
2603
|
-
TaskMagicService.prototype.createData = function () {
|
|
2604
|
-
var myData = {
|
|
2605
|
-
records: this.Records,
|
|
2606
|
-
template: this.template
|
|
2607
|
-
};
|
|
2608
|
-
var text = 'loadData():any {\n' +
|
|
2609
|
-
' let stubData = ' + JSON.stringify(myData) + ';\n' +
|
|
2610
|
-
' this.loadStubData(stubData);}';
|
|
2611
|
-
console.log(text);
|
|
2612
|
-
this.saveData(text);
|
|
2613
|
-
};
|
|
2614
|
-
/**
|
|
2615
|
-
* @ignore
|
|
2616
|
-
*/
|
|
2617
|
-
TaskMagicService.prototype.loadStubData = function (stubData) {
|
|
2618
|
-
this.Records = stubData.records;
|
|
2619
|
-
this.settemplate(stubData.template);
|
|
2620
|
-
this.taskId = '1';
|
|
2621
|
-
for (var i = 0; i < this.Records.list.length; i++)
|
|
2622
|
-
this.buildTableRowControls(i);
|
|
2623
|
-
};
|
|
2624
|
-
/**
|
|
2625
|
-
* @ignore
|
|
2626
|
-
*/
|
|
2627
|
-
TaskMagicService.prototype.loadData = function () {
|
|
2628
|
-
alert('Please, overwrite method loadData');
|
|
2629
|
-
};
|
|
2630
|
-
/**
|
|
2631
|
-
* @ignore
|
|
2632
|
-
*/
|
|
2633
|
-
TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
|
|
2634
|
-
if (this.IsStub()) {
|
|
2635
|
-
try {
|
|
2636
|
-
var val = this.Records.list[guiRowId].values[name];
|
|
2637
|
-
fc.setValue(val);
|
|
2638
|
-
}
|
|
2639
|
-
catch (e) {
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
};
|
|
2643
|
-
return TaskMagicService;
|
|
2644
|
-
}());
|
|
2645
|
-
/** @nocollapse */ TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
|
2646
|
-
/** @nocollapse */ TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
2647
|
-
/*@__PURE__*/ (function () {
|
|
2648
|
-
i0.ɵsetClassMetadata(TaskMagicService, [{
|
|
2649
|
-
type: i0.Injectable
|
|
2650
|
-
}], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
|
|
2651
|
-
})();
|
|
2652
|
-
|
|
2653
|
-
/**
|
|
2654
|
-
* @ignore
|
|
2655
|
-
*/
|
|
2656
|
-
var CommandsCollectorMagicService = /** @class */ (function () {
|
|
2657
|
-
function CommandsCollectorMagicService(magic) {
|
|
2658
|
-
this.magic = magic;
|
|
2659
|
-
this.count = 0;
|
|
2660
|
-
this.commands = new mscorelib.List();
|
|
2661
|
-
this.subscription = null;
|
|
2662
|
-
}
|
|
2663
|
-
CommandsCollectorMagicService.prototype.startCollecting = function () {
|
|
2664
|
-
var _this = this;
|
|
2665
|
-
this.count++;
|
|
2666
|
-
utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- " + this.count);
|
|
2667
|
-
if (this.subscription === null) {
|
|
2668
|
-
this.subscription = this.magic.refreshDom
|
|
2669
|
-
.subscribe(function (command) {
|
|
2670
|
-
_this.commands.push(command);
|
|
2671
|
-
});
|
|
2672
|
-
}
|
|
2673
|
-
};
|
|
2674
|
-
CommandsCollectorMagicService.prototype.stopCollecting = function () {
|
|
2675
|
-
this.count--;
|
|
2676
|
-
utils$1.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- " + this.count);
|
|
2677
|
-
if (this.count === 0) {
|
|
2678
|
-
this.subscription.unsubscribe();
|
|
2679
|
-
this.subscription = null;
|
|
2680
|
-
}
|
|
2681
|
-
};
|
|
2682
|
-
CommandsCollectorMagicService.prototype.GetCommands = function (taskId) {
|
|
2683
|
-
var _this = this;
|
|
2684
|
-
var commands = this.commands.filter(function (command) { return command.TaskTag === taskId; });
|
|
2685
|
-
commands.forEach(function (command) { _this.commands.Remove(command); });
|
|
2686
|
-
return commands;
|
|
2687
|
-
};
|
|
2688
|
-
return CommandsCollectorMagicService;
|
|
2689
|
-
}());
|
|
2690
|
-
/** @nocollapse */ CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
|
|
2691
|
-
/** @nocollapse */ CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
|
|
2692
|
-
/*@__PURE__*/ (function () {
|
|
2693
|
-
i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
|
2694
|
-
type: i0.Injectable
|
|
2695
|
-
}], function () { return [{ type: EngineMagicService }]; }, null);
|
|
2696
|
-
})();
|
|
2697
|
-
|
|
2698
|
-
/**
|
|
2699
|
-
* @ignore
|
|
2700
|
-
*/
|
|
2701
|
-
var RouteCommand = /** @class */ (function () {
|
|
2702
|
-
function RouteCommand() {
|
|
2703
|
-
}
|
|
2704
|
-
return RouteCommand;
|
|
2705
|
-
}());
|
|
2706
|
-
/**
|
|
2707
|
-
* @ignore
|
|
2708
|
-
*/
|
|
2709
|
-
var RouterCommandsMagicService = /** @class */ (function () {
|
|
2710
|
-
function RouterCommandsMagicService() {
|
|
2711
|
-
this.pendingRouteCommands = [];
|
|
2712
|
-
}
|
|
2713
|
-
RouterCommandsMagicService.prototype.AddRouteCommand = function (routeCommand) {
|
|
2714
|
-
this.pendingRouteCommands.push(routeCommand);
|
|
2715
|
-
};
|
|
2716
|
-
RouterCommandsMagicService.prototype.ExecuteNextCommand = function () {
|
|
2717
|
-
var pendingRouteCommand = this.pendingRouteCommands.shift();
|
|
2718
|
-
if (!util.isNullOrUndefined(pendingRouteCommand)) {
|
|
2719
|
-
pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
|
|
2720
|
-
}
|
|
2721
|
-
};
|
|
2722
|
-
return RouterCommandsMagicService;
|
|
2723
|
-
}());
|
|
2724
|
-
/** @nocollapse */ RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
|
|
2725
|
-
/** @nocollapse */ RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
|
|
2726
|
-
/*@__PURE__*/ (function () {
|
|
2727
|
-
i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
|
|
2728
|
-
type: i0.Injectable
|
|
2729
|
-
}], null, null);
|
|
2730
|
-
})();
|
|
2731
|
-
|
|
2732
|
-
/**
|
|
2733
|
-
* Service for managing subforms and routing
|
|
2734
|
-
*/
|
|
2735
|
-
var SubformMagicService = /** @class */ (function () {
|
|
2736
|
-
function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
|
|
2737
|
-
this.task = task;
|
|
2738
|
-
this.activatedRoute = activatedRoute;
|
|
2739
|
-
this.componentList = componentList;
|
|
2740
|
-
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
2741
|
-
this.router = router;
|
|
2742
|
-
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
2743
|
-
this.subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
|
|
2744
|
-
this.routesDict = {}; // dictionary of router outlet to router path
|
|
2745
|
-
this.currentRouteDefinition = null;
|
|
2746
|
-
}
|
|
2747
|
-
/**
|
|
2748
|
-
* Finds and returns the component according to the subform name
|
|
2749
|
-
* @param subformName
|
|
2750
|
-
* @returns
|
|
2751
|
-
*/
|
|
2752
|
-
SubformMagicService.prototype.mgGetComp = function (subformName) {
|
|
2753
|
-
if (subformName in this.subformsDict) {
|
|
2754
|
-
var formName = this.subformsDict[subformName].formName;
|
|
2755
|
-
if (formName)
|
|
2756
|
-
return this.componentList.getComponent(formName);
|
|
2757
|
-
}
|
|
2758
|
-
return null;
|
|
2759
|
-
};
|
|
2760
|
-
/**
|
|
2761
|
-
* Returns the parameters of the subform
|
|
2762
|
-
* @param subformName
|
|
2763
|
-
* @returns
|
|
2764
|
-
*/
|
|
2765
|
-
SubformMagicService.prototype.mgGetParameters = function (subformName) {
|
|
2766
|
-
if (subformName in this.subformsDict) {
|
|
2767
|
-
return this.subformsDict[subformName].parameters;
|
|
2768
|
-
}
|
|
2769
|
-
else
|
|
2770
|
-
return "";
|
|
2771
|
-
};
|
|
2772
|
-
/**
|
|
2773
|
-
* @ignore
|
|
2774
|
-
*/
|
|
2775
|
-
SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
|
|
2776
|
-
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2777
|
-
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2778
|
-
this.subformsDict[subformControlName] = {};
|
|
2779
|
-
this.task.refreshView();
|
|
2780
|
-
}
|
|
2781
|
-
}
|
|
2782
|
-
};
|
|
2783
|
-
/**
|
|
2784
|
-
* @ignore
|
|
2785
|
-
*/
|
|
2786
|
-
SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
|
2787
|
-
this.pendingCommandsCollector.startCollecting();
|
|
2788
|
-
var refreshNeeded = false;
|
|
2789
|
-
if (util.isNullOrUndefined(routerPath)) { // call in destination subform
|
|
2790
|
-
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2791
|
-
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2792
|
-
this.subformsDict[subformControlName] = {};
|
|
2793
|
-
this.task.refreshView();
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
this.subformsDict[subformControlName] = {
|
|
2797
|
-
formName: formName,
|
|
2798
|
-
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2799
|
-
};
|
|
2800
|
-
//this.ref.detectChanges();
|
|
2801
|
-
refreshNeeded = true;
|
|
2802
|
-
}
|
|
2803
|
-
else { // call route
|
|
2804
|
-
if (inDefaultOutlet)
|
|
2805
|
-
subformControlName = "primary";
|
|
2806
|
-
var routeParams = new mscorelib.List();
|
|
2807
|
-
routeParams.push(routerPath);
|
|
2808
|
-
if (params !== null) {
|
|
2809
|
-
routeParams = routeParams.concat(params);
|
|
2810
|
-
}
|
|
2811
|
-
var routeCommand = {
|
|
2812
|
-
callerMgSubformServiceRef: this,
|
|
2813
|
-
routerOutletName: subformControlName,
|
|
2814
|
-
formName: formName,
|
|
2815
|
-
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
|
2816
|
-
routeParams: routeParams
|
|
2817
|
-
};
|
|
2818
|
-
// If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
|
|
2819
|
-
// called once, but angular has not yet executed it (ngOnInit of the new component is not called).
|
|
2820
|
-
// In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
|
|
2821
|
-
// So, put a command in the queue which will be executed after the first one is executed.
|
|
2822
|
-
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
2823
|
-
this.ExecuteRouteCommand(routeCommand);
|
|
2824
|
-
else
|
|
2825
|
-
this.routerCommandsMagicService.AddRouteCommand(routeCommand);
|
|
2826
|
-
}
|
|
2827
|
-
if (refreshNeeded)
|
|
2828
|
-
this.task.refreshView();
|
|
2829
|
-
};
|
|
2830
|
-
/**
|
|
2831
|
-
* Open the subform using a route command
|
|
2832
|
-
*/
|
|
2833
|
-
SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
|
|
2834
|
-
var _a;
|
|
2835
|
-
var reusingComponent = false;
|
|
2836
|
-
var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
|
2837
|
-
var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
|
2838
|
-
if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
|
|
2839
|
-
// If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
|
|
2840
|
-
// So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
|
|
2841
|
-
currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
|
|
2842
|
-
.then(function (result) {
|
|
2843
|
-
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
2844
|
-
currentSubformMagicService.currentRouteDefinition = {
|
|
2845
|
-
formName: routeCommand.formName,
|
|
2846
|
-
parameters: routeCommand.parameters
|
|
2847
|
-
};
|
|
2848
|
-
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
2849
|
-
});
|
|
2423
|
+
TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
|
|
2424
|
+
if (typeof rowId === 'undefined')
|
|
2425
|
+
rowId = 0;
|
|
2426
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, rowId);
|
|
2427
|
+
if (typeof (event) == 'boolean') {
|
|
2428
|
+
guiEvent.Value = event;
|
|
2850
2429
|
}
|
|
2851
2430
|
else {
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
};
|
|
2857
|
-
if (SubformMagicService.routerContainers.length > 0) {
|
|
2858
|
-
var routeContainer = SubformMagicService.routerContainers[0];
|
|
2859
|
-
SubformMagicService.routerContainers.shift();
|
|
2860
|
-
routeContainer.initializeComponent();
|
|
2861
|
-
}
|
|
2862
|
-
else {
|
|
2863
|
-
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
|
2864
|
-
}
|
|
2431
|
+
if (typeof event.target === 'undefined')
|
|
2432
|
+
guiEvent.Value = (event).checked;
|
|
2433
|
+
else
|
|
2434
|
+
guiEvent.Value = (event.target).checked;
|
|
2865
2435
|
}
|
|
2436
|
+
this.insertEvent(guiEvent);
|
|
2866
2437
|
};
|
|
2867
|
-
|
|
2868
|
-
var
|
|
2869
|
-
|
|
2870
|
-
this.
|
|
2871
|
-
.then(function (result) {
|
|
2872
|
-
if (result !== null && !result) {
|
|
2873
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
2874
|
-
subformMagicService.currentRouteDefinition = null;
|
|
2875
|
-
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
2876
|
-
subformMagicService.pendingCommandsCollector.stopCollecting();
|
|
2877
|
-
subformMagicService.routerCommandsMagicService.ExecuteNextCommand();
|
|
2878
|
-
}
|
|
2879
|
-
});
|
|
2438
|
+
TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
|
|
2439
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2440
|
+
guiEvent.Value = layer.toString();
|
|
2441
|
+
this.insertEvent(guiEvent);
|
|
2880
2442
|
};
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
if (pendingCommands.length > 0) {
|
|
2890
|
-
pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
|
|
2891
|
-
this.task.refreshView();
|
|
2892
|
-
}
|
|
2893
|
-
this.pendingCommandsCollector.stopCollecting();
|
|
2443
|
+
TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
|
|
2444
|
+
var result = this.getFormControl('0', idx);
|
|
2445
|
+
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2446
|
+
if (typeof result.value !== 'string')
|
|
2447
|
+
guiEvent.Value = result.value.index;
|
|
2448
|
+
else
|
|
2449
|
+
guiEvent.Value = result.value;
|
|
2450
|
+
this.insertEvent(guiEvent);
|
|
2894
2451
|
};
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
*/
|
|
2898
|
-
SubformMagicService.prototype.refreshView = function () {
|
|
2899
|
-
this.task.refreshView();
|
|
2452
|
+
TaskMagicService.prototype.close = function () {
|
|
2453
|
+
this.insertEvent(engine.getGuiEventObj('close', null, 0));
|
|
2900
2454
|
};
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2455
|
+
TaskMagicService.prototype.IsStub = function () {
|
|
2456
|
+
return this.magic.isStub;
|
|
2457
|
+
};
|
|
2458
|
+
TaskMagicService.prototype.saveData = function (data) {
|
|
2459
|
+
this.magic.saveData(data);
|
|
2460
|
+
};
|
|
2461
|
+
TaskMagicService.prototype.createData = function () {
|
|
2462
|
+
var myData = {
|
|
2463
|
+
records: this.Records,
|
|
2464
|
+
template: this.template
|
|
2465
|
+
};
|
|
2466
|
+
var text = 'loadData():any {\n' +
|
|
2467
|
+
' let stubData = ' + JSON.stringify(myData) + ';\n' +
|
|
2468
|
+
' this.loadStubData(stubData);}';
|
|
2469
|
+
console.log(text);
|
|
2470
|
+
this.saveData(text);
|
|
2471
|
+
};
|
|
2472
|
+
TaskMagicService.prototype.loadStubData = function (stubData) {
|
|
2473
|
+
this.Records = stubData.records;
|
|
2474
|
+
this.settemplate(stubData.template);
|
|
2475
|
+
this.taskId = '1';
|
|
2476
|
+
for (var i = 0; i < this.Records.list.length; i++)
|
|
2477
|
+
this.buildTableRowControls(i);
|
|
2478
|
+
};
|
|
2479
|
+
TaskMagicService.prototype.loadData = function () {
|
|
2480
|
+
alert('Please, overwrite method loadData');
|
|
2481
|
+
};
|
|
2482
|
+
TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
|
|
2483
|
+
if (this.IsStub()) {
|
|
2484
|
+
try {
|
|
2485
|
+
var val = this.Records.list[guiRowId].values[name];
|
|
2486
|
+
fc.setValue(val);
|
|
2487
|
+
}
|
|
2488
|
+
catch (e) {
|
|
2489
|
+
}
|
|
2910
2490
|
}
|
|
2911
|
-
return currentActiveRoute;
|
|
2912
2491
|
};
|
|
2913
|
-
return
|
|
2492
|
+
return TaskMagicService;
|
|
2914
2493
|
}());
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
/*@__PURE__*/ (function () {
|
|
2920
|
-
i0.ɵsetClassMetadata(SubformMagicService, [{
|
|
2494
|
+
TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
|
2495
|
+
TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
2496
|
+
(function () {
|
|
2497
|
+
i0.ɵsetClassMetadata(TaskMagicService, [{
|
|
2921
2498
|
type: i0.Injectable
|
|
2922
|
-
}], function () { return [{ type:
|
|
2499
|
+
}], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
|
|
2923
2500
|
})();
|
|
2924
2501
|
|
|
2925
|
-
/**
|
|
2926
|
-
* Implements various table-related functionalities
|
|
2927
|
-
*/
|
|
2928
2502
|
var TableMagicService = /** @class */ (function () {
|
|
2929
|
-
/**
|
|
2930
|
-
*
|
|
2931
|
-
* @param componentList Component-mapping service
|
|
2932
|
-
* @param task Magic task service
|
|
2933
|
-
*/
|
|
2934
2503
|
function TableMagicService(componentList, task) {
|
|
2935
2504
|
this.componentList = componentList;
|
|
2936
2505
|
this.task = task;
|
|
2937
2506
|
this.shouldOpenFieldTextEditor = true;
|
|
2938
2507
|
}
|
|
2939
|
-
/**
|
|
2940
|
-
* Refreshes the DataSource
|
|
2941
|
-
*/
|
|
2942
2508
|
TableMagicService.prototype.refreshDataSource = function () {
|
|
2943
2509
|
};
|
|
2944
|
-
/**
|
|
2945
|
-
* Returns the table page size
|
|
2946
|
-
*/
|
|
2947
2510
|
TableMagicService.prototype.getPageSize = function () {
|
|
2948
2511
|
return 10;
|
|
2949
2512
|
};
|
|
2950
|
-
/**
|
|
2951
|
-
* Returns max no of rows in the table.
|
|
2952
|
-
*/
|
|
2953
2513
|
TableMagicService.prototype.getMaxRowsInTable = function () {
|
|
2954
2514
|
return this.task.Records.list.length;
|
|
2955
2515
|
};
|
|
2956
|
-
/**
|
|
2957
|
-
* Selects the specified row
|
|
2958
|
-
* @param rowId The row to select
|
|
2959
|
-
*/
|
|
2960
2516
|
TableMagicService.prototype.selectRow = function (rowId) {
|
|
2961
2517
|
this.selectedItem = rowId;
|
|
2962
2518
|
};
|
|
2963
2519
|
TableMagicService.prototype.getSelectedRow = function () {
|
|
2964
2520
|
return this.selectedItem;
|
|
2965
2521
|
};
|
|
2966
|
-
/**
|
|
2967
|
-
* Returns the selected row
|
|
2968
|
-
*/
|
|
2969
2522
|
TableMagicService.prototype.selectedRow = function () {
|
|
2970
2523
|
return null;
|
|
2971
2524
|
};
|
|
2972
|
-
/**
|
|
2973
|
-
* Selects the specified page
|
|
2974
|
-
* @param pageId The page to select
|
|
2975
|
-
*/
|
|
2976
2525
|
TableMagicService.prototype.selectPage = function (pageId) {
|
|
2977
2526
|
};
|
|
2978
|
-
/**
|
|
2979
|
-
* Returns whether a dialog should be opened for the HTML element
|
|
2980
|
-
* @param element The HTML element for which a dialog may be needed
|
|
2981
|
-
* @returns
|
|
2982
|
-
*/
|
|
2983
2527
|
TableMagicService.prototype.OpenDialogForControl = function (element) {
|
|
2984
2528
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
|
2985
2529
|
element.tagName === "INPUT" ||
|
|
@@ -2987,34 +2531,17 @@
|
|
|
2987
2531
|
return false;
|
|
2988
2532
|
return true;
|
|
2989
2533
|
};
|
|
2990
|
-
/**
|
|
2991
|
-
* Returns the dialog used to edit values
|
|
2992
|
-
*/
|
|
2993
2534
|
TableMagicService.prototype.getDialog = function () {
|
|
2994
2535
|
return null;
|
|
2995
2536
|
};
|
|
2996
|
-
/**
|
|
2997
|
-
* Handles the table "scrolled" event
|
|
2998
|
-
*/
|
|
2999
2537
|
TableMagicService.prototype.onScrollDown = function () {
|
|
3000
2538
|
this.task.onScrollDown();
|
|
3001
2539
|
};
|
|
3002
|
-
/**
|
|
3003
|
-
* To be overwitten in specific implelemtations
|
|
3004
|
-
*/
|
|
3005
2540
|
TableMagicService.prototype.sortData = function (e) { };
|
|
3006
|
-
/**
|
|
3007
|
-
* To be overwitten in specific implelemtations
|
|
3008
|
-
*/
|
|
3009
2541
|
TableMagicService.prototype.mgOnPaginateChange = function (e) { };
|
|
3010
2542
|
TableMagicService.prototype.mgOptionChanged = function (e) { };
|
|
3011
|
-
/**
|
|
3012
|
-
* Change the number of lines in a table
|
|
3013
|
-
* @param size New number of lines in table
|
|
3014
|
-
*/
|
|
3015
2543
|
TableMagicService.prototype.updateTableSize = function (size) {
|
|
3016
|
-
if (size === 0)
|
|
3017
|
-
{
|
|
2544
|
+
if (size === 0) {
|
|
3018
2545
|
size = 1;
|
|
3019
2546
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
|
3020
2547
|
}
|
|
@@ -3022,17 +2549,11 @@
|
|
|
3022
2549
|
this.task.Records.updateSize(size);
|
|
3023
2550
|
this.task.setIncludesFirst(false);
|
|
3024
2551
|
};
|
|
3025
|
-
/**
|
|
3026
|
-
* @ignore
|
|
3027
|
-
*/
|
|
3028
2552
|
TableMagicService.prototype.setTableTopIndex = function (value) {
|
|
3029
2553
|
if (!this.task.Records.includesFirst)
|
|
3030
2554
|
value++;
|
|
3031
2555
|
this.task.Records.setGuiTopIndex(value);
|
|
3032
2556
|
};
|
|
3033
|
-
/**
|
|
3034
|
-
* @ignore
|
|
3035
|
-
*/
|
|
3036
2557
|
TableMagicService.prototype.getTableTopIndex = function () {
|
|
3037
2558
|
var topIndex = this.task.Records.getGuiTopIndex();
|
|
3038
2559
|
if (!this.task.Records.includesFirst)
|
|
@@ -3041,60 +2562,37 @@
|
|
|
3041
2562
|
};
|
|
3042
2563
|
return TableMagicService;
|
|
3043
2564
|
}());
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
2565
|
+
TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
|
|
2566
|
+
TableMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
|
2567
|
+
(function () {
|
|
3047
2568
|
i0.ɵsetClassMetadata(TableMagicService, [{
|
|
3048
2569
|
type: i0.Injectable
|
|
3049
2570
|
}], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null);
|
|
3050
2571
|
})();
|
|
3051
2572
|
|
|
3052
|
-
/**
|
|
3053
|
-
* Enables changing the browser title using Magic expression (SetTitle)
|
|
3054
|
-
*/
|
|
3055
2573
|
var TitleMagicService = /** @class */ (function () {
|
|
3056
|
-
/**
|
|
3057
|
-
*
|
|
3058
|
-
* @param titleService Angular's title-changing class
|
|
3059
|
-
*/
|
|
3060
2574
|
function TitleMagicService(titleService) {
|
|
3061
2575
|
this.titleService = titleService;
|
|
3062
2576
|
}
|
|
3063
|
-
/**
|
|
3064
|
-
* Set the new title of the window
|
|
3065
|
-
* @param newTitle New title of the window
|
|
3066
|
-
*/
|
|
3067
2577
|
TitleMagicService.prototype.setTitle = function (newTitle) {
|
|
3068
2578
|
this.titleService.setTitle(newTitle);
|
|
3069
2579
|
};
|
|
3070
2580
|
return TitleMagicService;
|
|
3071
2581
|
}());
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
2582
|
+
TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
|
|
2583
|
+
TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
|
2584
|
+
(function () {
|
|
3075
2585
|
i0.ɵsetClassMetadata(TitleMagicService, [{
|
|
3076
2586
|
type: i0.Injectable
|
|
3077
2587
|
}], function () { return [{ type: i1$1.Title }]; }, null);
|
|
3078
2588
|
})();
|
|
3079
2589
|
|
|
3080
|
-
/**
|
|
3081
|
-
* Provides the UI with values calculated by the Magic WebClient
|
|
3082
|
-
*/
|
|
3083
2590
|
var AccessorMagicService = /** @class */ (function () {
|
|
3084
|
-
/**
|
|
3085
|
-
* @ignore
|
|
3086
|
-
*/
|
|
3087
2591
|
function AccessorMagicService(task) {
|
|
3088
2592
|
this.task = task;
|
|
3089
2593
|
this.Logger = null;
|
|
3090
2594
|
this.Logger = utils$1.Logger.Instance;
|
|
3091
2595
|
}
|
|
3092
|
-
/**
|
|
3093
|
-
* Checks if the control is read-only
|
|
3094
|
-
* @param controlId Id of control
|
|
3095
|
-
* @returns Is the control not read-only
|
|
3096
|
-
*/
|
|
3097
|
-
// CheckReadOnly
|
|
3098
2596
|
AccessorMagicService.prototype.checkIsReadOnly = function (controlId) {
|
|
3099
2597
|
var properties;
|
|
3100
2598
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
|
@@ -3103,99 +2601,45 @@
|
|
|
3103
2601
|
else
|
|
3104
2602
|
return true;
|
|
3105
2603
|
};
|
|
3106
|
-
/**
|
|
3107
|
-
* Returns the text of the control
|
|
3108
|
-
* @param controlId Id of control
|
|
3109
|
-
* @param rowId Id of row, if applicable
|
|
3110
|
-
* @returns The text of the control
|
|
3111
|
-
*/
|
|
3112
|
-
// mgGetText
|
|
3113
2604
|
AccessorMagicService.prototype.getText = function (controlId, rowId) {
|
|
3114
2605
|
return this.task.getProperty(controlId, gui.HtmlProperties.Text, rowId);
|
|
3115
2606
|
};
|
|
3116
|
-
/**
|
|
3117
|
-
* Gets the text of the tab page
|
|
3118
|
-
* @param controlId Id of control
|
|
3119
|
-
* @param layer Id of tabpage
|
|
3120
|
-
* @returns Text of tabpage
|
|
3121
|
-
*/
|
|
3122
|
-
// mgGetTabpageText
|
|
3123
2607
|
AccessorMagicService.prototype.getTabpageText = function (controlId, layer) {
|
|
3124
2608
|
var items = this.task.getProperty(controlId, gui.HtmlProperties.ItemsList);
|
|
3125
2609
|
if (typeof items !== "undefined")
|
|
3126
2610
|
return items[layer].displayValue;
|
|
3127
2611
|
return "";
|
|
3128
2612
|
};
|
|
3129
|
-
/**
|
|
3130
|
-
* Gets the image defined for the control
|
|
3131
|
-
* @param controlId Id of control
|
|
3132
|
-
* @param rowId Id of row, if applicable
|
|
3133
|
-
* @returns Image set on control
|
|
3134
|
-
*/
|
|
3135
|
-
// mgGetImage
|
|
3136
2613
|
AccessorMagicService.prototype.getImage = function (controlId, rowId) {
|
|
3137
2614
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
|
|
3138
2615
|
return result;
|
|
3139
2616
|
};
|
|
3140
|
-
/**
|
|
3141
|
-
* Returns whether an image is set for this control
|
|
3142
|
-
* @param controlId Id of control
|
|
3143
|
-
* @param rowId Id of row, if applicable
|
|
3144
|
-
* @returns returns true if control has an image set on it
|
|
3145
|
-
*/
|
|
3146
|
-
// mgIsImageExists
|
|
3147
2617
|
AccessorMagicService.prototype.isImageExists = function (controlId, rowId) {
|
|
3148
2618
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
|
|
3149
2619
|
return !util.isNullOrUndefined(result);
|
|
3150
2620
|
};
|
|
3151
|
-
/**
|
|
3152
|
-
* Gets the CSS classes set on the control
|
|
3153
|
-
* @param controlId Id of control
|
|
3154
|
-
* @param rowId Id of row, if applicable
|
|
3155
|
-
* @returns The classes for this control
|
|
3156
|
-
*/
|
|
3157
|
-
// mgGetClasses
|
|
3158
2621
|
AccessorMagicService.prototype.getClasses = function (controlId, rowId) {
|
|
3159
2622
|
return this.task.getClasses(controlId, rowId);
|
|
3160
2623
|
};
|
|
3161
|
-
/**
|
|
3162
|
-
* Gets the CSS styles set on the control
|
|
3163
|
-
* @param controlId Id of control
|
|
3164
|
-
* @param styleName NAme of style requested
|
|
3165
|
-
* @param rowId Id of row, if applicable
|
|
3166
|
-
* @returns The style set on the control
|
|
3167
|
-
*/
|
|
3168
|
-
// mgGetStyle
|
|
3169
2624
|
AccessorMagicService.prototype.getStyle = function (controlId, styleName, rowId) {
|
|
3170
2625
|
var style = this.task.getStyle(controlId, styleName, rowId);
|
|
3171
2626
|
return style;
|
|
3172
2627
|
};
|
|
3173
|
-
/**
|
|
3174
|
-
* Returns whether a control is visible or not
|
|
3175
|
-
* @param controlId Id of control
|
|
3176
|
-
* @param rowId Id of row, if applicable
|
|
3177
|
-
* @returns Is the control visible or hidden
|
|
3178
|
-
*/
|
|
3179
|
-
// mgGetVisible
|
|
3180
2628
|
AccessorMagicService.prototype.getVisible = function (controlId, rowId) {
|
|
3181
2629
|
var vis = this.getProperty(controlId, gui.HtmlProperties.Visible, rowId);
|
|
3182
2630
|
return vis ? 'visible' : 'hidden';
|
|
3183
2631
|
};
|
|
3184
|
-
/**
|
|
3185
|
-
* Returns object representing numeric picture
|
|
3186
|
-
* @param picture string which is defined in magic
|
|
3187
|
-
* @returns object representing numeric picture
|
|
3188
|
-
*/
|
|
3189
|
-
// mgGetNumericPicture
|
|
3190
2632
|
AccessorMagicService.prototype.getNumericPicture = function (picture) {
|
|
3191
2633
|
if (util.isNullOrUndefined(picture))
|
|
3192
2634
|
return null;
|
|
3193
2635
|
var pic = new gui.PIC(picture, utils$1.StorageAttribute.NUMERIC, 0);
|
|
3194
2636
|
var obj = {};
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
2637
|
+
obj['prefix'] = "";
|
|
2638
|
+
if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
|
|
2639
|
+
var pref = '-' + pic.getPosPref_();
|
|
2640
|
+
if (pref == pic.getNegPref_())
|
|
2641
|
+
obj['prefix'] = pic.getPosPref_();
|
|
2642
|
+
}
|
|
3199
2643
|
if (pic.getPosSuff_().length > 0)
|
|
3200
2644
|
obj['suffix'] = pic.getPosSuff_();
|
|
3201
2645
|
else
|
|
@@ -3217,128 +2661,51 @@
|
|
|
3217
2661
|
obj['wholes'] = pic.getWholes();
|
|
3218
2662
|
return obj;
|
|
3219
2663
|
};
|
|
3220
|
-
/**
|
|
3221
|
-
* Returns whether a control should have the "required" attribute set on it
|
|
3222
|
-
* @param controlId Id of control
|
|
3223
|
-
* @param rowId Id of row, if applicable
|
|
3224
|
-
* @returns
|
|
3225
|
-
*/
|
|
3226
|
-
// mgGetMustInput
|
|
3227
2664
|
AccessorMagicService.prototype.getMustInput = function (controlId, rowId) {
|
|
3228
2665
|
var vis = this.getProperty(controlId, gui.HtmlProperties.MustInput, rowId);
|
|
3229
2666
|
return vis ? 'true' : 'false';
|
|
3230
2667
|
};
|
|
3231
|
-
/**
|
|
3232
|
-
* Returns whether a control is disabled
|
|
3233
|
-
* @param controlId Id of control
|
|
3234
|
-
* @param rowId Id of row, if applicable
|
|
3235
|
-
* @returns
|
|
3236
|
-
*/
|
|
3237
|
-
// mgIsDisabled
|
|
3238
2668
|
AccessorMagicService.prototype.isDisabled = function (controlId, rowId) {
|
|
3239
2669
|
var result = this.getProperty(controlId, gui.HtmlProperties.Enabled, rowId);
|
|
3240
2670
|
return result === true ? null : true;
|
|
3241
2671
|
};
|
|
3242
|
-
/**
|
|
3243
|
-
* @ignore
|
|
3244
|
-
*/
|
|
3245
|
-
// getProperty (not changed)
|
|
3246
2672
|
AccessorMagicService.prototype.getProperty = function (controlId, prop, rowId) {
|
|
3247
2673
|
return this.task.getProperty(controlId, prop, rowId);
|
|
3248
2674
|
};
|
|
3249
|
-
/**
|
|
3250
|
-
* Returns the title (tooltip) text of the control
|
|
3251
|
-
* @param controlId Id of control
|
|
3252
|
-
* @param rowId Id of row, if applicable
|
|
3253
|
-
* @returns
|
|
3254
|
-
*/
|
|
3255
|
-
// mgGetTitle
|
|
3256
2675
|
AccessorMagicService.prototype.getTitle = function (controlId, rowId) {
|
|
3257
2676
|
return this.task.getProperty(controlId, gui.HtmlProperties.Tooltip, rowId);
|
|
3258
2677
|
};
|
|
3259
|
-
/**
|
|
3260
|
-
* Returns the title (tooltip) text of the control
|
|
3261
|
-
* @param controlId Id of control
|
|
3262
|
-
* @param rowId Id of row, if applicable
|
|
3263
|
-
* @returns
|
|
3264
|
-
*/
|
|
3265
|
-
// mgGetTitle for zoom button
|
|
3266
2678
|
AccessorMagicService.prototype.getZoomButtonTitle = function (controlId, rowId) {
|
|
3267
2679
|
return this.task.getProperty(controlId, gui.HtmlProperties.ZoomButtonTooltip, rowId);
|
|
3268
2680
|
};
|
|
3269
|
-
/**
|
|
3270
|
-
* Gets the selection control's selected value
|
|
3271
|
-
* @param controlId Id of control
|
|
3272
|
-
* @param rowId Id of row, if applicable
|
|
3273
|
-
* @returns
|
|
3274
|
-
*/
|
|
3275
|
-
// getSelectedValue
|
|
3276
2681
|
AccessorMagicService.prototype.getSelectedValue = function (controlId, rowId) {
|
|
3277
2682
|
return this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue, rowId);
|
|
3278
2683
|
};
|
|
3279
|
-
/**
|
|
3280
|
-
* Gets the place-holder text of the control
|
|
3281
|
-
* @param controlId Id of control
|
|
3282
|
-
* @param rowId Id of row, if applicable
|
|
3283
|
-
* @returns
|
|
3284
|
-
*/
|
|
3285
|
-
// mgGetPlaceholder
|
|
3286
2684
|
AccessorMagicService.prototype.getPlaceholder = function (controlId, rowId) {
|
|
3287
2685
|
return this.task.getProperty(controlId, gui.HtmlProperties.PlaceHolder, rowId);
|
|
3288
2686
|
};
|
|
3289
|
-
/**
|
|
3290
|
-
* Returns a type for input controls - should the control be a simple text or a password control
|
|
3291
|
-
* @param controlId Id of control
|
|
3292
|
-
* @param rowId Id of row, if applicable
|
|
3293
|
-
* @returns
|
|
3294
|
-
*/
|
|
3295
|
-
// mgGetType
|
|
3296
2687
|
AccessorMagicService.prototype.getType = function (controlId, rowId) {
|
|
3297
2688
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Password, rowId);
|
|
3298
2689
|
return result ? "password" : "text";
|
|
3299
2690
|
};
|
|
3300
|
-
/**
|
|
3301
|
-
* Returns the tab-index of the control
|
|
3302
|
-
* @param controlId Id of control
|
|
3303
|
-
* @param rowId Id of row, if applicable
|
|
3304
|
-
* @returns
|
|
3305
|
-
*/
|
|
3306
|
-
// mgGetTabIndex
|
|
3307
2691
|
AccessorMagicService.prototype.getTabIndex = function (controlId, rowId) {
|
|
3308
2692
|
return this.task.getProperty(controlId, gui.HtmlProperties.TabIndex, rowId);
|
|
3309
2693
|
};
|
|
3310
|
-
/**
|
|
3311
|
-
* Returns the value of the control
|
|
3312
|
-
* @param controlId Id of control
|
|
3313
|
-
* @param rowId Id of row, if applicable
|
|
3314
|
-
* @returns
|
|
3315
|
-
*/
|
|
3316
|
-
/// mgGetValue -->
|
|
3317
2694
|
AccessorMagicService.prototype.getValue = function (controlId, rowId) {
|
|
3318
2695
|
var val = this.task.getValue(controlId, rowId);
|
|
3319
2696
|
return val;
|
|
3320
2697
|
};
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
*/
|
|
3327
|
-
/// getPicture -->
|
|
2698
|
+
AccessorMagicService.prototype.getFormattedValue = function (controlId, rowId) {
|
|
2699
|
+
var val = this.task.getValue(controlId, rowId);
|
|
2700
|
+
val = this.task.getFormattedValue(controlId, val);
|
|
2701
|
+
return val;
|
|
2702
|
+
};
|
|
3328
2703
|
AccessorMagicService.prototype.getPicture = function (controlId, rowId) {
|
|
3329
2704
|
if (util.isNullOrUndefined(controlId))
|
|
3330
2705
|
return null;
|
|
3331
2706
|
var pic = this.task.GetControlPictureMask(controlId);
|
|
3332
2707
|
return (pic != null) ? pic.getFormat().toString() : null;
|
|
3333
2708
|
};
|
|
3334
|
-
/**
|
|
3335
|
-
* Returns the custom (user) properties of the control
|
|
3336
|
-
* @param controlId Id of control
|
|
3337
|
-
* @param propertyName Name of requested property
|
|
3338
|
-
* @param rowId Id of row, if applicable
|
|
3339
|
-
* @returns
|
|
3340
|
-
*/
|
|
3341
|
-
// mgGetCustomProperty
|
|
3342
2709
|
AccessorMagicService.prototype.getCustomProperty = function (controlId, propertyNameOrRowID, rowId) {
|
|
3343
2710
|
if (controlId.indexOf('~') == -1)
|
|
3344
2711
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
|
@@ -3363,22 +2730,21 @@
|
|
|
3363
2730
|
}
|
|
3364
2731
|
return userProperties;
|
|
3365
2732
|
};
|
|
3366
|
-
/**
|
|
3367
|
-
* Gets the values of the items of a selection control
|
|
3368
|
-
* @param id Id of control
|
|
3369
|
-
* @param rowId Id of row, if applicable
|
|
3370
|
-
* @returns
|
|
3371
|
-
*/
|
|
3372
|
-
// mgGetItemListValues
|
|
3373
2733
|
AccessorMagicService.prototype.getItemListValues = function (id, rowId) {
|
|
3374
2734
|
return this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
|
|
3375
2735
|
};
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
2736
|
+
AccessorMagicService.prototype.getFilteredList = function (controlId, rowId) {
|
|
2737
|
+
if (util.isNullOrUndefined(rowId))
|
|
2738
|
+
rowId = '0';
|
|
2739
|
+
var items = this.getItemListValues(controlId, rowId);
|
|
2740
|
+
var value = this.task.getFormControl(rowId, controlId).value;
|
|
2741
|
+
if (value !== null && value !== "" && items instanceof Array) {
|
|
2742
|
+
value = value.toLowerCase();
|
|
2743
|
+
return items.filter(function (option) { return option.displayValue.toLowerCase().includes(value); });
|
|
2744
|
+
}
|
|
2745
|
+
else
|
|
2746
|
+
return items;
|
|
2747
|
+
};
|
|
3382
2748
|
AccessorMagicService.prototype.getDisplayValue = function (id, rowId) {
|
|
3383
2749
|
var displayValue = "";
|
|
3384
2750
|
var o = this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
|
|
@@ -3387,12 +2753,6 @@
|
|
|
3387
2753
|
displayValue = o[value].displayValue;
|
|
3388
2754
|
return displayValue;
|
|
3389
2755
|
};
|
|
3390
|
-
/**
|
|
3391
|
-
* Returns whether a tab page is selected or not
|
|
3392
|
-
* @param index of current option in iterarotr
|
|
3393
|
-
* @param control Id of list control
|
|
3394
|
-
* @returns
|
|
3395
|
-
*/ // isOptionSelected
|
|
3396
2756
|
AccessorMagicService.prototype.isOptionSelected = function (index, controlId) {
|
|
3397
2757
|
var e_1, _a;
|
|
3398
2758
|
var val = this.task.getValue(controlId, "0");
|
|
@@ -3412,40 +2772,18 @@
|
|
|
3412
2772
|
}
|
|
3413
2773
|
return false;
|
|
3414
2774
|
};
|
|
3415
|
-
/**
|
|
3416
|
-
* Returns whether a tab page is selected or not - used for the tab buttons
|
|
3417
|
-
* @param controlId Id of control
|
|
3418
|
-
* @param layer Id of the tab page
|
|
3419
|
-
* @returns
|
|
3420
|
-
*/ // mgIsTabPageSelected
|
|
3421
2775
|
AccessorMagicService.prototype.isTabPageSelected = function (controlId, layer) {
|
|
3422
2776
|
var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue);
|
|
3423
|
-
return val == (layer - 1);
|
|
3424
|
-
};
|
|
3425
|
-
/**
|
|
3426
|
-
* Returns whether a tab page layer is selected or not - used for the div which represents the tab page
|
|
3427
|
-
* @param controlId Id of control
|
|
3428
|
-
* @param layer Id of the tab page
|
|
3429
|
-
* @returns
|
|
3430
|
-
*/ // mgIsTabLayerSelected
|
|
2777
|
+
return val == (layer - 1);
|
|
2778
|
+
};
|
|
3431
2779
|
AccessorMagicService.prototype.isTabPageLayerSelected = function (controlId, layer) {
|
|
3432
2780
|
var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedLayer);
|
|
3433
|
-
return val == (layer - 1);
|
|
2781
|
+
return val == (layer - 1);
|
|
3434
2782
|
};
|
|
3435
|
-
/**
|
|
3436
|
-
* Returns the index of the selected tab page
|
|
3437
|
-
* @param controlId Id of control
|
|
3438
|
-
* @returns
|
|
3439
|
-
*/
|
|
3440
2783
|
AccessorMagicService.prototype.getTabSelectedIndex = function (controlId) {
|
|
3441
2784
|
var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue);
|
|
3442
|
-
return val;
|
|
2785
|
+
return val;
|
|
3443
2786
|
};
|
|
3444
|
-
// private methodes
|
|
3445
|
-
/**
|
|
3446
|
-
* @ignore
|
|
3447
|
-
*/
|
|
3448
|
-
// mgIfRowCreated
|
|
3449
2787
|
AccessorMagicService.prototype.ifRowCreated = function (row) {
|
|
3450
2788
|
if (row == null)
|
|
3451
2789
|
return false;
|
|
@@ -3453,48 +2791,25 @@
|
|
|
3453
2791
|
var result = this.getFormGroupByRow(rowId);
|
|
3454
2792
|
return !util.isNullOrUndefined(result);
|
|
3455
2793
|
};
|
|
3456
|
-
/**
|
|
3457
|
-
* @ignore
|
|
3458
|
-
*/
|
|
3459
|
-
// mgGetFormGroupByRow
|
|
3460
2794
|
AccessorMagicService.prototype.getFormGroupByRow = function (id) {
|
|
3461
2795
|
return this.task.formGroups[id];
|
|
3462
2796
|
};
|
|
3463
|
-
/**
|
|
3464
|
-
* @ignore
|
|
3465
|
-
*/
|
|
3466
|
-
// isRowSelected (not changed)
|
|
3467
2797
|
AccessorMagicService.prototype.isRowSelected = function (controlId, rowId) {
|
|
3468
2798
|
var selectedRow = this.task.getProperty(controlId, gui.HtmlProperties.SelectedRow, "0");
|
|
3469
2799
|
return selectedRow == rowId;
|
|
3470
2800
|
};
|
|
3471
|
-
/**
|
|
3472
|
-
* Returns whether a row is in edit state
|
|
3473
|
-
* @param row
|
|
3474
|
-
*/
|
|
3475
2801
|
AccessorMagicService.prototype.isRowInRowEditing = function (row) {
|
|
3476
2802
|
var guiRowId = '0';
|
|
3477
2803
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
|
3478
2804
|
return this.task.isRowInRowEditing(guiRowId);
|
|
3479
2805
|
};
|
|
3480
|
-
/**
|
|
3481
|
-
* Returns whether a row is in edit state, use this method while control outside table control
|
|
3482
|
-
* @param row
|
|
3483
|
-
*/
|
|
3484
2806
|
AccessorMagicService.prototype.isCurrentInRowEditing = function () {
|
|
3485
2807
|
var row = this.task.tableService.getSelectedRow();
|
|
3486
2808
|
return this.task.isRowInRowEditing(row);
|
|
3487
2809
|
};
|
|
3488
|
-
/**
|
|
3489
|
-
* @ignore
|
|
3490
|
-
*/
|
|
3491
|
-
// GetGuiTopIndex
|
|
3492
2810
|
AccessorMagicService.prototype.guiTopIndex = function () {
|
|
3493
2811
|
return this.task.tableService.getTableTopIndex();
|
|
3494
2812
|
};
|
|
3495
|
-
/**
|
|
3496
|
-
* @ignore
|
|
3497
|
-
*/
|
|
3498
2813
|
AccessorMagicService.prototype.getErrMsg = function (id, rowId) {
|
|
3499
2814
|
var e_2, _a;
|
|
3500
2815
|
var c = this.task.getFormControl(rowId, id);
|
|
@@ -3527,12 +2842,6 @@
|
|
|
3527
2842
|
}
|
|
3528
2843
|
return 'unknown error';
|
|
3529
2844
|
};
|
|
3530
|
-
/**
|
|
3531
|
-
* Sets a user-supplied value to the specified control
|
|
3532
|
-
* @param controlName
|
|
3533
|
-
* @param value
|
|
3534
|
-
* @param refreshDisplay
|
|
3535
|
-
*/
|
|
3536
2845
|
AccessorMagicService.prototype.setValueToControl = function (controlName, value, refreshDisplay) {
|
|
3537
2846
|
if (typeof refreshDisplay === "undefined")
|
|
3538
2847
|
refreshDisplay = true;
|
|
@@ -3541,31 +2850,17 @@
|
|
|
3541
2850
|
guiEvent.param = refreshDisplay;
|
|
3542
2851
|
this.task.insertEvent(guiEvent);
|
|
3543
2852
|
};
|
|
3544
|
-
/**
|
|
3545
|
-
* @ignore
|
|
3546
|
-
*/
|
|
3547
2853
|
AccessorMagicService.prototype.isDataviewEmpty = function () {
|
|
3548
2854
|
return this.task.Records.isEmptyDataView;
|
|
3549
2855
|
};
|
|
3550
|
-
/**
|
|
3551
|
-
* simulates a click event on the specified control, for the Magic engine
|
|
3552
|
-
* @param controlName
|
|
3553
|
-
* @param rowId
|
|
3554
|
-
*/
|
|
3555
2856
|
AccessorMagicService.prototype.simulateClick = function (controlName, rowId) {
|
|
3556
2857
|
if (typeof rowId === "undefined")
|
|
3557
2858
|
rowId = 0;
|
|
3558
2859
|
this.task.insertEvent(engine.getGuiEventObj('click', controlName, rowId));
|
|
3559
2860
|
};
|
|
3560
|
-
/**
|
|
3561
|
-
* Return Boolean TRUE if user logged in Else it will return FALSE
|
|
3562
|
-
*/
|
|
3563
2861
|
AccessorMagicService.prototype.isLoggedIn = function () {
|
|
3564
2862
|
return this.task.getIsLoggenIn();
|
|
3565
2863
|
};
|
|
3566
|
-
/**
|
|
3567
|
-
* Returns JS object containing the records with all table fields.
|
|
3568
|
-
*/
|
|
3569
2864
|
AccessorMagicService.prototype.GetFormRecords = function () {
|
|
3570
2865
|
var _this = this;
|
|
3571
2866
|
var rowId = 0;
|
|
@@ -3573,13 +2868,11 @@
|
|
|
3573
2868
|
if (!util.isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
|
3574
2869
|
var recList = this.task.Records.list;
|
|
3575
2870
|
var tableControls_1 = new Array();
|
|
3576
|
-
//Generate list of table fields names
|
|
3577
2871
|
for (var key in this.task.template) {
|
|
3578
2872
|
if (this.task.template[key] == '1')
|
|
3579
2873
|
tableControls_1.push(key);
|
|
3580
2874
|
}
|
|
3581
2875
|
recArray = new Array();
|
|
3582
|
-
//Update the records as list of objects with values for table fields.
|
|
3583
2876
|
if (tableControls_1.length > 0) {
|
|
3584
2877
|
recList.forEach(function (ctrlMetaData) {
|
|
3585
2878
|
if (_this.task.Records.isRowCreated(rowId)) {
|
|
@@ -3595,23 +2888,26 @@
|
|
|
3595
2888
|
}
|
|
3596
2889
|
return recArray;
|
|
3597
2890
|
};
|
|
2891
|
+
AccessorMagicService.prototype.SetCookie = function (name, value, expires, path, domain, secure, sameSite) {
|
|
2892
|
+
engine.CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
|
2893
|
+
};
|
|
2894
|
+
AccessorMagicService.prototype.GetCookie = function (name) {
|
|
2895
|
+
return engine.CookieService.getCookie(name);
|
|
2896
|
+
};
|
|
2897
|
+
AccessorMagicService.prototype.DeleteCookie = function (name) {
|
|
2898
|
+
return engine.CookieService.deleteCookie(name);
|
|
2899
|
+
};
|
|
3598
2900
|
return AccessorMagicService;
|
|
3599
2901
|
}());
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
2902
|
+
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService)); };
|
|
2903
|
+
AccessorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
2904
|
+
(function () {
|
|
3603
2905
|
i0.ɵsetClassMetadata(AccessorMagicService, [{
|
|
3604
2906
|
type: i0.Injectable
|
|
3605
2907
|
}], function () { return [{ type: TaskMagicService }]; }, null);
|
|
3606
2908
|
})();
|
|
3607
2909
|
|
|
3608
|
-
/**
|
|
3609
|
-
* Central place for adding the Magic services
|
|
3610
|
-
*/
|
|
3611
2910
|
var MagicServices = /** @class */ (function () {
|
|
3612
|
-
/**
|
|
3613
|
-
* @ignore
|
|
3614
|
-
*/
|
|
3615
2911
|
function MagicServices(task, subformService, tableService, titleService, mgAccessorService) {
|
|
3616
2912
|
this.task = task;
|
|
3617
2913
|
this.subformService = subformService;
|
|
@@ -3625,36 +2921,21 @@
|
|
|
3625
2921
|
}
|
|
3626
2922
|
return MagicServices;
|
|
3627
2923
|
}());
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
2924
|
+
MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
|
|
2925
|
+
MagicServices.ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
|
2926
|
+
(function () {
|
|
3631
2927
|
i0.ɵsetClassMetadata(MagicServices, [{
|
|
3632
2928
|
type: i0.Injectable
|
|
3633
2929
|
}], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null);
|
|
3634
2930
|
})();
|
|
3635
2931
|
|
|
3636
|
-
/**
|
|
3637
|
-
* Base component representing a Magic task
|
|
3638
|
-
*/
|
|
3639
2932
|
var TaskBaseMagicComponent = /** @class */ (function () {
|
|
3640
|
-
/**
|
|
3641
|
-
*
|
|
3642
|
-
* @param ref changes-detector object
|
|
3643
|
-
* @param magicServices Access point for all Magic services
|
|
3644
|
-
*/
|
|
3645
2933
|
function TaskBaseMagicComponent(ref, magicServices) {
|
|
3646
2934
|
this.ref = ref;
|
|
3647
2935
|
this.magicServices = magicServices;
|
|
3648
|
-
/**
|
|
3649
|
-
* @ignore
|
|
3650
|
-
*/
|
|
3651
2936
|
this.magicProperties = utils$1.MagicProperties;
|
|
3652
2937
|
}
|
|
3653
2938
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "task", {
|
|
3654
|
-
/**
|
|
3655
|
-
* Returns the Magic task service
|
|
3656
|
-
* @returns
|
|
3657
|
-
*/
|
|
3658
2939
|
get: function () {
|
|
3659
2940
|
return this.magicServices.task;
|
|
3660
2941
|
},
|
|
@@ -3662,10 +2943,6 @@
|
|
|
3662
2943
|
configurable: true
|
|
3663
2944
|
});
|
|
3664
2945
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "mgSub", {
|
|
3665
|
-
/**
|
|
3666
|
-
* Returns the Magic subform service
|
|
3667
|
-
* @returns
|
|
3668
|
-
*/
|
|
3669
2946
|
get: function () {
|
|
3670
2947
|
return this.magicServices.subformService;
|
|
3671
2948
|
},
|
|
@@ -3673,10 +2950,6 @@
|
|
|
3673
2950
|
configurable: true
|
|
3674
2951
|
});
|
|
3675
2952
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "tableService", {
|
|
3676
|
-
/**
|
|
3677
|
-
* Returns the Magic table service
|
|
3678
|
-
* @returns
|
|
3679
|
-
*/
|
|
3680
2953
|
get: function () {
|
|
3681
2954
|
return this.magicServices.tableService;
|
|
3682
2955
|
},
|
|
@@ -3684,10 +2957,6 @@
|
|
|
3684
2957
|
configurable: true
|
|
3685
2958
|
});
|
|
3686
2959
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "mg", {
|
|
3687
|
-
/**
|
|
3688
|
-
* Returns the Magic accessor service
|
|
3689
|
-
* @returns
|
|
3690
|
-
*/
|
|
3691
2960
|
get: function () {
|
|
3692
2961
|
return this.magicServices.mgAccessorService;
|
|
3693
2962
|
},
|
|
@@ -3695,10 +2964,6 @@
|
|
|
3695
2964
|
configurable: true
|
|
3696
2965
|
});
|
|
3697
2966
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "taskId", {
|
|
3698
|
-
/**
|
|
3699
|
-
* Returns the task Id
|
|
3700
|
-
* @returns
|
|
3701
|
-
*/
|
|
3702
2967
|
get: function () {
|
|
3703
2968
|
return this.task.taskId;
|
|
3704
2969
|
},
|
|
@@ -3706,19 +2971,12 @@
|
|
|
3706
2971
|
configurable: true
|
|
3707
2972
|
});
|
|
3708
2973
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "screenFormGroup", {
|
|
3709
|
-
/**
|
|
3710
|
-
* Returns the FormGroup for screen-mode forms
|
|
3711
|
-
* @returns
|
|
3712
|
-
*/
|
|
3713
2974
|
get: function () {
|
|
3714
2975
|
return this.task.ScreenModeControls;
|
|
3715
2976
|
},
|
|
3716
2977
|
enumerable: false,
|
|
3717
2978
|
configurable: true
|
|
3718
2979
|
});
|
|
3719
|
-
/**
|
|
3720
|
-
* Interface implementation
|
|
3721
|
-
*/
|
|
3722
2980
|
TaskBaseMagicComponent.prototype.ngOnInit = function () {
|
|
3723
2981
|
var _this = this;
|
|
3724
2982
|
var subscription = this.task.detectChanges.pipe().subscribe(function (c) {
|
|
@@ -3727,48 +2985,19 @@
|
|
|
3727
2985
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
3728
2986
|
this.createFormControlsAccessor(this.screenFormGroup);
|
|
3729
2987
|
this.setInputDateFormat();
|
|
3730
|
-
// subcribe to custom property changes
|
|
3731
2988
|
this.task.customPropertiesSubject.pipe().subscribe(function (property) {
|
|
3732
2989
|
_this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
|
3733
2990
|
});
|
|
3734
|
-
// subcribe to records count changes
|
|
3735
2991
|
this.task.recordsCountChangeSubject.pipe().subscribe(function (value) {
|
|
3736
2992
|
_this.RecordsCountChanged(value);
|
|
3737
2993
|
});
|
|
3738
2994
|
};
|
|
3739
|
-
/**
|
|
3740
|
-
* @ignore
|
|
3741
|
-
*/
|
|
3742
2995
|
TaskBaseMagicComponent.prototype.createFormControlsAccessor = function (formGroup) { };
|
|
3743
|
-
/**
|
|
3744
|
-
* @ignore
|
|
3745
|
-
*/
|
|
3746
2996
|
TaskBaseMagicComponent.prototype.setInputDateFormat = function () { };
|
|
3747
|
-
/**
|
|
3748
|
-
* This method is called when the value of any custom property is updated in Magic
|
|
3749
|
-
* propertyName : name of property which is updated. The format is <controlname>~<propertyname>
|
|
3750
|
-
* rowId : row number of the updated property for controls in table control (0 for controls outside table)
|
|
3751
|
-
* value : updated value of the property
|
|
3752
|
-
* @returns : void
|
|
3753
|
-
* To use the method override it in your component and check the property name and write you code ..for eg
|
|
3754
|
-
* if(propertyName == 'controlname~propertyName') {// your code}
|
|
3755
|
-
* else { // your code}
|
|
3756
|
-
*/
|
|
3757
2997
|
TaskBaseMagicComponent.prototype.PropertyChanged = function (propertyName, rowId, value) {
|
|
3758
|
-
|
|
3759
|
-
};
|
|
3760
|
-
/**
|
|
3761
|
-
* Records count change subject is subscribed to change in its value. This method will be called
|
|
3762
|
-
* as the value of records count is received at from server.
|
|
3763
|
-
* @returns : void
|
|
3764
|
-
* To use the method override it in your component.
|
|
3765
|
-
*/
|
|
2998
|
+
};
|
|
3766
2999
|
TaskBaseMagicComponent.prototype.RecordsCountChanged = function (recordsCount) {
|
|
3767
|
-
// intentionally left blank because the implementation should be in the derived class
|
|
3768
3000
|
};
|
|
3769
|
-
/**
|
|
3770
|
-
* Interface implementation
|
|
3771
|
-
*/
|
|
3772
3001
|
TaskBaseMagicComponent.prototype.ngAfterViewInit = function () {
|
|
3773
3002
|
this.mgSub.init();
|
|
3774
3003
|
};
|
|
@@ -3778,17 +3007,14 @@
|
|
|
3778
3007
|
this.task.oldPageSize = this.tableService.getPageSize();
|
|
3779
3008
|
}
|
|
3780
3009
|
};
|
|
3781
|
-
/**
|
|
3782
|
-
* Interface implementation
|
|
3783
|
-
*/
|
|
3784
3010
|
TaskBaseMagicComponent.prototype.ngOnDestroy = function () {
|
|
3785
3011
|
this.task.dispose();
|
|
3786
3012
|
};
|
|
3787
3013
|
return TaskBaseMagicComponent;
|
|
3788
3014
|
}());
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3015
|
+
TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
|
|
3016
|
+
TaskBaseMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
3017
|
+
(function () {
|
|
3792
3018
|
i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
|
3793
3019
|
type: i0.Component,
|
|
3794
3020
|
args: [{
|
|
@@ -3803,22 +3029,13 @@
|
|
|
3803
3029
|
}] });
|
|
3804
3030
|
})();
|
|
3805
3031
|
|
|
3806
|
-
/**
|
|
3807
|
-
* @ignore
|
|
3808
|
-
*/
|
|
3809
3032
|
var RowMagicDirective = /** @class */ (function () {
|
|
3810
3033
|
function RowMagicDirective(_task, element) {
|
|
3811
3034
|
this._task = _task;
|
|
3812
3035
|
this.element = element;
|
|
3813
|
-
/**
|
|
3814
|
-
* @ignore
|
|
3815
|
-
*/
|
|
3816
3036
|
this.rowChangedSubscriber = null;
|
|
3817
3037
|
this.htmlElement = this.element.nativeElement;
|
|
3818
3038
|
}
|
|
3819
|
-
/**
|
|
3820
|
-
* Initializes this object
|
|
3821
|
-
*/
|
|
3822
3039
|
RowMagicDirective.prototype.ngOnInit = function () {
|
|
3823
3040
|
var _this = this;
|
|
3824
3041
|
this.rowChangedSubscriber = this._task
|
|
@@ -3834,16 +3051,7 @@
|
|
|
3834
3051
|
return (rect.top >= parentRect.top &&
|
|
3835
3052
|
rect.bottom <= parentRect.bottom);
|
|
3836
3053
|
};
|
|
3837
|
-
/**
|
|
3838
|
-
* Cleanup
|
|
3839
|
-
*/
|
|
3840
3054
|
RowMagicDirective.prototype.ngOnDestroy = function () {
|
|
3841
|
-
// Don't know why, but when the table is loaded for the first time, we
|
|
3842
|
-
// get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
|
|
3843
|
-
// for number of rows in the page but here this.rowId is undefined.
|
|
3844
|
-
// Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
|
|
3845
|
-
// is null and hence crashes.
|
|
3846
|
-
// So, the condition to check nulity is added.
|
|
3847
3055
|
if (this.rowChangedSubscriber !== null) {
|
|
3848
3056
|
this.rowChangedSubscriber.unsubscribe();
|
|
3849
3057
|
}
|
|
@@ -3856,13 +3064,13 @@
|
|
|
3856
3064
|
};
|
|
3857
3065
|
return RowMagicDirective;
|
|
3858
3066
|
}());
|
|
3859
|
-
|
|
3860
|
-
|
|
3067
|
+
RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
3068
|
+
RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) {
|
|
3861
3069
|
if (rf & 1) {
|
|
3862
3070
|
i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
|
3863
3071
|
}
|
|
3864
3072
|
}, inputs: { rowId: ["magicRow", "rowId"] } });
|
|
3865
|
-
|
|
3073
|
+
(function () {
|
|
3866
3074
|
i0.ɵsetClassMetadata(RowMagicDirective, [{
|
|
3867
3075
|
type: i0.Directive,
|
|
3868
3076
|
args: [{
|
|
@@ -3877,35 +3085,16 @@
|
|
|
3877
3085
|
}] });
|
|
3878
3086
|
})();
|
|
3879
3087
|
|
|
3880
|
-
/**
|
|
3881
|
-
* Connects HTML elements to the Magic Web Client engine
|
|
3882
|
-
*/
|
|
3883
3088
|
var MagicDirective = /** @class */ (function () {
|
|
3884
|
-
/**
|
|
3885
|
-
*
|
|
3886
|
-
* @param _task The task service
|
|
3887
|
-
* @param element The element for which the directive is applied
|
|
3888
|
-
* @param renderer Renderer for the element
|
|
3889
|
-
* @param vcRef
|
|
3890
|
-
* @param magicRow
|
|
3891
|
-
*/
|
|
3892
3089
|
function MagicDirective(_task, element, renderer, vcRef, magicRow) {
|
|
3893
3090
|
this._task = _task;
|
|
3894
3091
|
this.element = element;
|
|
3895
3092
|
this.renderer = renderer;
|
|
3896
3093
|
this.vcRef = vcRef;
|
|
3897
3094
|
this.magicRow = magicRow;
|
|
3898
|
-
/**
|
|
3899
|
-
* Collection of event handlers for this element
|
|
3900
|
-
*/
|
|
3901
3095
|
this.eventHandlers = {};
|
|
3902
3096
|
this.eventsOnlyVal = false;
|
|
3903
3097
|
this.htmlElement = this.element.nativeElement;
|
|
3904
|
-
//let c = (<any>this.vcRef)._view;
|
|
3905
|
-
//while (!(c instanceof TaskBaseMagicComponent)) {
|
|
3906
|
-
// c = c.component;
|
|
3907
|
-
//}
|
|
3908
|
-
//this.component = c;
|
|
3909
3098
|
if (!(typeof magicRow === 'undefined' || magicRow === null))
|
|
3910
3099
|
this.rowId = magicRow.rowId;
|
|
3911
3100
|
}
|
|
@@ -3919,9 +3108,6 @@
|
|
|
3919
3108
|
});
|
|
3920
3109
|
;
|
|
3921
3110
|
Object.defineProperty(MagicDirective.prototype, "eventsOnly", {
|
|
3922
|
-
/**
|
|
3923
|
-
* This flag is used when we only want to register to events, but do not want to execute commands sent from server
|
|
3924
|
-
*/
|
|
3925
3111
|
set: function (val) {
|
|
3926
3112
|
console.log('eventsOnly');
|
|
3927
3113
|
this.eventsOnlyVal = true;
|
|
@@ -3931,36 +3117,25 @@
|
|
|
3931
3117
|
});
|
|
3932
3118
|
;
|
|
3933
3119
|
Object.defineProperty(MagicDirective.prototype, "task", {
|
|
3934
|
-
/**
|
|
3935
|
-
* Get the task service
|
|
3936
|
-
* @returns
|
|
3937
|
-
*/
|
|
3938
3120
|
get: function () {
|
|
3939
3121
|
return this._task;
|
|
3940
3122
|
},
|
|
3941
3123
|
enumerable: false,
|
|
3942
3124
|
configurable: true
|
|
3943
3125
|
});
|
|
3944
|
-
/**
|
|
3945
|
-
* Register to the events this element may need to handle
|
|
3946
|
-
*/
|
|
3947
3126
|
MagicDirective.prototype.regEvents = function () {
|
|
3948
3127
|
var _this = this;
|
|
3949
|
-
// Handle events for which event handler may be removed and restored
|
|
3950
3128
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
3951
3129
|
Object.keys(this.eventHandlers).forEach(function (key) {
|
|
3952
3130
|
_this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
|
|
3953
3131
|
});
|
|
3954
|
-
|
|
3955
|
-
var events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
|
|
3132
|
+
var events = ['click', 'mousedown', 'dblclick'];
|
|
3956
3133
|
events.forEach(function (event) {
|
|
3957
3134
|
_this.renderer.listen(_this.htmlElement, event, function (e) {
|
|
3958
|
-
// check if the event is fired from zoom button ( to identify the connected zoom button in engine)
|
|
3959
3135
|
var fromButton = false;
|
|
3960
3136
|
if (_this.htmlElement instanceof HTMLButtonElement)
|
|
3961
3137
|
fromButton = true;
|
|
3962
3138
|
_this.task.insertEvent(engine.getGuiEventObj(event, _this.id, +_this.rowId, fromButton));
|
|
3963
|
-
e.cancelBubble = true;
|
|
3964
3139
|
});
|
|
3965
3140
|
});
|
|
3966
3141
|
this.renderer.listen(this.htmlElement, 'change', function (e) {
|
|
@@ -3971,13 +3146,10 @@
|
|
|
3971
3146
|
_this.task.insertEvent(guiEvent);
|
|
3972
3147
|
}
|
|
3973
3148
|
});
|
|
3974
|
-
// handle the input event
|
|
3975
3149
|
fromEvent.fromEvent(this.htmlElement, 'input').pipe(operators.map(function (event) {
|
|
3976
3150
|
return event.target.value;
|
|
3977
|
-
}), operators.debounceTime(200)
|
|
3978
|
-
).subscribe(function (x) {
|
|
3151
|
+
}), operators.debounceTime(200)).subscribe(function (x) {
|
|
3979
3152
|
if (_this.task.getProperty(_this.id, gui.HtmlProperties.BindingLevel, _this.rowId) === utils$1.BindingLevel.Character) {
|
|
3980
|
-
// Don't support character binding for date/time values
|
|
3981
3153
|
var attribute = _this.task.Records.list[0].getControlMetadata(_this.id).dataType;
|
|
3982
3154
|
if (attribute !== utils$1.StorageAttributeType.Date && attribute != utils$1.StorageAttributeType.Time)
|
|
3983
3155
|
_this.task.mgAccessorService.setValueToControl(_this.id, x, true);
|
|
@@ -4003,25 +3175,16 @@
|
|
|
4003
3175
|
(e.keyCode >= gui.GuiConstants.KEY_F1 && e.keyCode <= gui.GuiConstants.KEY_F12);
|
|
4004
3176
|
if (guiEvent.modifiers !== gui.Modifiers.MODIFIER_NONE || supportedKey) {
|
|
4005
3177
|
guiEvent.keyCode = e.keyCode;
|
|
4006
|
-
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
|
4007
3178
|
if (e.keyCode !== gui.GuiConstants.KEY_ESC || e.keyCode === gui.GuiConstants.KEY_ESC && !MagicDirective.opened)
|
|
4008
3179
|
e.cancelBubble = true;
|
|
4009
3180
|
_this.task.insertEvent(guiEvent);
|
|
4010
3181
|
}
|
|
4011
3182
|
});
|
|
4012
3183
|
};
|
|
4013
|
-
/**
|
|
4014
|
-
* Handle focus event
|
|
4015
|
-
*/
|
|
4016
3184
|
MagicDirective.prototype.OnFocus = function () {
|
|
4017
3185
|
this.task.insertEvent(engine.getGuiEventObj('focus', this.id, +this.rowId));
|
|
4018
3186
|
event.cancelBubble = true;
|
|
4019
3187
|
};
|
|
4020
|
-
/**
|
|
4021
|
-
* Is the command's element the same as this directive's element
|
|
4022
|
-
* @param command
|
|
4023
|
-
* @returns true/false
|
|
4024
|
-
*/
|
|
4025
3188
|
MagicDirective.prototype.IsSameElement = function (command) {
|
|
4026
3189
|
var line = command.line;
|
|
4027
3190
|
if (this.task.isTableControl(command.CtrlName))
|
|
@@ -4030,17 +3193,9 @@
|
|
|
4030
3193
|
(line === +this.rowId ||
|
|
4031
3194
|
(line === 0 && util.isNullOrUndefined(this.rowId))));
|
|
4032
3195
|
};
|
|
4033
|
-
/**
|
|
4034
|
-
* Is the command's element the same as this directive's component
|
|
4035
|
-
* @param command
|
|
4036
|
-
* @returns true/false
|
|
4037
|
-
*/
|
|
4038
3196
|
MagicDirective.prototype.IsSameComponent = function (command) {
|
|
4039
3197
|
return (command.controlName === this.id);
|
|
4040
3198
|
};
|
|
4041
|
-
/**
|
|
4042
|
-
* @ignore
|
|
4043
|
-
*/
|
|
4044
3199
|
MagicDirective.prototype.regUpdatesUI = function () {
|
|
4045
3200
|
var _this = this;
|
|
4046
3201
|
this.subscribeRefreshDom = this.task
|
|
@@ -4063,17 +3218,10 @@
|
|
|
4063
3218
|
_this.handleInteractiveCommands(command);
|
|
4064
3219
|
});
|
|
4065
3220
|
};
|
|
4066
|
-
/**
|
|
4067
|
-
* Initializes this object
|
|
4068
|
-
*/
|
|
4069
3221
|
MagicDirective.prototype.ngOnInit = function () {
|
|
4070
3222
|
this.regEvents();
|
|
4071
3223
|
this.regUpdatesUI();
|
|
4072
3224
|
};
|
|
4073
|
-
/**
|
|
4074
|
-
* Handles the commands received from the Magic WebClient engine
|
|
4075
|
-
* @param command
|
|
4076
|
-
*/
|
|
4077
3225
|
MagicDirective.prototype.handleCommand = function (command) {
|
|
4078
3226
|
switch (command.CommandType) {
|
|
4079
3227
|
case gui.CommandType.SET_PROPERTY:
|
|
@@ -4081,16 +3229,12 @@
|
|
|
4081
3229
|
break;
|
|
4082
3230
|
case gui.CommandType.SET_FOCUS:
|
|
4083
3231
|
this.focusUnlistener();
|
|
4084
|
-
// Do not set focus on connected zoom button
|
|
4085
3232
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
|
4086
3233
|
this.htmlElement.focus();
|
|
4087
3234
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
|
|
4088
3235
|
break;
|
|
4089
3236
|
}
|
|
4090
3237
|
};
|
|
4091
|
-
/**
|
|
4092
|
-
* handle the interactive commands like CallJS
|
|
4093
|
-
*/
|
|
4094
3238
|
MagicDirective.prototype.handleInteractiveCommands = function (command) {
|
|
4095
3239
|
switch (command._commandType) {
|
|
4096
3240
|
case gui.InteractiveCommandType.CALL_JS:
|
|
@@ -4100,24 +3244,18 @@
|
|
|
4100
3244
|
var resultString = '';
|
|
4101
3245
|
try {
|
|
4102
3246
|
if (!util.isNullOrUndefined(magicComponent[methodName])) {
|
|
4103
|
-
// invoke the method on instance of magic componenet
|
|
4104
3247
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
|
4105
3248
|
}
|
|
4106
3249
|
else
|
|
4107
|
-
console.error('Instance method ' + methodName + ' does not exists');
|
|
3250
|
+
console.error('Instance method ' + methodName + ' does not exists');
|
|
4108
3251
|
}
|
|
4109
3252
|
catch (e) {
|
|
4110
|
-
// any other exception
|
|
4111
3253
|
console.error(e.message);
|
|
4112
3254
|
}
|
|
4113
|
-
command.resultString = resultString;
|
|
3255
|
+
command.resultString = resultString;
|
|
4114
3256
|
break;
|
|
4115
3257
|
}
|
|
4116
3258
|
};
|
|
4117
|
-
/**
|
|
4118
|
-
* Handle the Magic set-property command
|
|
4119
|
-
* @param command
|
|
4120
|
-
*/
|
|
4121
3259
|
MagicDirective.prototype.handleSetProperty = function (command) {
|
|
4122
3260
|
switch (command.Operation) {
|
|
4123
3261
|
case gui.HtmlProperties.ReadOnly:
|
|
@@ -4128,18 +3266,15 @@
|
|
|
4128
3266
|
break;
|
|
4129
3267
|
}
|
|
4130
3268
|
};
|
|
4131
|
-
/**
|
|
4132
|
-
* Cleanup
|
|
4133
|
-
*/
|
|
4134
3269
|
MagicDirective.prototype.ngOnDestroy = function () {
|
|
4135
3270
|
this.subscribeRefreshDom.unsubscribe();
|
|
4136
3271
|
};
|
|
4137
3272
|
return MagicDirective;
|
|
4138
3273
|
}());
|
|
4139
3274
|
MagicDirective.opened = false;
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
3275
|
+
MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
3276
|
+
MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
|
|
3277
|
+
(function () {
|
|
4143
3278
|
i0.ɵsetClassMetadata(MagicDirective, [{
|
|
4144
3279
|
type: i0.Directive,
|
|
4145
3280
|
args: [{
|
|
@@ -4160,9 +3295,6 @@
|
|
|
4160
3295
|
}] });
|
|
4161
3296
|
})();
|
|
4162
3297
|
|
|
4163
|
-
/**
|
|
4164
|
-
* @ignore
|
|
4165
|
-
*/
|
|
4166
3298
|
var NoControlMagicDirective = /** @class */ (function (_super) {
|
|
4167
3299
|
__extends(NoControlMagicDirective, _super);
|
|
4168
3300
|
function NoControlMagicDirective(_task, element, renderer, vcRef, magicRow) {
|
|
@@ -4203,12 +3335,10 @@
|
|
|
4203
3335
|
}
|
|
4204
3336
|
}
|
|
4205
3337
|
};
|
|
4206
|
-
// is the div a tab control
|
|
4207
3338
|
NoControlMagicDirective.prototype.isTabControl = function () {
|
|
4208
3339
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
4209
3340
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
|
4210
3341
|
};
|
|
4211
|
-
// is the div a radio buttons wrapper
|
|
4212
3342
|
NoControlMagicDirective.prototype.isRadio = function () {
|
|
4213
3343
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
4214
3344
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
|
@@ -4217,7 +3347,6 @@
|
|
|
4217
3347
|
_super.prototype.handleCommand.call(this, command);
|
|
4218
3348
|
switch (command.CommandType) {
|
|
4219
3349
|
case gui.CommandType.SET_CLASS:
|
|
4220
|
-
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
|
4221
3350
|
var controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
|
4222
3351
|
if (controlMetadata.removedClass != '') {
|
|
4223
3352
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
|
@@ -4230,7 +3359,7 @@
|
|
|
4230
3359
|
this.htmlElement.innerText = command.value;
|
|
4231
3360
|
if (this.htmlElement instanceof HTMLSelectElement)
|
|
4232
3361
|
this.htmlElement.value = command.value;
|
|
4233
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
3362
|
+
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
4234
3363
|
this.htmlElement.text = command.value;
|
|
4235
3364
|
if (this.htmlElement instanceof HTMLInputElement) {
|
|
4236
3365
|
if (this.htmlElement.type === "checkbox") {
|
|
@@ -4254,7 +3383,6 @@
|
|
|
4254
3383
|
break;
|
|
4255
3384
|
}
|
|
4256
3385
|
};
|
|
4257
|
-
// handle set-property commands
|
|
4258
3386
|
NoControlMagicDirective.prototype.handleSetProperty = function (command) {
|
|
4259
3387
|
var e_1, _a;
|
|
4260
3388
|
_super.prototype.handleSetProperty.call(this, command);
|
|
@@ -4271,7 +3399,6 @@
|
|
|
4271
3399
|
break;
|
|
4272
3400
|
case gui.HtmlProperties.ItemsList:
|
|
4273
3401
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
|
4274
|
-
// clear the list
|
|
4275
3402
|
var len = this.htmlElement.length;
|
|
4276
3403
|
for (var i = len - 1; i >= 0; i--) {
|
|
4277
3404
|
this.htmlElement.remove(i);
|
|
@@ -4323,8 +3450,7 @@
|
|
|
4323
3450
|
var child = tabControl.children[i];
|
|
4324
3451
|
var layer = child.getAttribute('layer') - 1;
|
|
4325
3452
|
if (child instanceof HTMLButtonElement) {
|
|
4326
|
-
|
|
4327
|
-
if (layer == command.obj1) { // compare int to string
|
|
3453
|
+
if (layer == command.obj1) {
|
|
4328
3454
|
child.classList.add('tab_button_active');
|
|
4329
3455
|
}
|
|
4330
3456
|
else {
|
|
@@ -4332,7 +3458,6 @@
|
|
|
4332
3458
|
}
|
|
4333
3459
|
}
|
|
4334
3460
|
else {
|
|
4335
|
-
// not a buton - hide unselected tabpages
|
|
4336
3461
|
var style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
|
4337
3462
|
child.setAttribute('style', style);
|
|
4338
3463
|
}
|
|
@@ -4355,9 +3480,9 @@
|
|
|
4355
3480
|
};
|
|
4356
3481
|
return NoControlMagicDirective;
|
|
4357
3482
|
}(MagicDirective));
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
3483
|
+
NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
3484
|
+
NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
3485
|
+
(function () {
|
|
4361
3486
|
i0.ɵsetClassMetadata(NoControlMagicDirective, [{
|
|
4362
3487
|
type: i0.Directive,
|
|
4363
3488
|
args: [{
|
|
@@ -4373,133 +3498,12 @@
|
|
|
4373
3498
|
}] });
|
|
4374
3499
|
})();
|
|
4375
3500
|
|
|
4376
|
-
/**
|
|
4377
|
-
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
|
4378
|
-
*/
|
|
4379
|
-
var RouterContainerMagicComponent = /** @class */ (function () {
|
|
4380
|
-
/**
|
|
4381
|
-
*
|
|
4382
|
-
* @param changeDetectorRef
|
|
4383
|
-
* @param activatedRoute
|
|
4384
|
-
* @param magic
|
|
4385
|
-
* @param componentFactoryResolver
|
|
4386
|
-
* @param viewContainerRef
|
|
4387
|
-
* @param componentList
|
|
4388
|
-
* @param pendingCommandsCollector
|
|
4389
|
-
*/
|
|
4390
|
-
function RouterContainerMagicComponent(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
4391
|
-
this.activatedRoute = activatedRoute;
|
|
4392
|
-
this.magic = magic;
|
|
4393
|
-
this.containerTaskService = containerTaskService;
|
|
4394
|
-
this.componentFactoryResolver = componentFactoryResolver;
|
|
4395
|
-
this.viewContainerRef = viewContainerRef;
|
|
4396
|
-
this.componentList = componentList;
|
|
4397
|
-
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
4398
|
-
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
4399
|
-
this.componentRef = null;
|
|
4400
|
-
this.parentMgSubformService = null;
|
|
4401
|
-
}
|
|
4402
|
-
/**
|
|
4403
|
-
* Initialization
|
|
4404
|
-
*/
|
|
4405
|
-
RouterContainerMagicComponent.prototype.ngOnInit = function () {
|
|
4406
|
-
var outletname = this.activatedRoute.outlet;
|
|
4407
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
4408
|
-
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
4409
|
-
if (subformMagicService == null || subformMagicService.currentRouteDefinition === null) {
|
|
4410
|
-
this.insertRouteEvent(currentActiveRoute);
|
|
4411
|
-
SubformMagicService.routerContainers.push(this);
|
|
4412
|
-
}
|
|
4413
|
-
else {
|
|
4414
|
-
this.initializeComponent();
|
|
4415
|
-
}
|
|
4416
|
-
};
|
|
4417
|
-
RouterContainerMagicComponent.prototype.insertRouteEvent = function (currentActiveRoute) {
|
|
4418
|
-
var guiEvent = engine.getGuiEventObj('RouterNavigate', null, 0);
|
|
4419
|
-
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
4420
|
-
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
4421
|
-
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
|
4422
|
-
// if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
|
|
4423
|
-
// need to take the path form routeConfig.path
|
|
4424
|
-
var calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
4425
|
-
// add the RouterPath only if exist
|
|
4426
|
-
if (calcRouterPath.length > 0) {
|
|
4427
|
-
var routerPath = calcRouterPath;
|
|
4428
|
-
var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
|
|
4429
|
-
guiEvent.RouterPath = tokens[0];
|
|
4430
|
-
guiEvent.RouterParams = new mscorelib.List();
|
|
4431
|
-
for (var i = 1; i < tokens.length; i++) {
|
|
4432
|
-
guiEvent.RouterParams.push(this.activatedRoute.snapshot.params[tokens[i]]);
|
|
4433
|
-
}
|
|
4434
|
-
}
|
|
4435
|
-
this.containerTaskService.insertEvent(guiEvent);
|
|
4436
|
-
};
|
|
4437
|
-
RouterContainerMagicComponent.prototype.initializeComponent = function () {
|
|
4438
|
-
var _this = this;
|
|
4439
|
-
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
|
4440
|
-
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
4441
|
-
if (subformMagicService.currentRouteDefinition !== null) {
|
|
4442
|
-
var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
4443
|
-
var componentFactory = this.componentFactoryResolver.resolveComponentFactory(comp);
|
|
4444
|
-
this.componentRef = this.viewContainerRef.createComponent(componentFactory);
|
|
4445
|
-
Object.assign(this.componentRef.instance, subformMagicService.currentRouteDefinition.parameters);
|
|
4446
|
-
var myActiveRoute_1 = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
4447
|
-
var routeParams = utils$1.StrUtil.tokenize(myActiveRoute_1.snapshot.routeConfig.path, "/:");
|
|
4448
|
-
subformMagicService.routesDict[myActiveRoute_1.snapshot.outlet] = routeParams[0];
|
|
4449
|
-
this.parentMgSubformService = subformMagicService;
|
|
4450
|
-
subformMagicService.currentRouteDefinition = null;
|
|
4451
|
-
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
4452
|
-
//When the component is initialized, then also we get the notification for paramMap subscription.
|
|
4453
|
-
//But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
|
|
4454
|
-
//So, control it via ignoreParamChange flag.
|
|
4455
|
-
var ignoreParamChange_1 = true;
|
|
4456
|
-
myActiveRoute_1.paramMap.subscribe(function (params) {
|
|
4457
|
-
if (!ignoreParamChange_1)
|
|
4458
|
-
_this.insertRouteEvent(myActiveRoute_1);
|
|
4459
|
-
ignoreParamChange_1 = false;
|
|
4460
|
-
});
|
|
4461
|
-
this.parentMgSubformService.refreshView();
|
|
4462
|
-
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
4463
|
-
}
|
|
4464
|
-
};
|
|
4465
|
-
/**
|
|
4466
|
-
* Cleanup
|
|
4467
|
-
*/
|
|
4468
|
-
RouterContainerMagicComponent.prototype.ngOnDestroy = function () {
|
|
4469
|
-
// TODO Routing: Call close() only if the task is not already closed.
|
|
4470
|
-
// Task can be closed when a router is overlayed by another task via call operation.
|
|
4471
|
-
if (this.componentRef != null) {
|
|
4472
|
-
this.componentRef.instance.task.close();
|
|
4473
|
-
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
4474
|
-
this.parentMgSubformService.routesDict[currentActiveRoute.outlet] = "";
|
|
4475
|
-
}
|
|
4476
|
-
};
|
|
4477
|
-
return RouterContainerMagicComponent;
|
|
4478
|
-
}());
|
|
4479
|
-
/** @nocollapse */ RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
|
|
4480
|
-
/** @nocollapse */ RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
4481
|
-
/*@__PURE__*/ (function () {
|
|
4482
|
-
i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
4483
|
-
type: i0.Component,
|
|
4484
|
-
args: [{
|
|
4485
|
-
selector: 'magic-route-outlet',
|
|
4486
|
-
template: "\n "
|
|
4487
|
-
}]
|
|
4488
|
-
}], function () { return [{ type: i2.ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
|
|
4489
|
-
})();
|
|
4490
|
-
|
|
4491
|
-
/**
|
|
4492
|
-
* @ignore
|
|
4493
|
-
*/
|
|
4494
3501
|
var Constants = /** @class */ (function () {
|
|
4495
3502
|
function Constants() {
|
|
4496
3503
|
}
|
|
4497
3504
|
return Constants;
|
|
4498
3505
|
}());
|
|
4499
3506
|
Constants.DATE_FMT = 'dd/MMM/yyyy';
|
|
4500
|
-
/**
|
|
4501
|
-
* @ignore
|
|
4502
|
-
*/
|
|
4503
3507
|
var DateMagicPipe = /** @class */ (function (_super) {
|
|
4504
3508
|
__extends(DateMagicPipe, _super);
|
|
4505
3509
|
function DateMagicPipe(_task) {
|
|
@@ -4513,7 +3517,6 @@
|
|
|
4513
3517
|
var mgDateFormatter = new MgDateFormatter();
|
|
4514
3518
|
if (!util.isNullOrUndefined(value) && mask !== null) {
|
|
4515
3519
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
|
4516
|
-
// If control is label control of table, due to query mode, then save the format here.
|
|
4517
3520
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
|
4518
3521
|
if (this._task.mgInputDateFormat == null)
|
|
4519
3522
|
this._task.mgInputDateFormat = formatStr;
|
|
@@ -4528,9 +3531,9 @@
|
|
|
4528
3531
|
};
|
|
4529
3532
|
return DateMagicPipe;
|
|
4530
3533
|
}(i1.DatePipe));
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
3534
|
+
DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3535
|
+
DateMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
|
3536
|
+
(function () {
|
|
4534
3537
|
i0.ɵsetClassMetadata(DateMagicPipe, [{
|
|
4535
3538
|
type: i0.Pipe,
|
|
4536
3539
|
args: [{
|
|
@@ -4599,18 +3602,12 @@
|
|
|
4599
3602
|
return formatStr.ToString();
|
|
4600
3603
|
}
|
|
4601
3604
|
else
|
|
4602
|
-
return "dd-mm-yyyy";
|
|
3605
|
+
return "dd-mm-yyyy";
|
|
4603
3606
|
};
|
|
4604
3607
|
return MgDateFormatter;
|
|
4605
3608
|
}());
|
|
4606
3609
|
|
|
4607
|
-
/**
|
|
4608
|
-
* Perform Magic validation on input controls which hold alphanumeric strings
|
|
4609
|
-
*/
|
|
4610
3610
|
var MgformatMagicDirective = /** @class */ (function () {
|
|
4611
|
-
/**
|
|
4612
|
-
* @ignore
|
|
4613
|
-
*/
|
|
4614
3611
|
function MgformatMagicDirective(magicDir, _task) {
|
|
4615
3612
|
this.magicDir = magicDir;
|
|
4616
3613
|
this._task = _task;
|
|
@@ -4618,20 +3615,12 @@
|
|
|
4618
3615
|
MgformatMagicDirective.prototype.ngAfterViewInit = function () {
|
|
4619
3616
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4620
3617
|
if (control != null && this._task.mgInputDateFormat == null) {
|
|
4621
|
-
// get the first date control's format.
|
|
4622
3618
|
var pic = this._task.GetControlPictureMask(this.magicDir.id);
|
|
4623
3619
|
if (pic.getAttr() == utils$1.StorageAttribute.DATE) {
|
|
4624
3620
|
this.formatDate(pic);
|
|
4625
3621
|
}
|
|
4626
3622
|
}
|
|
4627
3623
|
};
|
|
4628
|
-
/**
|
|
4629
|
-
* @ignore
|
|
4630
|
-
*/
|
|
4631
|
-
/**
|
|
4632
|
-
* This can be used to set pattern
|
|
4633
|
-
* On input, verifies the input matches the required mask
|
|
4634
|
-
*/
|
|
4635
3624
|
MgformatMagicDirective.prototype.onFocusEvent = function ($event) {
|
|
4636
3625
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4637
3626
|
if (control != null) {
|
|
@@ -4656,10 +3645,6 @@
|
|
|
4656
3645
|
}
|
|
4657
3646
|
}
|
|
4658
3647
|
};
|
|
4659
|
-
/**
|
|
4660
|
-
* @ignore
|
|
4661
|
-
*/
|
|
4662
|
-
// This can be used to implement uppercase/lower case
|
|
4663
3648
|
MgformatMagicDirective.prototype.onChangeEvent = function ($event) {
|
|
4664
3649
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4665
3650
|
var attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
@@ -4677,9 +3662,6 @@
|
|
|
4677
3662
|
var mgDateFormatter = new MgDateFormatter();
|
|
4678
3663
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
|
4679
3664
|
};
|
|
4680
|
-
/**
|
|
4681
|
-
* @ignore
|
|
4682
|
-
*/
|
|
4683
3665
|
MgformatMagicDirective.prototype.formatAlphaUnicode = function (control) {
|
|
4684
3666
|
var value = control.value;
|
|
4685
3667
|
if (value !== null && value.length > 0) {
|
|
@@ -4705,9 +3687,6 @@
|
|
|
4705
3687
|
control.setValue(valueStr.ToString());
|
|
4706
3688
|
}
|
|
4707
3689
|
};
|
|
4708
|
-
/**
|
|
4709
|
-
* @ignore
|
|
4710
|
-
*/
|
|
4711
3690
|
MgformatMagicDirective.prototype.formatBoolean = function (control) {
|
|
4712
3691
|
var value = control.value;
|
|
4713
3692
|
if (value !== null && value.length > 0) {
|
|
@@ -4720,12 +3699,6 @@
|
|
|
4720
3699
|
}
|
|
4721
3700
|
}
|
|
4722
3701
|
};
|
|
4723
|
-
/**
|
|
4724
|
-
* @ignore
|
|
4725
|
-
*/
|
|
4726
|
-
/// <summary>
|
|
4727
|
-
/// generate pattern from fld's format
|
|
4728
|
-
/// </summary>
|
|
4729
3702
|
MgformatMagicDirective.prototype.generatePattern = function (attribute, pic) {
|
|
4730
3703
|
var pattern = "";
|
|
4731
3704
|
switch (attribute) {
|
|
@@ -4739,12 +3712,6 @@
|
|
|
4739
3712
|
}
|
|
4740
3713
|
return pattern;
|
|
4741
3714
|
};
|
|
4742
|
-
/**
|
|
4743
|
-
* @ignore
|
|
4744
|
-
*/
|
|
4745
|
-
/// <summary>
|
|
4746
|
-
/// generate pattern for Alpha
|
|
4747
|
-
/// </summary>
|
|
4748
3715
|
MgformatMagicDirective.prototype.generatePatternForNumber = function (pic) {
|
|
4749
3716
|
var patternStr = new mscorelib.StringBuilder();
|
|
4750
3717
|
patternStr.Append("^");
|
|
@@ -4757,9 +3724,6 @@
|
|
|
4757
3724
|
patternStr.Append("$");
|
|
4758
3725
|
return patternStr.ToString();
|
|
4759
3726
|
};
|
|
4760
|
-
/**
|
|
4761
|
-
* @ignore
|
|
4762
|
-
*/
|
|
4763
3727
|
MgformatMagicDirective.prototype.isPatternGenerationNeeded = function (attr, pic) {
|
|
4764
3728
|
switch (attr) {
|
|
4765
3729
|
case utils$1.StorageAttribute.NUMERIC:
|
|
@@ -4769,12 +3733,6 @@
|
|
|
4769
3733
|
return (pic.getMaskChars() > 0) ? true : false;
|
|
4770
3734
|
}
|
|
4771
3735
|
};
|
|
4772
|
-
/**
|
|
4773
|
-
* @ignore
|
|
4774
|
-
*/
|
|
4775
|
-
/// <summary>
|
|
4776
|
-
/// generate pattern for Alpha
|
|
4777
|
-
/// </summary>
|
|
4778
3736
|
MgformatMagicDirective.prototype.generatePatternForAlpha = function (pic) {
|
|
4779
3737
|
var cnt = 0;
|
|
4780
3738
|
var inputAllChars = false;
|
|
@@ -4785,7 +3743,6 @@
|
|
|
4785
3743
|
var pattern = new mscorelib.StringBuilder();
|
|
4786
3744
|
pattern.Append("^");
|
|
4787
3745
|
for (var i = 0; i < mask.length;) {
|
|
4788
|
-
//start new subset , if mask[i] is one of these.
|
|
4789
3746
|
if (inputAllChars && (mask.charCodeAt(i) == utils$1.PICInterface.PIC_N || mask.charCodeAt(i) == utils$1.PICInterface.PIC_U || mask.charCodeAt(i) == utils$1.PICInterface.PIC_L
|
|
4790
3747
|
|| mask.charCodeAt(i) == utils$1.PICInterface.PIC_X)) {
|
|
4791
3748
|
pattern.Append("(");
|
|
@@ -4831,13 +3788,9 @@
|
|
|
4831
3788
|
pattern.Append("$");
|
|
4832
3789
|
return pattern.ToString();
|
|
4833
3790
|
};
|
|
4834
|
-
/**
|
|
4835
|
-
* @ignore
|
|
4836
|
-
*/
|
|
4837
3791
|
MgformatMagicDirective.prototype.getDirectiveCount = function (mask, idx, pattern, changeInPattern) {
|
|
4838
3792
|
changeInPattern.value = false;
|
|
4839
3793
|
var patternCount = 0;
|
|
4840
|
-
// find max chars
|
|
4841
3794
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
|
4842
3795
|
patternCount++;
|
|
4843
3796
|
idx++;
|
|
@@ -4846,9 +3799,6 @@
|
|
|
4846
3799
|
changeInPattern.value = true;
|
|
4847
3800
|
return patternCount;
|
|
4848
3801
|
};
|
|
4849
|
-
/**
|
|
4850
|
-
* @ignore
|
|
4851
|
-
*/
|
|
4852
3802
|
MgformatMagicDirective.prototype.IsPatternMatches = function (mask, pattern) {
|
|
4853
3803
|
for (var i = 0; i < pattern.length; i++)
|
|
4854
3804
|
if (mask == pattern[i])
|
|
@@ -4857,13 +3807,13 @@
|
|
|
4857
3807
|
};
|
|
4858
3808
|
return MgformatMagicDirective;
|
|
4859
3809
|
}());
|
|
4860
|
-
|
|
4861
|
-
|
|
3810
|
+
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3811
|
+
MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
|
|
4862
3812
|
if (rf & 1) {
|
|
4863
3813
|
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
|
4864
3814
|
}
|
|
4865
3815
|
} });
|
|
4866
|
-
|
|
3816
|
+
(function () {
|
|
4867
3817
|
i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
|
4868
3818
|
type: i0.Directive,
|
|
4869
3819
|
args: [{
|
|
@@ -4878,9 +3828,6 @@
|
|
|
4878
3828
|
}] });
|
|
4879
3829
|
})();
|
|
4880
3830
|
|
|
4881
|
-
/**
|
|
4882
|
-
* @ignore
|
|
4883
|
-
*/
|
|
4884
3831
|
var TimeMagicPipe = /** @class */ (function (_super) {
|
|
4885
3832
|
__extends(TimeMagicPipe, _super);
|
|
4886
3833
|
function TimeMagicPipe(_task) {
|
|
@@ -4919,9 +3866,9 @@
|
|
|
4919
3866
|
};
|
|
4920
3867
|
return TimeMagicPipe;
|
|
4921
3868
|
}(i1.DatePipe));
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
3869
|
+
TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3870
|
+
TimeMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
|
3871
|
+
(function () {
|
|
4925
3872
|
i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
|
4926
3873
|
type: i0.Pipe,
|
|
4927
3874
|
args: [{
|
|
@@ -4930,24 +3877,11 @@
|
|
|
4930
3877
|
}], function () { return [{ type: TaskMagicService }]; }, null);
|
|
4931
3878
|
})();
|
|
4932
3879
|
|
|
4933
|
-
/**
|
|
4934
|
-
* Validates the field range.
|
|
4935
|
-
*/
|
|
4936
3880
|
var RangeValidatorMagicDirective = /** @class */ (function () {
|
|
4937
|
-
/**
|
|
4938
|
-
*
|
|
4939
|
-
* @param _task The task service
|
|
4940
|
-
* @param vcRef
|
|
4941
|
-
*/
|
|
4942
3881
|
function RangeValidatorMagicDirective(_task, vcRef) {
|
|
4943
3882
|
this._task = _task;
|
|
4944
3883
|
this.vcRef = vcRef;
|
|
4945
3884
|
}
|
|
4946
|
-
/**
|
|
4947
|
-
* Validation method
|
|
4948
|
-
* @param c FormControl to validate
|
|
4949
|
-
* @returns If validation fails, return error message, else returns null
|
|
4950
|
-
*/
|
|
4951
3885
|
RangeValidatorMagicDirective.prototype.validate = function (c) {
|
|
4952
3886
|
var controlName;
|
|
4953
3887
|
controlName = this.getControlName(c);
|
|
@@ -4969,24 +3903,21 @@
|
|
|
4969
3903
|
};
|
|
4970
3904
|
}
|
|
4971
3905
|
};
|
|
4972
|
-
/**
|
|
4973
|
-
* @ignore
|
|
4974
|
-
*/
|
|
4975
3906
|
RangeValidatorMagicDirective.prototype.getControlName = function (c) {
|
|
4976
3907
|
var formGroup = c.parent.controls;
|
|
4977
3908
|
return Object.keys(formGroup).find(function (name) { return c === formGroup[name]; }) || null;
|
|
4978
3909
|
};
|
|
4979
3910
|
return RangeValidatorMagicDirective;
|
|
4980
3911
|
}());
|
|
4981
|
-
|
|
4982
|
-
|
|
3912
|
+
RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
|
3913
|
+
RangeValidatorMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
|
|
4983
3914
|
{
|
|
4984
3915
|
provide: forms.NG_VALIDATORS,
|
|
4985
3916
|
useExisting: RangeValidatorMagicDirective,
|
|
4986
3917
|
multi: true,
|
|
4987
3918
|
}
|
|
4988
3919
|
])] });
|
|
4989
|
-
|
|
3920
|
+
(function () {
|
|
4990
3921
|
i0.ɵsetClassMetadata(RangeValidatorMagicDirective, [{
|
|
4991
3922
|
type: i0.Directive,
|
|
4992
3923
|
args: [{
|
|
@@ -5011,36 +3942,20 @@
|
|
|
5011
3942
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
|
5012
3943
|
}
|
|
5013
3944
|
}
|
|
5014
|
-
/**
|
|
5015
|
-
* Represents a Magic subform
|
|
5016
|
-
*/
|
|
5017
3945
|
var SubformMagicComponent = /** @class */ (function () {
|
|
5018
|
-
/**
|
|
5019
|
-
* @ignore
|
|
5020
|
-
*/
|
|
5021
3946
|
function SubformMagicComponent(vcRef, mgSub) {
|
|
5022
3947
|
this.vcRef = vcRef;
|
|
5023
3948
|
this.mgSub = mgSub;
|
|
5024
|
-
/**
|
|
5025
|
-
* @ignore
|
|
5026
|
-
*/
|
|
5027
3949
|
this.component = null;
|
|
5028
|
-
// For angular 10 - find the component from views
|
|
5029
3950
|
this.component = (this.vcRef._hostView).find(function (v) { return !util.isNullOrUndefined(v); });
|
|
5030
3951
|
}
|
|
5031
3952
|
Object.defineProperty(SubformMagicComponent.prototype, "magic", {
|
|
5032
|
-
/**
|
|
5033
|
-
* @ignore
|
|
5034
|
-
*/
|
|
5035
3953
|
set: function (val) { this.id = val; },
|
|
5036
3954
|
enumerable: false,
|
|
5037
3955
|
configurable: true
|
|
5038
3956
|
});
|
|
5039
3957
|
;
|
|
5040
3958
|
Object.defineProperty(SubformMagicComponent.prototype, "Component", {
|
|
5041
|
-
/**
|
|
5042
|
-
* @ignore
|
|
5043
|
-
*/
|
|
5044
3959
|
get: function () {
|
|
5045
3960
|
return this.mgSub.mgGetComp(this.id);
|
|
5046
3961
|
},
|
|
@@ -5048,9 +3963,6 @@
|
|
|
5048
3963
|
configurable: true
|
|
5049
3964
|
});
|
|
5050
3965
|
Object.defineProperty(SubformMagicComponent.prototype, "Parameters", {
|
|
5051
|
-
/**
|
|
5052
|
-
* @ignore
|
|
5053
|
-
*/
|
|
5054
3966
|
get: function () {
|
|
5055
3967
|
return this.mgSub.mgGetParameters(this.id);
|
|
5056
3968
|
},
|
|
@@ -5059,8 +3971,8 @@
|
|
|
5059
3971
|
});
|
|
5060
3972
|
return SubformMagicComponent;
|
|
5061
3973
|
}());
|
|
5062
|
-
|
|
5063
|
-
|
|
3974
|
+
SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
|
|
3975
|
+
SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) {
|
|
5064
3976
|
if (rf & 1) {
|
|
5065
3977
|
i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
|
5066
3978
|
}
|
|
@@ -5068,7 +3980,7 @@
|
|
|
5068
3980
|
i0.ɵɵproperty("ngIf", ctx.Component);
|
|
5069
3981
|
}
|
|
5070
3982
|
}, directives: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
|
|
5071
|
-
|
|
3983
|
+
(function () {
|
|
5072
3984
|
i0.ɵsetClassMetadata(SubformMagicComponent, [{
|
|
5073
3985
|
type: i0.Component,
|
|
5074
3986
|
args: [{
|
|
@@ -5110,25 +4022,15 @@
|
|
|
5110
4022
|
}
|
|
5111
4023
|
}
|
|
5112
4024
|
var _c1$1 = ["*"];
|
|
5113
|
-
/**
|
|
5114
|
-
* Represents a Magic subform
|
|
5115
|
-
*/
|
|
5116
4025
|
var ErrorMagicComponent = /** @class */ (function () {
|
|
5117
|
-
/**
|
|
5118
|
-
* @ignore
|
|
5119
|
-
*/
|
|
5120
4026
|
function ErrorMagicComponent(_task, mgService, changeDetectorRef) {
|
|
5121
4027
|
this._task = _task;
|
|
5122
4028
|
this.mgService = mgService;
|
|
5123
4029
|
this.changeDetectorRef = changeDetectorRef;
|
|
5124
|
-
// if true - display standard magic error message, if false - customer has provides his own content and we'll use it
|
|
5125
4030
|
this.defaultDisplay = true;
|
|
5126
4031
|
this.rowId = "0";
|
|
5127
4032
|
}
|
|
5128
4033
|
Object.defineProperty(ErrorMagicComponent.prototype, "magic", {
|
|
5129
|
-
/**
|
|
5130
|
-
* @ignore
|
|
5131
|
-
*/
|
|
5132
4034
|
set: function (val) {
|
|
5133
4035
|
this.id = val;
|
|
5134
4036
|
},
|
|
@@ -5153,10 +4055,6 @@
|
|
|
5153
4055
|
configurable: true
|
|
5154
4056
|
});
|
|
5155
4057
|
;
|
|
5156
|
-
/**
|
|
5157
|
-
* returns true if the html element has no children
|
|
5158
|
-
* @param element
|
|
5159
|
-
*/
|
|
5160
4058
|
ErrorMagicComponent.prototype.isEmpty = function (element) {
|
|
5161
4059
|
var nodes = element.childNodes;
|
|
5162
4060
|
for (var i = 0; i < nodes.length; i++) {
|
|
@@ -5167,9 +4065,6 @@
|
|
|
5167
4065
|
}
|
|
5168
4066
|
return true;
|
|
5169
4067
|
};
|
|
5170
|
-
/**
|
|
5171
|
-
* @ignore
|
|
5172
|
-
*/
|
|
5173
4068
|
ErrorMagicComponent.prototype.HasErrors = function (id) {
|
|
5174
4069
|
var e_1, _a;
|
|
5175
4070
|
if (!util.isUndefined(id)) {
|
|
@@ -5203,8 +4098,8 @@
|
|
|
5203
4098
|
};
|
|
5204
4099
|
return ErrorMagicComponent;
|
|
5205
4100
|
}());
|
|
5206
|
-
|
|
5207
|
-
|
|
4101
|
+
ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
4102
|
+
ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) {
|
|
5208
4103
|
if (rf & 1) {
|
|
5209
4104
|
i0.ɵɵviewQuery(_c0$2, true);
|
|
5210
4105
|
}
|
|
@@ -5221,7 +4116,7 @@
|
|
|
5221
4116
|
i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
|
5222
4117
|
}
|
|
5223
4118
|
}, directives: [i1.NgIf], encapsulation: 2 });
|
|
5224
|
-
|
|
4119
|
+
(function () {
|
|
5225
4120
|
i0.ɵsetClassMetadata(ErrorMagicComponent, [{
|
|
5226
4121
|
type: i0.Component,
|
|
5227
4122
|
args: [{
|
|
@@ -5240,31 +4135,22 @@
|
|
|
5240
4135
|
}] });
|
|
5241
4136
|
})();
|
|
5242
4137
|
|
|
5243
|
-
/**
|
|
5244
|
-
* Directive for checkboxes, to handle the 'change' event
|
|
5245
|
-
*/
|
|
5246
4138
|
var CheckboxMagicDirective = /** @class */ (function () {
|
|
5247
|
-
/**
|
|
5248
|
-
* @ignore
|
|
5249
|
-
*/
|
|
5250
4139
|
function CheckboxMagicDirective(magicDirective) {
|
|
5251
4140
|
this.magicDirective = magicDirective;
|
|
5252
4141
|
}
|
|
5253
|
-
/**
|
|
5254
|
-
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
|
5255
|
-
*/
|
|
5256
4142
|
CheckboxMagicDirective.prototype.onChange = function ($event) {
|
|
5257
4143
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5258
4144
|
};
|
|
5259
4145
|
return CheckboxMagicDirective;
|
|
5260
4146
|
}());
|
|
5261
|
-
|
|
5262
|
-
|
|
4147
|
+
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4148
|
+
CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) {
|
|
5263
4149
|
if (rf & 1) {
|
|
5264
4150
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5265
4151
|
}
|
|
5266
4152
|
} });
|
|
5267
|
-
|
|
4153
|
+
(function () {
|
|
5268
4154
|
i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
|
5269
4155
|
type: i0.Directive,
|
|
5270
4156
|
args: [{
|
|
@@ -5276,28 +4162,22 @@
|
|
|
5276
4162
|
}] });
|
|
5277
4163
|
})();
|
|
5278
4164
|
|
|
5279
|
-
/**
|
|
5280
|
-
* Directive for comboboxes, to handle the 'change' event
|
|
5281
|
-
*/
|
|
5282
4165
|
var ComboboxMagicDirective = /** @class */ (function () {
|
|
5283
4166
|
function ComboboxMagicDirective(magicDirective) {
|
|
5284
4167
|
this.magicDirective = magicDirective;
|
|
5285
4168
|
}
|
|
5286
|
-
/**
|
|
5287
|
-
* Handles the Combobox 'change' event - pass it to the Magic engine
|
|
5288
|
-
*/
|
|
5289
4169
|
ComboboxMagicDirective.prototype.onChange = function ($event) {
|
|
5290
4170
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5291
4171
|
};
|
|
5292
4172
|
return ComboboxMagicDirective;
|
|
5293
4173
|
}());
|
|
5294
|
-
|
|
5295
|
-
|
|
4174
|
+
ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4175
|
+
ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) {
|
|
5296
4176
|
if (rf & 1) {
|
|
5297
4177
|
i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5298
4178
|
}
|
|
5299
4179
|
} });
|
|
5300
|
-
|
|
4180
|
+
(function () {
|
|
5301
4181
|
i0.ɵsetClassMetadata(ComboboxMagicDirective, [{
|
|
5302
4182
|
type: i0.Directive,
|
|
5303
4183
|
args: [{
|
|
@@ -5309,23 +4189,17 @@
|
|
|
5309
4189
|
}] });
|
|
5310
4190
|
})();
|
|
5311
4191
|
|
|
5312
|
-
/**
|
|
5313
|
-
* This service supports custom actions on magic exit
|
|
5314
|
-
*/
|
|
5315
4192
|
var ExitMagicService = /** @class */ (function () {
|
|
5316
4193
|
function ExitMagicService() {
|
|
5317
4194
|
}
|
|
5318
|
-
/**
|
|
5319
|
-
* Override this method to implement custom logic on magic exit
|
|
5320
|
-
*/
|
|
5321
4195
|
ExitMagicService.prototype.exitMagic = function () {
|
|
5322
4196
|
console.log("Magic application terminated");
|
|
5323
4197
|
};
|
|
5324
4198
|
return ExitMagicService;
|
|
5325
4199
|
}());
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
4200
|
+
ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
|
|
4201
|
+
ExitMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
|
4202
|
+
(function () {
|
|
5329
4203
|
i0.ɵsetClassMetadata(ExitMagicService, [{
|
|
5330
4204
|
type: i0.Injectable
|
|
5331
4205
|
}], null, null);
|
|
@@ -5359,19 +4233,7 @@
|
|
|
5359
4233
|
i0.ɵɵelement(0, "div", 9);
|
|
5360
4234
|
}
|
|
5361
4235
|
}
|
|
5362
|
-
/**
|
|
5363
|
-
* Root Magic component
|
|
5364
|
-
*/
|
|
5365
4236
|
var MagicShellComponent = /** @class */ (function () {
|
|
5366
|
-
/**
|
|
5367
|
-
*
|
|
5368
|
-
* @param magic Magic's service
|
|
5369
|
-
* @param componentList Magic component list
|
|
5370
|
-
* @param changeDetectorRef Changes detector
|
|
5371
|
-
* @param titleService Title setting service
|
|
5372
|
-
* @param httpClient The native httpClient instance
|
|
5373
|
-
* @param exitMagicService Magic exit service
|
|
5374
|
-
*/
|
|
5375
4237
|
function MagicShellComponent(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
|
|
5376
4238
|
this.engineMagicService = engineMagicService;
|
|
5377
4239
|
this.componentList = componentList;
|
|
@@ -5381,32 +4243,22 @@
|
|
|
5381
4243
|
this.httpClient = httpClient;
|
|
5382
4244
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
5383
4245
|
this.exitMagicService = exitMagicService;
|
|
5384
|
-
/**
|
|
5385
|
-
* Root component to be displayed in the window
|
|
5386
|
-
*/
|
|
5387
4246
|
this.RootComponent = null;
|
|
5388
4247
|
this.magicEngineTerminated = false;
|
|
5389
4248
|
this.initialize();
|
|
5390
4249
|
this.setTitle();
|
|
5391
4250
|
}
|
|
5392
|
-
/**
|
|
5393
|
-
* Before-unload event listener
|
|
5394
|
-
* @param event
|
|
5395
|
-
*/
|
|
5396
4251
|
MagicShellComponent.prototype.onBeforeUnload = function (event) {
|
|
5397
4252
|
if (this.engineMagicService.TransCacheExists()) {
|
|
5398
|
-
// Show the confirmation box before unloading the browser
|
|
5399
4253
|
event.returnValue = 'Are you sure?';
|
|
5400
4254
|
return 'Are you sure?';
|
|
5401
4255
|
}
|
|
5402
4256
|
else {
|
|
5403
|
-
// terminate the magic server context using fetch API with keep-alive
|
|
5404
4257
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
5405
4258
|
this.magicEngineTerminated = true;
|
|
5406
4259
|
}
|
|
5407
4260
|
};
|
|
5408
4261
|
MagicShellComponent.prototype.onUnload = function (event) {
|
|
5409
|
-
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
|
5410
4262
|
if (!this.magicEngineTerminated)
|
|
5411
4263
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
5412
4264
|
};
|
|
@@ -5417,26 +4269,13 @@
|
|
|
5417
4269
|
MagicShellComponent.prototype.setViewContainerRef = function (vcRef) {
|
|
5418
4270
|
this.overlayWindowsContainerViewRef = vcRef;
|
|
5419
4271
|
};
|
|
5420
|
-
/**
|
|
5421
|
-
* Initialization of Magic mechanisms
|
|
5422
|
-
*/
|
|
5423
4272
|
MagicShellComponent.prototype.initialize = function () {
|
|
5424
4273
|
this.registerUICommands();
|
|
5425
4274
|
};
|
|
5426
|
-
/**
|
|
5427
|
-
* Set the title
|
|
5428
|
-
*/
|
|
5429
4275
|
MagicShellComponent.prototype.setTitle = function () {
|
|
5430
4276
|
var newTitle = this.componentList.title;
|
|
5431
4277
|
this.titleService.setTitle(newTitle);
|
|
5432
4278
|
};
|
|
5433
|
-
/**
|
|
5434
|
-
* Set the component according to requested form
|
|
5435
|
-
* @param formName Name of the form to open
|
|
5436
|
-
* @param taskId Id of opening task
|
|
5437
|
-
* @param taskDescription TODO
|
|
5438
|
-
* @param isModal whether modal window is being opened
|
|
5439
|
-
*/
|
|
5440
4279
|
MagicShellComponent.prototype.setComponent = function (formName, taskId, taskDescription, isModal) {
|
|
5441
4280
|
this.pendingCommandsCollector.startCollecting();
|
|
5442
4281
|
if (isModal) {
|
|
@@ -5448,9 +4287,6 @@
|
|
|
5448
4287
|
}
|
|
5449
4288
|
this.changeDetectorRef.detectChanges();
|
|
5450
4289
|
};
|
|
5451
|
-
/**
|
|
5452
|
-
* @ignore
|
|
5453
|
-
*/
|
|
5454
4290
|
MagicShellComponent.prototype.registerUICommands = function () {
|
|
5455
4291
|
var _this = this;
|
|
5456
4292
|
this.engineMagicService.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === '0'; }))
|
|
@@ -5463,10 +4299,6 @@
|
|
|
5463
4299
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, _this.overlayWindowService);
|
|
5464
4300
|
});
|
|
5465
4301
|
};
|
|
5466
|
-
/**
|
|
5467
|
-
* Execute commands received from the Magic WebClient engine
|
|
5468
|
-
* @param command
|
|
5469
|
-
*/
|
|
5470
4302
|
MagicShellComponent.prototype.executeCommand = function (command) {
|
|
5471
4303
|
switch (command.CommandType) {
|
|
5472
4304
|
case gui.CommandType.OPEN_FORM:
|
|
@@ -5481,7 +4313,7 @@
|
|
|
5481
4313
|
this.RootComponentParameters = {};
|
|
5482
4314
|
this.changeDetectorRef.detectChanges();
|
|
5483
4315
|
}
|
|
5484
|
-
else {
|
|
4316
|
+
else {
|
|
5485
4317
|
this.overlayWindowService.close(command.str);
|
|
5486
4318
|
this.changeDetectorRef.detectChanges();
|
|
5487
4319
|
}
|
|
@@ -5499,12 +4331,15 @@
|
|
|
5499
4331
|
if (this.exitMagicService)
|
|
5500
4332
|
this.exitMagicService.exitMagic();
|
|
5501
4333
|
break;
|
|
4334
|
+
case gui.CommandType.SHOW_HTML_ERROR:
|
|
4335
|
+
window.document.write(command.str);
|
|
4336
|
+
break;
|
|
5502
4337
|
}
|
|
5503
4338
|
};
|
|
5504
4339
|
return MagicShellComponent;
|
|
5505
4340
|
}());
|
|
5506
|
-
|
|
5507
|
-
|
|
4341
|
+
MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i5.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
|
|
4342
|
+
MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) {
|
|
5508
4343
|
if (rf & 1) {
|
|
5509
4344
|
i0.ɵɵstaticViewQuery(_c0$3, true);
|
|
5510
4345
|
}
|
|
@@ -5516,9 +4351,7 @@
|
|
|
5516
4351
|
if (rf & 1) {
|
|
5517
4352
|
i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, i0.ɵɵresolveWindow);
|
|
5518
4353
|
}
|
|
5519
|
-
}, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([
|
|
5520
|
-
// ExitMagicService
|
|
5521
|
-
])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) {
|
|
4354
|
+
}, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) {
|
|
5522
4355
|
if (rf & 1) {
|
|
5523
4356
|
i0.ɵɵelementStart(0, "div", null, 0);
|
|
5524
4357
|
i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
|
|
@@ -5534,14 +4367,12 @@
|
|
|
5534
4367
|
i0.ɵɵproperty("ngIf", ctx.showSpinner);
|
|
5535
4368
|
}
|
|
5536
4369
|
}, directives: [i1.NgIf, MagicViewContainerRef, i3.DynamicComponent, i3.DynamicIoDirective, i1.NgTemplateOutlet], styles: [".mgSpinnerClass[_ngcontent-%COMP%] {\n border: 10px solid #cccccc; \n border-top: 10px solid black; \n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"] });
|
|
5537
|
-
|
|
4370
|
+
(function () {
|
|
5538
4371
|
i0.ɵsetClassMetadata(MagicShellComponent, [{
|
|
5539
4372
|
type: i0.Component,
|
|
5540
4373
|
args: [{
|
|
5541
4374
|
selector: 'magic-root',
|
|
5542
|
-
providers: [
|
|
5543
|
-
// ExitMagicService
|
|
5544
|
-
],
|
|
4375
|
+
providers: [],
|
|
5545
4376
|
template: "\n <div #magicRoot>\n <ndc-dynamic\n *ngIf = \"RootComponent !== null\"\n [ndcDynamicComponent]=\"RootComponent\"\n [ndcDynamicInputs] =\"RootComponentParameters\">\n </ndc-dynamic>\n\n <div #overlayWindowsContainer magicViewContainerRef>\n </div>\n </div>\n\n <div class=\"spinner-background\" *ngIf=\"showSpinner\">\n <ng-container [ngTemplateOutlet]=\"SpinnerTemplate ? SpinnerTemplate:defaultSpinner\"></ng-container>\n </div>\n\n <ng-template #defaultSpinner>\n <div class=\"mgSpinnerClass\"></div>\n </ng-template>\n ",
|
|
5546
4377
|
styles: ["\n .mgSpinnerClass {\n border: 10px solid #cccccc; /* Light grey */\n border-top: 10px solid black; /* Blue */\n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background {\n /* background fixed across whole screen */\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "]
|
|
5547
4378
|
}]
|
|
@@ -5563,17 +4394,11 @@
|
|
|
5563
4394
|
}] });
|
|
5564
4395
|
})();
|
|
5565
4396
|
|
|
5566
|
-
/**
|
|
5567
|
-
* @ignore
|
|
5568
|
-
*/
|
|
5569
4397
|
var CHECKBOX_VALUE_ACCESSOR = {
|
|
5570
4398
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
5571
4399
|
useExisting: i0.forwardRef(function () { return MagicCheckboxControlValueAccessor; }),
|
|
5572
4400
|
multi: true,
|
|
5573
4401
|
};
|
|
5574
|
-
/**
|
|
5575
|
-
* Value accessor for Checkbox without a FormControl
|
|
5576
|
-
*/
|
|
5577
4402
|
var MagicCheckboxControlValueAccessor = /** @class */ (function (_super) {
|
|
5578
4403
|
__extends(MagicCheckboxControlValueAccessor, _super);
|
|
5579
4404
|
function MagicCheckboxControlValueAccessor() {
|
|
@@ -5581,14 +4406,14 @@
|
|
|
5581
4406
|
}
|
|
5582
4407
|
return MagicCheckboxControlValueAccessor;
|
|
5583
4408
|
}(forms.CheckboxControlValueAccessor));
|
|
5584
|
-
|
|
5585
|
-
|
|
4409
|
+
MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
|
|
4410
|
+
MagicCheckboxControlValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: MagicCheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "magic", "", 3, "formControlName", "", 3, "no-form-control", ""], ["input", "type", "checkbox", "magic", "", 3, "formControl", ""], ["input", "type", "checkbox", "magic", "", 3, "ngModel", ""]], hostBindings: function MagicCheckboxControlValueAccessor_HostBindings(rf, ctx) {
|
|
5586
4411
|
if (rf & 1) {
|
|
5587
4412
|
i0.ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5588
4413
|
}
|
|
5589
4414
|
}, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
5590
|
-
var ɵMagicCheckboxControlValueAccessor_BaseFactory =
|
|
5591
|
-
|
|
4415
|
+
var ɵMagicCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
|
|
4416
|
+
(function () {
|
|
5592
4417
|
i0.ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
|
5593
4418
|
type: i0.Directive,
|
|
5594
4419
|
args: [{
|
|
@@ -5599,17 +4424,11 @@
|
|
|
5599
4424
|
}], null, null);
|
|
5600
4425
|
})();
|
|
5601
4426
|
|
|
5602
|
-
/**
|
|
5603
|
-
* @ignore
|
|
5604
|
-
*/
|
|
5605
4427
|
var MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
|
5606
4428
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
5607
4429
|
useExisting: i0.forwardRef(function () { return MagicDefaultValueAccessor; }),
|
|
5608
4430
|
multi: true
|
|
5609
4431
|
};
|
|
5610
|
-
/**
|
|
5611
|
-
* @ignore
|
|
5612
|
-
*/
|
|
5613
4432
|
var MagicDefaultValueAccessor = /** @class */ (function (_super) {
|
|
5614
4433
|
__extends(MagicDefaultValueAccessor, _super);
|
|
5615
4434
|
function MagicDefaultValueAccessor() {
|
|
@@ -5617,14 +4436,14 @@
|
|
|
5617
4436
|
}
|
|
5618
4437
|
return MagicDefaultValueAccessor;
|
|
5619
4438
|
}(forms.DefaultValueAccessor));
|
|
5620
|
-
|
|
5621
|
-
|
|
4439
|
+
MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
|
|
4440
|
+
MagicDefaultValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: MagicDefaultValueAccessor, selectors: [["input", "magic", "", 3, "type", "checkbox", 3, "formControlName", "", 3, "no-form-control", ""], ["textarea", "magic", "", 3, "formControlName", "", 3, "noFormControl", "", 3, "no-form-control", ""]], hostBindings: function MagicDefaultValueAccessor_HostBindings(rf, ctx) {
|
|
5622
4441
|
if (rf & 1) {
|
|
5623
4442
|
i0.ɵɵlistener("input", function MagicDefaultValueAccessor_input_HostBindingHandler($event) { return ctx._handleInput($event.target.value); })("blur", function MagicDefaultValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); })("compositionstart", function MagicDefaultValueAccessor_compositionstart_HostBindingHandler() { return ctx._compositionStart(); })("compositionend", function MagicDefaultValueAccessor_compositionend_HostBindingHandler($event) { return ctx._compositionEnd($event.target.value); });
|
|
5624
4443
|
}
|
|
5625
4444
|
}, exportAs: ["magic"], features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
5626
|
-
var ɵMagicDefaultValueAccessor_BaseFactory =
|
|
5627
|
-
|
|
4445
|
+
var ɵMagicDefaultValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
|
|
4446
|
+
(function () {
|
|
5628
4447
|
i0.ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
|
5629
4448
|
type: i0.Directive,
|
|
5630
4449
|
args: [{
|
|
@@ -5641,28 +4460,22 @@
|
|
|
5641
4460
|
}], null, null);
|
|
5642
4461
|
})();
|
|
5643
4462
|
|
|
5644
|
-
/**
|
|
5645
|
-
* Directive for checkboxes which should not have a form control
|
|
5646
|
-
*/
|
|
5647
4463
|
var CheckboxNoFormControlMagicDirective = /** @class */ (function () {
|
|
5648
4464
|
function CheckboxNoFormControlMagicDirective(magicDirective) {
|
|
5649
4465
|
this.magicDirective = magicDirective;
|
|
5650
4466
|
}
|
|
5651
|
-
/**
|
|
5652
|
-
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
|
5653
|
-
*/
|
|
5654
4467
|
CheckboxNoFormControlMagicDirective.prototype.onChange = function ($event) {
|
|
5655
4468
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5656
4469
|
};
|
|
5657
4470
|
return CheckboxNoFormControlMagicDirective;
|
|
5658
4471
|
}());
|
|
5659
|
-
|
|
5660
|
-
|
|
4472
|
+
CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4473
|
+
CheckboxNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) {
|
|
5661
4474
|
if (rf & 1) {
|
|
5662
4475
|
i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5663
4476
|
}
|
|
5664
4477
|
} });
|
|
5665
|
-
|
|
4478
|
+
(function () {
|
|
5666
4479
|
i0.ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
|
5667
4480
|
type: i0.Directive,
|
|
5668
4481
|
args: [{
|
|
@@ -5674,28 +4487,22 @@
|
|
|
5674
4487
|
}] });
|
|
5675
4488
|
})();
|
|
5676
4489
|
|
|
5677
|
-
/**
|
|
5678
|
-
* Directive for non-checkbox input controls which do not have a form control
|
|
5679
|
-
*/
|
|
5680
4490
|
var InputNoFormControlMagicDirective = /** @class */ (function () {
|
|
5681
4491
|
function InputNoFormControlMagicDirective(magicDirective) {
|
|
5682
4492
|
this.magicDirective = magicDirective;
|
|
5683
4493
|
}
|
|
5684
|
-
/**
|
|
5685
|
-
* Handles the 'change' event - pass it to the Magic engine
|
|
5686
|
-
*/
|
|
5687
4494
|
InputNoFormControlMagicDirective.prototype.onChange = function ($event) {
|
|
5688
4495
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
|
5689
4496
|
};
|
|
5690
4497
|
return InputNoFormControlMagicDirective;
|
|
5691
4498
|
}());
|
|
5692
|
-
|
|
5693
|
-
|
|
4499
|
+
InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4500
|
+
InputNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) {
|
|
5694
4501
|
if (rf & 1) {
|
|
5695
4502
|
i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5696
4503
|
}
|
|
5697
4504
|
} });
|
|
5698
|
-
|
|
4505
|
+
(function () {
|
|
5699
4506
|
i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
|
5700
4507
|
type: i0.Directive,
|
|
5701
4508
|
args: [{
|
|
@@ -5712,14 +4519,6 @@
|
|
|
5712
4519
|
useExisting: i0.forwardRef(function () { return DateValueAccessor; }),
|
|
5713
4520
|
multi: true
|
|
5714
4521
|
};
|
|
5715
|
-
/**
|
|
5716
|
-
* The accessor for writing a value and listening to changes on a date input element
|
|
5717
|
-
*
|
|
5718
|
-
* ### Example
|
|
5719
|
-
* `<input type="date" name="birthday" ngModel dateInput>`
|
|
5720
|
-
* OR
|
|
5721
|
-
* `<input type="date" formControlName="birthday" dateInput>`
|
|
5722
|
-
*/
|
|
5723
4522
|
var DateValueAccessor = /** @class */ (function () {
|
|
5724
4523
|
function DateValueAccessor(renderer, elementRef) {
|
|
5725
4524
|
this.renderer = renderer;
|
|
@@ -5727,7 +4526,6 @@
|
|
|
5727
4526
|
this.onChange = function (_) { };
|
|
5728
4527
|
this.onTouched = function () { };
|
|
5729
4528
|
}
|
|
5730
|
-
/** Writes a new value to the element (model -> view) */
|
|
5731
4529
|
DateValueAccessor.prototype.writeValue = function (value) {
|
|
5732
4530
|
if (!value) {
|
|
5733
4531
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
|
@@ -5735,29 +4533,26 @@
|
|
|
5735
4533
|
}
|
|
5736
4534
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
|
5737
4535
|
};
|
|
5738
|
-
/** Registers a callback function, called when value changes (view -> model) */
|
|
5739
4536
|
DateValueAccessor.prototype.registerOnChange = function (fn) {
|
|
5740
4537
|
this.onChange = function (v) { return fn(v instanceof Date
|
|
5741
4538
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
|
5742
4539
|
: v); };
|
|
5743
4540
|
};
|
|
5744
|
-
/** Registers a callback function, called when the control is blurred */
|
|
5745
4541
|
DateValueAccessor.prototype.registerOnTouched = function (fn) {
|
|
5746
4542
|
this.onTouched = fn;
|
|
5747
4543
|
};
|
|
5748
|
-
/** Enables or disables the element when the control status changes */
|
|
5749
4544
|
DateValueAccessor.prototype.setDisabledState = function (isDisabled) {
|
|
5750
4545
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
|
5751
4546
|
};
|
|
5752
4547
|
return DateValueAccessor;
|
|
5753
4548
|
}());
|
|
5754
|
-
|
|
5755
|
-
|
|
4549
|
+
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
4550
|
+
DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) {
|
|
5756
4551
|
if (rf & 1) {
|
|
5757
4552
|
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5758
4553
|
}
|
|
5759
4554
|
}, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
|
5760
|
-
|
|
4555
|
+
(function () {
|
|
5761
4556
|
i0.ɵsetClassMetadata(DateValueAccessor, [{
|
|
5762
4557
|
type: i0.Directive,
|
|
5763
4558
|
args: [{
|
|
@@ -5773,25 +4568,12 @@
|
|
|
5773
4568
|
}] });
|
|
5774
4569
|
})();
|
|
5775
4570
|
|
|
5776
|
-
/**
|
|
5777
|
-
* 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
|
|
5778
|
-
*/
|
|
5779
4571
|
var NonMagicControlDirective = /** @class */ (function () {
|
|
5780
|
-
/**
|
|
5781
|
-
*
|
|
5782
|
-
* @param _task The task service
|
|
5783
|
-
* @param element The element for which the directive is applied
|
|
5784
|
-
* @param renderer Renderer for the element
|
|
5785
|
-
* @param vcRef
|
|
5786
|
-
*/
|
|
5787
4572
|
function NonMagicControlDirective(_task, element, renderer, vcRef) {
|
|
5788
4573
|
this._task = _task;
|
|
5789
4574
|
this.element = element;
|
|
5790
4575
|
this.renderer = renderer;
|
|
5791
4576
|
this.vcRef = vcRef;
|
|
5792
|
-
/**
|
|
5793
|
-
* Collection of event handlers for this element
|
|
5794
|
-
*/
|
|
5795
4577
|
this.eventHandlers = {};
|
|
5796
4578
|
this.eventsOnlyVal = false;
|
|
5797
4579
|
this.htmlElement = this.element.nativeElement;
|
|
@@ -5806,45 +4588,31 @@
|
|
|
5806
4588
|
});
|
|
5807
4589
|
;
|
|
5808
4590
|
Object.defineProperty(NonMagicControlDirective.prototype, "task", {
|
|
5809
|
-
/**
|
|
5810
|
-
* Get the task service
|
|
5811
|
-
* @returns
|
|
5812
|
-
*/
|
|
5813
4591
|
get: function () {
|
|
5814
4592
|
return this._task;
|
|
5815
4593
|
},
|
|
5816
4594
|
enumerable: false,
|
|
5817
4595
|
configurable: true
|
|
5818
4596
|
});
|
|
5819
|
-
/**
|
|
5820
|
-
* Register to the events this element may need to handle
|
|
5821
|
-
*/
|
|
5822
4597
|
NonMagicControlDirective.prototype.regEvents = function () {
|
|
5823
4598
|
var _this = this;
|
|
5824
|
-
// Handle events for which event handler may be removed and restored
|
|
5825
4599
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
5826
4600
|
Object.keys(this.eventHandlers).forEach(function (key) {
|
|
5827
4601
|
_this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
|
|
5828
4602
|
});
|
|
5829
4603
|
};
|
|
5830
|
-
/**
|
|
5831
|
-
* Handle focus event
|
|
5832
|
-
*/
|
|
5833
4604
|
NonMagicControlDirective.prototype.OnFocus = function () {
|
|
5834
4605
|
this.task.insertEvent(engine.getGuiEventObj('focusOnNonMagicControl', "", -1));
|
|
5835
4606
|
event.cancelBubble = true;
|
|
5836
4607
|
};
|
|
5837
|
-
/**
|
|
5838
|
-
* Initialize this object
|
|
5839
|
-
*/
|
|
5840
4608
|
NonMagicControlDirective.prototype.ngOnInit = function () {
|
|
5841
4609
|
this.regEvents();
|
|
5842
4610
|
};
|
|
5843
4611
|
return NonMagicControlDirective;
|
|
5844
4612
|
}());
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
4613
|
+
NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
|
4614
|
+
NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
|
|
4615
|
+
(function () {
|
|
5848
4616
|
i0.ɵsetClassMetadata(NonMagicControlDirective, [{
|
|
5849
4617
|
type: i0.Directive,
|
|
5850
4618
|
args: [{
|
|
@@ -5856,9 +4624,6 @@
|
|
|
5856
4624
|
}] });
|
|
5857
4625
|
})();
|
|
5858
4626
|
|
|
5859
|
-
/**
|
|
5860
|
-
* @ignore
|
|
5861
|
-
*/
|
|
5862
4627
|
var decs = [
|
|
5863
4628
|
MagicDirective,
|
|
5864
4629
|
CheckboxMagicDirective,
|
|
@@ -5889,9 +4654,6 @@
|
|
|
5889
4654
|
MagicFocusDirective,
|
|
5890
4655
|
MagicViewContainerRef
|
|
5891
4656
|
];
|
|
5892
|
-
/**
|
|
5893
|
-
* @ignore
|
|
5894
|
-
*/
|
|
5895
4657
|
var MagicModule = /** @class */ (function () {
|
|
5896
4658
|
function MagicModule() {
|
|
5897
4659
|
}
|
|
@@ -5909,12 +4671,11 @@
|
|
|
5909
4671
|
};
|
|
5910
4672
|
return MagicModule;
|
|
5911
4673
|
}());
|
|
5912
|
-
|
|
5913
|
-
|
|
4674
|
+
MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
|
|
4675
|
+
MagicModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
|
|
5914
4676
|
i1.CommonModule,
|
|
5915
4677
|
forms.FormsModule,
|
|
5916
4678
|
forms.ReactiveFormsModule,
|
|
5917
|
-
//ThemeModule,
|
|
5918
4679
|
i2.RouterModule,
|
|
5919
4680
|
i3.DynamicModule,
|
|
5920
4681
|
i5.HttpClientModule
|
|
@@ -5950,7 +4711,6 @@
|
|
|
5950
4711
|
MagicViewContainerRef], imports: [i1.CommonModule,
|
|
5951
4712
|
forms.FormsModule,
|
|
5952
4713
|
forms.ReactiveFormsModule,
|
|
5953
|
-
//ThemeModule,
|
|
5954
4714
|
i2.RouterModule,
|
|
5955
4715
|
i3.DynamicModule,
|
|
5956
4716
|
i5.HttpClientModule], exports: [MagicDirective,
|
|
@@ -5982,7 +4742,7 @@
|
|
|
5982
4742
|
MagicFocusDirective,
|
|
5983
4743
|
MagicViewContainerRef] });
|
|
5984
4744
|
})();
|
|
5985
|
-
|
|
4745
|
+
(function () {
|
|
5986
4746
|
i0.ɵsetClassMetadata(MagicModule, [{
|
|
5987
4747
|
type: i0.NgModule,
|
|
5988
4748
|
args: [{
|
|
@@ -5993,12 +4753,10 @@
|
|
|
5993
4753
|
i1.CommonModule,
|
|
5994
4754
|
forms.FormsModule,
|
|
5995
4755
|
forms.ReactiveFormsModule,
|
|
5996
|
-
//ThemeModule,
|
|
5997
4756
|
i2.RouterModule,
|
|
5998
4757
|
i3.DynamicModule,
|
|
5999
4758
|
i5.HttpClientModule
|
|
6000
4759
|
],
|
|
6001
|
-
//Customizable providers
|
|
6002
4760
|
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
|
|
6003
4761
|
}]
|
|
6004
4762
|
}], null, null);
|
|
@@ -6089,7 +4847,7 @@
|
|
|
6089
4847
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
6090
4848
|
if (displayFormat === 'input') {
|
|
6091
4849
|
if (this.mgdtfmt == null)
|
|
6092
|
-
this.mgdtfmt = 'M/d/yyyy';
|
|
4850
|
+
this.mgdtfmt = 'M/d/yyyy';
|
|
6093
4851
|
return i1.formatDate(date, this.mgdtfmt, this.locale);
|
|
6094
4852
|
}
|
|
6095
4853
|
else {
|
|
@@ -6098,9 +4856,9 @@
|
|
|
6098
4856
|
};
|
|
6099
4857
|
return MgDateAdapter;
|
|
6100
4858
|
}(core.NativeDateAdapter));
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
4859
|
+
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$2.Platform), i0.ɵɵinject(TaskMagicService)); };
|
|
4860
|
+
MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
4861
|
+
(function () {
|
|
6104
4862
|
i0.ɵsetClassMetadata(MgDateAdapter, [{
|
|
6105
4863
|
type: i0.Injectable
|
|
6106
4864
|
}], function () { return [{ type: i1$2.Platform }, { type: TaskMagicService }]; }, null);
|
|
@@ -6110,9 +4868,6 @@
|
|
|
6110
4868
|
{ provide: core.DateAdapter, useClass: MgDateAdapter },
|
|
6111
4869
|
{ provide: core.MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
|
6112
4870
|
];
|
|
6113
|
-
/**
|
|
6114
|
-
* Magic service providers
|
|
6115
|
-
*/
|
|
6116
4871
|
var basicMagicProviders = [
|
|
6117
4872
|
MagicServices,
|
|
6118
4873
|
TaskMagicService,
|
|
@@ -6125,20 +4880,9 @@
|
|
|
6125
4880
|
TableMagicService
|
|
6126
4881
|
]);
|
|
6127
4882
|
|
|
6128
|
-
/**
|
|
6129
|
-
* @ignore
|
|
6130
|
-
*/
|
|
6131
|
-
///////////////////////////////////////////////////////////
|
|
6132
|
-
// class to hold gui-related helper methods
|
|
6133
|
-
///////////////////////////////////////////////////////////
|
|
6134
4883
|
var utils = /** @class */ (function () {
|
|
6135
4884
|
function utils() {
|
|
6136
4885
|
}
|
|
6137
|
-
///////////////////////////////////////////////////////////
|
|
6138
|
-
// Add magic child control to the supplied array.
|
|
6139
|
-
// Recursive, and checks children even if they are not magic controls.
|
|
6140
|
-
// Magic controls are controls which have a magic directive attached to them.
|
|
6141
|
-
///////////////////////////////////////////////////////////
|
|
6142
4886
|
utils.addChildren = function (parent, children, selector) {
|
|
6143
4887
|
for (var i = 0; i < parent.children.length; i++) {
|
|
6144
4888
|
if (typeof parent.children[i].attributes[selector] !== "undefined") {
|
|
@@ -6147,9 +4891,6 @@
|
|
|
6147
4891
|
this.addChildren(parent.children[i], children, selector);
|
|
6148
4892
|
}
|
|
6149
4893
|
};
|
|
6150
|
-
///////////////////////////////////////////////////////////
|
|
6151
|
-
// Calculate the distance between the control and the supplied x,y coordinates
|
|
6152
|
-
///////////////////////////////////////////////////////////
|
|
6153
4894
|
utils.getDistance = function (control, x, y) {
|
|
6154
4895
|
var left = control.clientLeft, top = control.clientTop;
|
|
6155
4896
|
var dx, dy;
|
|
@@ -6176,9 +4917,6 @@
|
|
|
6176
4917
|
var ret = (dx * dx + dy * dy);
|
|
6177
4918
|
return ret;
|
|
6178
4919
|
};
|
|
6179
|
-
///////////////////////////////////////////////////////////
|
|
6180
|
-
//
|
|
6181
|
-
///////////////////////////////////////////////////////////
|
|
6182
4920
|
utils.getDimentions = function (el) {
|
|
6183
4921
|
var xPos = 0;
|
|
6184
4922
|
var yPos = 0;
|
|
@@ -6186,14 +4924,12 @@
|
|
|
6186
4924
|
var height = el.height;
|
|
6187
4925
|
while (el) {
|
|
6188
4926
|
if (el.tagName == "BODY") {
|
|
6189
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
6190
4927
|
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6191
4928
|
var yScroll = el.scrollTop || document.documentElement.scrollTop;
|
|
6192
4929
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
|
6193
4930
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
|
6194
4931
|
}
|
|
6195
4932
|
else {
|
|
6196
|
-
// for all other non-BODY elements
|
|
6197
4933
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
|
6198
4934
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
|
6199
4935
|
}
|
|
@@ -6209,9 +4945,6 @@
|
|
|
6209
4945
|
return utils;
|
|
6210
4946
|
}());
|
|
6211
4947
|
|
|
6212
|
-
/**
|
|
6213
|
-
* @ignore
|
|
6214
|
-
*/
|
|
6215
4948
|
var ModalFormDefinition = /** @class */ (function () {
|
|
6216
4949
|
function ModalFormDefinition() {
|
|
6217
4950
|
this.taskId = "";
|
|
@@ -6221,10 +4954,6 @@
|
|
|
6221
4954
|
return ModalFormDefinition;
|
|
6222
4955
|
}());
|
|
6223
4956
|
|
|
6224
|
-
/**
|
|
6225
|
-
* Generated bundle index. Do not edit.
|
|
6226
|
-
*/
|
|
6227
|
-
|
|
6228
4957
|
exports.AccessorMagicService = AccessorMagicService;
|
|
6229
4958
|
exports.BaseMagicAlertComponent = BaseMagicAlertComponent;
|
|
6230
4959
|
exports.BaseMagicConfirmComponent = BaseMagicConfirmComponent;
|