@magic-xpa/angular 4.800.0-dev480.17 → 4.800.0-dev480.175
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 +232 -1520
- 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 +13 -281
- package/esm2015/src/services/title.magic.service.js +4 -15
- package/esm2015/src/ui/GuiInteractiveExecutor.js +1 -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 +4 -32
- 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 +232 -1524
- 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 +0 -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 +0 -19
- 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
|
}
|
|
@@ -729,14 +669,10 @@
|
|
|
729
669
|
[utils$1.MagicProperties.Wallpaper, "background-image"]
|
|
730
670
|
]);
|
|
731
671
|
|
|
732
|
-
/**
|
|
733
|
-
* @ignore
|
|
734
|
-
*/
|
|
735
672
|
var GuiInteractiveExecutor = /** @class */ (function () {
|
|
736
673
|
function GuiInteractiveExecutor() {
|
|
737
674
|
}
|
|
738
675
|
GuiInteractiveExecutor.prototype.Run = function () {
|
|
739
|
-
// Sets the currentContextID
|
|
740
676
|
try {
|
|
741
677
|
switch (this.command._commandType) {
|
|
742
678
|
case gui.InteractiveCommandType.GET_VALUE:
|
|
@@ -767,7 +703,6 @@
|
|
|
767
703
|
}
|
|
768
704
|
catch (ex) {
|
|
769
705
|
throw ex;
|
|
770
|
-
//want to see all the exceptions for now
|
|
771
706
|
}
|
|
772
707
|
};
|
|
773
708
|
GuiInteractiveExecutor.executeInteractiveCommand = function (task, guiIntactiveCommand, overlayService) {
|
|
@@ -848,30 +783,18 @@
|
|
|
848
783
|
i0.Output()
|
|
849
784
|
], exports.BaseMagicOverlayContainer);
|
|
850
785
|
|
|
851
|
-
/**
|
|
852
|
-
* This is a base class for the magic confirm components
|
|
853
|
-
*/
|
|
854
786
|
var BaseMagicConfirmComponent = /** @class */ (function () {
|
|
855
787
|
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
788
|
this.onClose = new i0.EventEmitter();
|
|
861
789
|
}
|
|
862
|
-
/**
|
|
863
|
-
* raises close Event
|
|
864
|
-
* @param result true when OK is pressed and false when cancel is pressed
|
|
865
|
-
*
|
|
866
|
-
*/
|
|
867
790
|
BaseMagicConfirmComponent.prototype.OnClose = function (result) {
|
|
868
791
|
this.onClose.emit(result);
|
|
869
792
|
};
|
|
870
793
|
return BaseMagicConfirmComponent;
|
|
871
794
|
}());
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
795
|
+
BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
|
|
796
|
+
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: [""] });
|
|
797
|
+
(function () {
|
|
875
798
|
i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
|
876
799
|
type: i0.Component,
|
|
877
800
|
args: [{
|
|
@@ -888,28 +811,18 @@
|
|
|
888
811
|
}] });
|
|
889
812
|
})();
|
|
890
813
|
|
|
891
|
-
/**
|
|
892
|
-
* This is a base class for the magic alert components
|
|
893
|
-
*/
|
|
894
814
|
var BaseMagicAlertComponent = /** @class */ (function () {
|
|
895
815
|
function BaseMagicAlertComponent() {
|
|
896
|
-
/**
|
|
897
|
-
* onClose Event - to be raised when the component is closed
|
|
898
|
-
|
|
899
|
-
*/
|
|
900
816
|
this.onClose = new i0.EventEmitter();
|
|
901
817
|
}
|
|
902
|
-
/**
|
|
903
|
-
* close magic alert
|
|
904
|
-
*/
|
|
905
818
|
BaseMagicAlertComponent.prototype.OnClose = function () {
|
|
906
819
|
this.onClose.emit();
|
|
907
820
|
};
|
|
908
821
|
return BaseMagicAlertComponent;
|
|
909
822
|
}());
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
823
|
+
BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
|
|
824
|
+
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: [""] });
|
|
825
|
+
(function () {
|
|
913
826
|
i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
|
914
827
|
type: i0.Component,
|
|
915
828
|
args: [{
|
|
@@ -926,9 +839,6 @@
|
|
|
926
839
|
}] });
|
|
927
840
|
})();
|
|
928
841
|
|
|
929
|
-
/**
|
|
930
|
-
* Directive for setting focus on element
|
|
931
|
-
*/
|
|
932
842
|
var MagicFocusDirective = /** @class */ (function () {
|
|
933
843
|
function MagicFocusDirective(hostElement) {
|
|
934
844
|
this.hostElement = hostElement;
|
|
@@ -938,9 +848,9 @@
|
|
|
938
848
|
};
|
|
939
849
|
return MagicFocusDirective;
|
|
940
850
|
}());
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
851
|
+
MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
852
|
+
MagicFocusDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
|
|
853
|
+
(function () {
|
|
944
854
|
i0.ɵsetClassMetadata(MagicFocusDirective, [{
|
|
945
855
|
type: i0.Directive,
|
|
946
856
|
args: [{
|
|
@@ -949,22 +859,18 @@
|
|
|
949
859
|
}], function () { return [{ type: i0.ElementRef }]; }, null);
|
|
950
860
|
})();
|
|
951
861
|
|
|
952
|
-
/**
|
|
953
|
-
* Directive for setting ViewContainerRef on element
|
|
954
|
-
*/
|
|
955
862
|
var MagicViewContainerRef = /** @class */ (function () {
|
|
956
863
|
function MagicViewContainerRef(vcRef, resolver) {
|
|
957
864
|
this.vcRef = vcRef;
|
|
958
865
|
this.resolver = resolver;
|
|
959
|
-
// For angular 10 - find the component from the views
|
|
960
866
|
var comp = (this.vcRef._hostView).find(function (v) { return v != null && !util.isNullOrUndefined(v.setViewContainerRef); });
|
|
961
867
|
comp.setViewContainerRef(vcRef);
|
|
962
868
|
}
|
|
963
869
|
return MagicViewContainerRef;
|
|
964
870
|
}());
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
871
|
+
MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
872
|
+
MagicViewContainerRef.ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
|
|
873
|
+
(function () {
|
|
968
874
|
i0.ɵsetClassMetadata(MagicViewContainerRef, [{
|
|
969
875
|
type: i0.Directive,
|
|
970
876
|
args: [{
|
|
@@ -975,29 +881,16 @@
|
|
|
975
881
|
|
|
976
882
|
var _c0 = ["overlayContainerWrapper"];
|
|
977
883
|
var MagicOverlayContainerWrapper = /** @class */ (function () {
|
|
978
|
-
/**
|
|
979
|
-
*
|
|
980
|
-
* @param componentFactoryResolver
|
|
981
|
-
*/
|
|
982
884
|
function MagicOverlayContainerWrapper(componentListMagicService, loader, injector, componentFactoryResolver, changeDetectorRef) {
|
|
983
885
|
this.componentListMagicService = componentListMagicService;
|
|
984
886
|
this.loader = loader;
|
|
985
887
|
this.injector = injector;
|
|
986
888
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
987
889
|
this.changeDetectorRef = changeDetectorRef;
|
|
988
|
-
/**
|
|
989
|
-
*
|
|
990
|
-
*/
|
|
991
890
|
this.Component = null;
|
|
992
|
-
/**
|
|
993
|
-
*
|
|
994
|
-
*/
|
|
995
891
|
this.Parameters = {};
|
|
996
892
|
this.onClose = new i0.EventEmitter();
|
|
997
893
|
}
|
|
998
|
-
/**
|
|
999
|
-
*
|
|
1000
|
-
*/
|
|
1001
894
|
MagicOverlayContainerWrapper.prototype.ngOnInit = function () {
|
|
1002
895
|
var _this = this;
|
|
1003
896
|
var moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
|
@@ -1050,17 +943,13 @@
|
|
|
1050
943
|
};
|
|
1051
944
|
return MagicOverlayContainerWrapper;
|
|
1052
945
|
}());
|
|
1053
|
-
/**
|
|
1054
|
-
* @ignore
|
|
1055
|
-
* contais data of allowed base components to use
|
|
1056
|
-
*/
|
|
1057
946
|
MagicOverlayContainerWrapper.allowedBaseComps = new Map([
|
|
1058
947
|
[gui.OverlayType.Overlay, { comp: exports.BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
|
|
1059
948
|
[gui.OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
|
1060
949
|
[gui.OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
|
1061
950
|
]);
|
|
1062
|
-
|
|
1063
|
-
|
|
951
|
+
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)); };
|
|
952
|
+
MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) {
|
|
1064
953
|
if (rf & 1) {
|
|
1065
954
|
i0.ɵɵstaticViewQuery(_c0, true);
|
|
1066
955
|
}
|
|
@@ -1079,7 +968,7 @@
|
|
|
1079
968
|
i0.ɵɵelementEnd();
|
|
1080
969
|
}
|
|
1081
970
|
}, 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
|
-
|
|
971
|
+
(function () {
|
|
1083
972
|
i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
|
|
1084
973
|
type: i0.Component,
|
|
1085
974
|
args: [{
|
|
@@ -1101,17 +990,10 @@
|
|
|
1101
990
|
}] });
|
|
1102
991
|
})();
|
|
1103
992
|
|
|
1104
|
-
/**
|
|
1105
|
-
* Displays a message-box
|
|
1106
|
-
*/
|
|
1107
993
|
var confirmationBox = /** @class */ (function () {
|
|
1108
994
|
function confirmationBox() {
|
|
1109
995
|
}
|
|
1110
|
-
/**
|
|
1111
|
-
* @ignore
|
|
1112
|
-
*/
|
|
1113
996
|
confirmationBox.isConfirmBox = function (style) {
|
|
1114
|
-
// button format mask is in first nibble from right
|
|
1115
997
|
var buttonMode = style & 0x0F;
|
|
1116
998
|
var isConfirm = (buttonMode === gui.Styles.MSGBOX_BUTTON_OK_CANCEL) ||
|
|
1117
999
|
(buttonMode === gui.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
|
|
@@ -1120,14 +1002,7 @@
|
|
|
1120
1002
|
(buttonMode === gui.Styles.MSGBOX_BUTTON_RETRY_CANCEL);
|
|
1121
1003
|
return (isConfirm);
|
|
1122
1004
|
};
|
|
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
1005
|
confirmationBox.convertToExcpectedResultBox = function (style, okWasPressed) {
|
|
1130
|
-
// button format mask is in first nibble from right
|
|
1131
1006
|
var buttonMode = style & 0x0F;
|
|
1132
1007
|
var retValue = gui.Styles.MSGBOX_RESULT_OK;
|
|
1133
1008
|
if (buttonMode === gui.Styles.MSGBOX_BUTTON_OK)
|
|
@@ -1144,19 +1019,10 @@
|
|
|
1144
1019
|
retValue = okWasPressed ? gui.Styles.MSGBOX_RESULT_RETRY : gui.Styles.MSGBOX_RESULT_CANCEL;
|
|
1145
1020
|
return retValue;
|
|
1146
1021
|
};
|
|
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
1022
|
confirmationBox.showConfirmationBox = function (title, message, style) {
|
|
1155
1023
|
var okWasPressed = false;
|
|
1156
1024
|
var retValue = gui.Styles.MSGBOX_RESULT_OK;
|
|
1157
|
-
// check if it is confirmation box
|
|
1158
1025
|
var isConfirm = this.isConfirmBox(style);
|
|
1159
|
-
// the title will be added to the string and we will add new line after the title
|
|
1160
1026
|
var titleAndString = title + '\n' + '\n' + message;
|
|
1161
1027
|
if (isConfirm)
|
|
1162
1028
|
okWasPressed = confirm(titleAndString);
|
|
@@ -1164,7 +1030,6 @@
|
|
|
1164
1030
|
alert(titleAndString);
|
|
1165
1031
|
okWasPressed = true;
|
|
1166
1032
|
}
|
|
1167
|
-
// return the result from the user
|
|
1168
1033
|
return okWasPressed;
|
|
1169
1034
|
};
|
|
1170
1035
|
return confirmationBox;
|
|
@@ -1198,38 +1063,18 @@
|
|
|
1198
1063
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
|
1199
1064
|
}
|
|
1200
1065
|
}
|
|
1201
|
-
/**
|
|
1202
|
-
* Creates a modal window for Magic modal window components
|
|
1203
|
-
*/
|
|
1204
1066
|
var MagicOverlayContainer = /** @class */ (function (_super) {
|
|
1205
1067
|
__extends(MagicOverlayContainer, _super);
|
|
1206
|
-
/**
|
|
1207
|
-
*
|
|
1208
|
-
* @param injector
|
|
1209
|
-
* @param componentFactoryResolver
|
|
1210
|
-
*/
|
|
1211
1068
|
function MagicOverlayContainer(injector, componentFactoryResolver) {
|
|
1212
1069
|
var _this = _super.call(this) || this;
|
|
1213
1070
|
_this.injector = injector;
|
|
1214
1071
|
_this.componentFactoryResolver = componentFactoryResolver;
|
|
1215
|
-
/**
|
|
1216
|
-
*
|
|
1217
|
-
*/
|
|
1218
1072
|
_this.ModalComp = null;
|
|
1219
|
-
/**
|
|
1220
|
-
*
|
|
1221
|
-
*/
|
|
1222
1073
|
_this.ModalCompParameters = {};
|
|
1223
1074
|
_this.onClose = new i0.EventEmitter();
|
|
1224
|
-
/**
|
|
1225
|
-
*
|
|
1226
|
-
*/
|
|
1227
1075
|
_this.componentRef = null;
|
|
1228
1076
|
return _this;
|
|
1229
1077
|
}
|
|
1230
|
-
/**
|
|
1231
|
-
*
|
|
1232
|
-
*/
|
|
1233
1078
|
MagicOverlayContainer.prototype.ngOnInit = function () {
|
|
1234
1079
|
var factory = this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);
|
|
1235
1080
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(factory);
|
|
@@ -1238,10 +1083,6 @@
|
|
|
1238
1083
|
MagicOverlayContainer.prototype.setViewContainerRef = function (vcRef) {
|
|
1239
1084
|
this.modalbodyViewContainerRef = vcRef;
|
|
1240
1085
|
};
|
|
1241
|
-
/**
|
|
1242
|
-
* Returns the form name
|
|
1243
|
-
* @returns
|
|
1244
|
-
*/
|
|
1245
1086
|
MagicOverlayContainer.prototype.getText = function () {
|
|
1246
1087
|
if (this.componentRef !== null) {
|
|
1247
1088
|
var comp = this.componentRef.instance;
|
|
@@ -1250,10 +1091,6 @@
|
|
|
1250
1091
|
else
|
|
1251
1092
|
return "";
|
|
1252
1093
|
};
|
|
1253
|
-
/**
|
|
1254
|
-
* Returns CSS styles for the window
|
|
1255
|
-
* @returns
|
|
1256
|
-
*/
|
|
1257
1094
|
MagicOverlayContainer.prototype.getStyle = function () {
|
|
1258
1095
|
var styles = {};
|
|
1259
1096
|
if (this.componentRef != undefined) {
|
|
@@ -1270,10 +1107,6 @@
|
|
|
1270
1107
|
}
|
|
1271
1108
|
return styles;
|
|
1272
1109
|
};
|
|
1273
|
-
/**
|
|
1274
|
-
* Returns the CSS styles for the client area
|
|
1275
|
-
* @returns
|
|
1276
|
-
*/
|
|
1277
1110
|
MagicOverlayContainer.prototype.getClientAreaStyles = function () {
|
|
1278
1111
|
var styles = {};
|
|
1279
1112
|
if (this.componentRef != undefined) {
|
|
@@ -1289,25 +1122,15 @@
|
|
|
1289
1122
|
}
|
|
1290
1123
|
return styles;
|
|
1291
1124
|
};
|
|
1292
|
-
/**
|
|
1293
|
-
* Should the title bar be displayed
|
|
1294
|
-
* @returns
|
|
1295
|
-
*/
|
|
1296
1125
|
MagicOverlayContainer.prototype.getShowTitleBar = function () {
|
|
1297
1126
|
if (this.componentRef != undefined) {
|
|
1298
1127
|
var comp = this.componentRef.instance;
|
|
1299
1128
|
return comp.ShowTitleBar();
|
|
1300
1129
|
}
|
|
1301
1130
|
};
|
|
1302
|
-
/**
|
|
1303
|
-
*
|
|
1304
|
-
*/
|
|
1305
1131
|
MagicOverlayContainer.prototype.OnClose = function () {
|
|
1306
1132
|
this.onClose.emit();
|
|
1307
1133
|
};
|
|
1308
|
-
/**
|
|
1309
|
-
* Handles click in the background window
|
|
1310
|
-
*/
|
|
1311
1134
|
MagicOverlayContainer.prototype.OnBackgroundClick = function () {
|
|
1312
1135
|
var comp = this.componentRef.instance;
|
|
1313
1136
|
if (comp.ShouldCloseOnBackgroundClick())
|
|
@@ -1315,8 +1138,8 @@
|
|
|
1315
1138
|
};
|
|
1316
1139
|
return MagicOverlayContainer;
|
|
1317
1140
|
}(exports.BaseMagicOverlayContainer));
|
|
1318
|
-
|
|
1319
|
-
|
|
1141
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver)); };
|
|
1142
|
+
MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) {
|
|
1320
1143
|
if (rf & 1) {
|
|
1321
1144
|
i0.ɵɵviewQuery(_c0$1, true);
|
|
1322
1145
|
i0.ɵɵviewQuery(_c1, true);
|
|
@@ -1352,7 +1175,7 @@
|
|
|
1352
1175
|
i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
|
1353
1176
|
}
|
|
1354
1177
|
}, 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
|
-
|
|
1178
|
+
(function () {
|
|
1356
1179
|
i0.ɵsetClassMetadata(MagicOverlayContainer, [{
|
|
1357
1180
|
type: i0.Component,
|
|
1358
1181
|
args: [{
|
|
@@ -1375,10 +1198,6 @@
|
|
|
1375
1198
|
}] });
|
|
1376
1199
|
})();
|
|
1377
1200
|
|
|
1378
|
-
/**
|
|
1379
|
-
* Service managing overlay windows
|
|
1380
|
-
* This is Magic's default provider
|
|
1381
|
-
*/
|
|
1382
1201
|
var OverlayContainerMagicProvider = /** @class */ (function () {
|
|
1383
1202
|
function OverlayContainerMagicProvider() {
|
|
1384
1203
|
}
|
|
@@ -1387,17 +1206,14 @@
|
|
|
1387
1206
|
};
|
|
1388
1207
|
return OverlayContainerMagicProvider;
|
|
1389
1208
|
}());
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1209
|
+
OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
|
|
1210
|
+
OverlayContainerMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
|
1211
|
+
(function () {
|
|
1393
1212
|
i0.ɵsetClassMetadata(OverlayContainerMagicProvider, [{
|
|
1394
1213
|
type: i0.Injectable
|
|
1395
1214
|
}], null, null);
|
|
1396
1215
|
})();
|
|
1397
1216
|
|
|
1398
|
-
/***
|
|
1399
|
-
* This is sample component for the alert message
|
|
1400
|
-
*/
|
|
1401
1217
|
var MagicAlertComponent = /** @class */ (function (_super) {
|
|
1402
1218
|
__extends(MagicAlertComponent, _super);
|
|
1403
1219
|
function MagicAlertComponent() {
|
|
@@ -1405,8 +1221,8 @@
|
|
|
1405
1221
|
}
|
|
1406
1222
|
return MagicAlertComponent;
|
|
1407
1223
|
}(BaseMagicAlertComponent));
|
|
1408
|
-
|
|
1409
|
-
|
|
1224
|
+
MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
|
|
1225
|
+
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
1226
|
if (rf & 1) {
|
|
1411
1227
|
i0.ɵɵelementStart(0, "div");
|
|
1412
1228
|
i0.ɵɵelementStart(1, "div", 0);
|
|
@@ -1430,8 +1246,8 @@
|
|
|
1430
1246
|
i0.ɵɵtextInterpolate1("", ctx.message, " ");
|
|
1431
1247
|
}
|
|
1432
1248
|
}, 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
|
-
|
|
1249
|
+
var ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent);
|
|
1250
|
+
(function () {
|
|
1435
1251
|
i0.ɵsetClassMetadata(MagicAlertComponent, [{
|
|
1436
1252
|
type: i0.Component,
|
|
1437
1253
|
args: [{
|
|
@@ -1442,9 +1258,6 @@
|
|
|
1442
1258
|
}], null, null);
|
|
1443
1259
|
})();
|
|
1444
1260
|
|
|
1445
|
-
/***
|
|
1446
|
-
* This is sample component for the confirmation box
|
|
1447
|
-
*/
|
|
1448
1261
|
var MagicConfirmationBoxComponent = /** @class */ (function (_super) {
|
|
1449
1262
|
__extends(MagicConfirmationBoxComponent, _super);
|
|
1450
1263
|
function MagicConfirmationBoxComponent() {
|
|
@@ -1452,8 +1265,8 @@
|
|
|
1452
1265
|
}
|
|
1453
1266
|
return MagicConfirmationBoxComponent;
|
|
1454
1267
|
}(BaseMagicConfirmComponent));
|
|
1455
|
-
|
|
1456
|
-
|
|
1268
|
+
MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
|
|
1269
|
+
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
1270
|
if (rf & 1) {
|
|
1458
1271
|
i0.ɵɵelementStart(0, "div");
|
|
1459
1272
|
i0.ɵɵelementStart(1, "div", 0);
|
|
@@ -1481,8 +1294,8 @@
|
|
|
1481
1294
|
i0.ɵɵtextInterpolate1(" ", ctx.message, " ");
|
|
1482
1295
|
}
|
|
1483
1296
|
}, 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
|
-
|
|
1297
|
+
var ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
|
|
1298
|
+
(function () {
|
|
1486
1299
|
i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
|
|
1487
1300
|
type: i0.Component,
|
|
1488
1301
|
args: [{
|
|
@@ -1493,51 +1306,28 @@
|
|
|
1493
1306
|
}], null, null);
|
|
1494
1307
|
})();
|
|
1495
1308
|
|
|
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
1309
|
var ConfirmationComponentsMagicProvider = /** @class */ (function () {
|
|
1505
1310
|
function ConfirmationComponentsMagicProvider() {
|
|
1506
1311
|
}
|
|
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
1312
|
ConfirmationComponentsMagicProvider.prototype.showDefaultConfirmations = function () {
|
|
1512
1313
|
return true;
|
|
1513
1314
|
};
|
|
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
1315
|
ConfirmationComponentsMagicProvider.prototype.getAlertComponent = function () {
|
|
1519
1316
|
return MagicAlertComponent;
|
|
1520
1317
|
};
|
|
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
1318
|
ConfirmationComponentsMagicProvider.prototype.getConfirmtionComponent = function () {
|
|
1526
1319
|
return MagicConfirmationBoxComponent;
|
|
1527
1320
|
};
|
|
1528
1321
|
return ConfirmationComponentsMagicProvider;
|
|
1529
1322
|
}());
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1323
|
+
ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
|
|
1324
|
+
ConfirmationComponentsMagicProvider.ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
|
1325
|
+
(function () {
|
|
1533
1326
|
i0.ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
|
|
1534
1327
|
type: i0.Injectable
|
|
1535
1328
|
}], null, null);
|
|
1536
1329
|
})();
|
|
1537
1330
|
|
|
1538
|
-
/**
|
|
1539
|
-
* Service managing overlay windows
|
|
1540
|
-
*/
|
|
1541
1331
|
var OverlayWindowService = /** @class */ (function () {
|
|
1542
1332
|
function OverlayWindowService(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
|
|
1543
1333
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
@@ -1553,7 +1343,6 @@
|
|
|
1553
1343
|
};
|
|
1554
1344
|
OverlayWindowService.prototype.open = function (formName, taskId, taskDescription) {
|
|
1555
1345
|
var _this = this;
|
|
1556
|
-
// for overlay which are lazy loaded don't find data in component-list
|
|
1557
1346
|
var comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
|
|
1558
1347
|
var parameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
|
1559
1348
|
var componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), gui.OverlayType.Overlay);
|
|
@@ -1564,28 +1353,19 @@
|
|
|
1564
1353
|
});
|
|
1565
1354
|
};
|
|
1566
1355
|
OverlayWindowService.prototype.close = function (commandStr) {
|
|
1567
|
-
// Close the overlay by removing the overlay window from its container
|
|
1568
1356
|
this.overlayWindowsContainerViewRef.remove();
|
|
1569
1357
|
this.overlayWindowFocusManager.popDialog();
|
|
1570
1358
|
var guiEvent1 = engine.getGuiEventObj("dispose", null, 0);
|
|
1571
1359
|
guiEvent1.TaskID = commandStr;
|
|
1572
1360
|
this.engineMagicService.insertEvent(guiEvent1);
|
|
1573
1361
|
};
|
|
1574
|
-
/**
|
|
1575
|
-
* Open Confirmation box
|
|
1576
|
-
* @param title title of the box
|
|
1577
|
-
* @param msg message
|
|
1578
|
-
* @param style Magic style
|
|
1579
|
-
*/
|
|
1580
1362
|
OverlayWindowService.prototype.openConfirmationBox = function (title, msg, style) {
|
|
1581
1363
|
var _this = this;
|
|
1582
|
-
//show default confirmations
|
|
1583
1364
|
if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
|
|
1584
1365
|
var res = confirmationBox.showConfirmationBox(title, msg, style);
|
|
1585
1366
|
this.finishConfirmation(style, res);
|
|
1586
1367
|
}
|
|
1587
1368
|
else {
|
|
1588
|
-
//show custom confirmations
|
|
1589
1369
|
var comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
|
|
1590
1370
|
var overlayType = confirmationBox.isConfirmBox(style) ? gui.OverlayType.ConfirmationBox : gui.OverlayType.Alert;
|
|
1591
1371
|
var componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
|
|
@@ -1596,21 +1376,11 @@
|
|
|
1596
1376
|
});
|
|
1597
1377
|
}
|
|
1598
1378
|
};
|
|
1599
|
-
/**
|
|
1600
|
-
* This method is called on close of the confirmation
|
|
1601
|
-
* @param style Magic style
|
|
1602
|
-
* @param result
|
|
1603
|
-
*/
|
|
1604
1379
|
OverlayWindowService.prototype.finishConfirmation = function (style, result) {
|
|
1605
1380
|
var guiEvent = engine.getGuiEventObj("confirmationClosed", null, 0);
|
|
1606
1381
|
guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
|
|
1607
1382
|
this.engineMagicService.insertEvent(guiEvent);
|
|
1608
1383
|
};
|
|
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
1384
|
OverlayWindowService.prototype.createModalComponent = function (parameters, component, overlayType) {
|
|
1615
1385
|
var componentRef;
|
|
1616
1386
|
var magicModalContainerParameters = {
|
|
@@ -1618,11 +1388,9 @@
|
|
|
1618
1388
|
Parameters: parameters,
|
|
1619
1389
|
OverlayTypeParam: overlayType
|
|
1620
1390
|
};
|
|
1621
|
-
// Create the UI component of modal window
|
|
1622
1391
|
var factory = this.componentFactoryResolver.resolveComponentFactory(MagicOverlayContainerWrapper);
|
|
1623
1392
|
var viewCRef = this.overlayWindowsContainerViewRef;
|
|
1624
1393
|
componentRef = viewCRef.createComponent(factory);
|
|
1625
|
-
// Set the data to newly created component
|
|
1626
1394
|
Object.assign(componentRef.instance, magicModalContainerParameters);
|
|
1627
1395
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
|
1628
1396
|
componentRef.instance.DetectChanges();
|
|
@@ -1630,9 +1398,9 @@
|
|
|
1630
1398
|
};
|
|
1631
1399
|
return OverlayWindowService;
|
|
1632
1400
|
}());
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1401
|
+
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)); };
|
|
1402
|
+
OverlayWindowService.ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
|
|
1403
|
+
(function () {
|
|
1636
1404
|
i0.ɵsetClassMetadata(OverlayWindowService, [{
|
|
1637
1405
|
type: i0.Injectable
|
|
1638
1406
|
}], function () { return [{ type: i0.ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null);
|
|
@@ -1765,103 +1533,45 @@
|
|
|
1765
1533
|
return DialogInfo;
|
|
1766
1534
|
}());
|
|
1767
1535
|
|
|
1768
|
-
/**
|
|
1769
|
-
* Main service to connect the UI with the Magic WebCLient
|
|
1770
|
-
*/
|
|
1771
1536
|
var TaskMagicService = /** @class */ (function () {
|
|
1772
|
-
/**
|
|
1773
|
-
*
|
|
1774
|
-
* @param magic
|
|
1775
|
-
*/
|
|
1776
1537
|
function TaskMagicService(magic, overlayWindowService) {
|
|
1777
1538
|
this.magic = magic;
|
|
1778
1539
|
this.overlayWindowService = overlayWindowService;
|
|
1779
|
-
/**
|
|
1780
|
-
* Collection of data for all controls
|
|
1781
|
-
*/
|
|
1782
1540
|
this.Records = new Records();
|
|
1783
|
-
/**
|
|
1784
|
-
* FormGroup collection for line mode
|
|
1785
|
-
*/
|
|
1786
1541
|
this.formGroups = [];
|
|
1787
|
-
/**
|
|
1788
|
-
* @ignore
|
|
1789
|
-
*/
|
|
1790
1542
|
this.refreshDom = new rxjs.Subject();
|
|
1791
|
-
/**
|
|
1792
|
-
* @ignore
|
|
1793
|
-
*/
|
|
1794
1543
|
this.detectChanges = new rxjs.Subject();
|
|
1795
|
-
/**
|
|
1796
|
-
* @ignore
|
|
1797
|
-
*/
|
|
1798
1544
|
this.interactiveCommands = new rxjs.Subject();
|
|
1799
|
-
/**
|
|
1800
|
-
* @ignore
|
|
1801
|
-
* This event is emitted when the selected row in a table changes.
|
|
1802
|
-
*/
|
|
1803
1545
|
this.OnSelectedRowChanged = new i0.EventEmitter();
|
|
1804
|
-
/**
|
|
1805
|
-
* @ignore
|
|
1806
|
-
*/
|
|
1807
1546
|
this.customPropertiesSubject = new rxjs.Subject();
|
|
1808
|
-
/**
|
|
1809
|
-
* @ignore
|
|
1810
|
-
*/
|
|
1811
1547
|
this.recordsCountChangeSubject = new rxjs.Subject();
|
|
1812
|
-
/**
|
|
1813
|
-
* @ignore
|
|
1814
|
-
*/
|
|
1815
1548
|
this.oldPageSize = 0;
|
|
1816
1549
|
this.Records.setGuiTopIndex(0);
|
|
1817
1550
|
this.mgInputDateFormat = null;
|
|
1818
1551
|
}
|
|
1819
|
-
/**
|
|
1820
|
-
* returns true if used is logged in
|
|
1821
|
-
* @returns
|
|
1822
|
-
*/
|
|
1823
1552
|
TaskMagicService.prototype.getIsLoggenIn = function () {
|
|
1824
1553
|
return this.magic.getIsLoggedIn();
|
|
1825
1554
|
};
|
|
1826
1555
|
Object.defineProperty(TaskMagicService.prototype, "taskId", {
|
|
1827
|
-
/**
|
|
1828
|
-
* returns the task Id
|
|
1829
|
-
* @returns
|
|
1830
|
-
*/
|
|
1831
1556
|
get: function () {
|
|
1832
1557
|
return this._taskId;
|
|
1833
1558
|
},
|
|
1834
|
-
/**
|
|
1835
|
-
* Sets the task Id
|
|
1836
|
-
* @param value the task id to set
|
|
1837
|
-
*/
|
|
1838
1559
|
set: function (value) {
|
|
1839
|
-
// debugger;
|
|
1840
1560
|
this._taskId = value;
|
|
1841
1561
|
},
|
|
1842
1562
|
enumerable: false,
|
|
1843
1563
|
configurable: true
|
|
1844
1564
|
});
|
|
1845
1565
|
Object.defineProperty(TaskMagicService.prototype, "ScreenControlsData", {
|
|
1846
|
-
/**
|
|
1847
|
-
* Returns the task's data in Screen mode
|
|
1848
|
-
* @returns
|
|
1849
|
-
*/
|
|
1850
1566
|
get: function () {
|
|
1851
1567
|
return this.Records.list['0'];
|
|
1852
1568
|
},
|
|
1853
1569
|
enumerable: false,
|
|
1854
1570
|
configurable: true
|
|
1855
1571
|
});
|
|
1856
|
-
/**
|
|
1857
|
-
* @ignore
|
|
1858
|
-
*/
|
|
1859
1572
|
TaskMagicService.prototype.settemplate = function (value) {
|
|
1860
1573
|
this.template = value;
|
|
1861
1574
|
};
|
|
1862
|
-
/**
|
|
1863
|
-
* Builds the FormControl for each and every control
|
|
1864
|
-
*/
|
|
1865
1575
|
TaskMagicService.prototype.buildScreenModeControls = function () {
|
|
1866
1576
|
var group = new forms.FormGroup({});
|
|
1867
1577
|
for (var key in this.template) {
|
|
@@ -1873,21 +1583,10 @@
|
|
|
1873
1583
|
}
|
|
1874
1584
|
this.ScreenModeControls = group;
|
|
1875
1585
|
};
|
|
1876
|
-
/**
|
|
1877
|
-
* Is the control a table control
|
|
1878
|
-
* @param id Id of the control
|
|
1879
|
-
* @returns
|
|
1880
|
-
*/
|
|
1881
1586
|
TaskMagicService.prototype.isTableControl = function (id) {
|
|
1882
1587
|
return this.template[id] == '1';
|
|
1883
1588
|
};
|
|
1884
1589
|
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
1590
|
TaskMagicService.prototype.getFormControl = function (guiRowid, id) {
|
|
1892
1591
|
var c;
|
|
1893
1592
|
var group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
|
|
@@ -1897,21 +1596,12 @@
|
|
|
1897
1596
|
}
|
|
1898
1597
|
return c;
|
|
1899
1598
|
};
|
|
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
1599
|
TaskMagicService.prototype.setInputTextValue = function (controlId, guiRowid, val) {
|
|
1906
1600
|
this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
|
|
1907
1601
|
var fc = this.getFormControl(guiRowid, controlId);
|
|
1908
1602
|
if (!util.isNullOrUndefined(val))
|
|
1909
1603
|
fc.setValue(val);
|
|
1910
1604
|
};
|
|
1911
|
-
/**
|
|
1912
|
-
* Build the FormControls for a table row
|
|
1913
|
-
* @param guiRowId Id of the row for which the FormControls are built
|
|
1914
|
-
*/
|
|
1915
1605
|
TaskMagicService.prototype.buildTableRowControls = function (guiRowId) {
|
|
1916
1606
|
var group = new forms.FormGroup({});
|
|
1917
1607
|
for (var key in this.template) {
|
|
@@ -1923,58 +1613,30 @@
|
|
|
1923
1613
|
}
|
|
1924
1614
|
this.formGroups[guiRowId] = group;
|
|
1925
1615
|
};
|
|
1926
|
-
/**
|
|
1927
|
-
*
|
|
1928
|
-
* @ignore
|
|
1929
|
-
*/
|
|
1930
1616
|
TaskMagicService.prototype.updateRecordsBeforeCurrentView = function (value) {
|
|
1931
1617
|
this.Records.recordsBeforeCurrentView = value;
|
|
1932
1618
|
};
|
|
1933
|
-
/**
|
|
1934
|
-
* @ignore
|
|
1935
|
-
*/
|
|
1936
1619
|
TaskMagicService.prototype.setIncludesFirst = function (value) {
|
|
1937
1620
|
this.Records.includesFirst = value;
|
|
1938
1621
|
};
|
|
1939
|
-
/**
|
|
1940
|
-
* @ignore
|
|
1941
|
-
*/
|
|
1942
1622
|
TaskMagicService.prototype.setIncludesLast = function (value) {
|
|
1943
1623
|
this.Records.includesLast = value;
|
|
1944
1624
|
};
|
|
1945
|
-
/**
|
|
1946
|
-
* @ignore
|
|
1947
|
-
*/
|
|
1948
1625
|
TaskMagicService.prototype.markRowAsCreated = function (guiRowId) {
|
|
1949
1626
|
this.Records.markRowAsCreated(guiRowId);
|
|
1950
1627
|
};
|
|
1951
|
-
/**
|
|
1952
|
-
* @ignore
|
|
1953
|
-
*/
|
|
1954
1628
|
TaskMagicService.prototype.markRowAsNotCreated = function (guiRowId) {
|
|
1955
1629
|
this.Records.markRowAsNotCreated(guiRowId);
|
|
1956
1630
|
};
|
|
1957
|
-
/**
|
|
1958
|
-
* @ignore
|
|
1959
|
-
*/
|
|
1960
1631
|
TaskMagicService.prototype.startRowEditing = function (guiRowId) {
|
|
1961
1632
|
this.Records.startRowEditing(guiRowId);
|
|
1962
1633
|
};
|
|
1963
|
-
/**
|
|
1964
|
-
* @ignore
|
|
1965
|
-
*/
|
|
1966
1634
|
TaskMagicService.prototype.stopRowEditing = function (guiRowId) {
|
|
1967
1635
|
this.Records.stopRowEditing(guiRowId);
|
|
1968
1636
|
};
|
|
1969
|
-
/**
|
|
1970
|
-
* @ignore
|
|
1971
|
-
*/
|
|
1972
1637
|
TaskMagicService.prototype.isRowInRowEditing = function (guiRowId) {
|
|
1973
1638
|
return this.Records.isRowInRowEditing(guiRowId);
|
|
1974
1639
|
};
|
|
1975
|
-
/**
|
|
1976
|
-
* @ignore
|
|
1977
|
-
*/
|
|
1978
1640
|
TaskMagicService.prototype.setIsEmptyDataView = function (isEmpty) {
|
|
1979
1641
|
if (this.Records.isEmptyDataView !== isEmpty) {
|
|
1980
1642
|
if (isEmpty)
|
|
@@ -1984,11 +1646,6 @@
|
|
|
1984
1646
|
this.refreshView();
|
|
1985
1647
|
}
|
|
1986
1648
|
};
|
|
1987
|
-
/**
|
|
1988
|
-
* Initialize the service to work with the task
|
|
1989
|
-
* @param taskId Id of the task
|
|
1990
|
-
* @param taskDescription
|
|
1991
|
-
*/
|
|
1992
1649
|
TaskMagicService.prototype.initTask = function (taskId, taskDescription) {
|
|
1993
1650
|
var _this = this;
|
|
1994
1651
|
this.Records.createFirst();
|
|
@@ -2001,71 +1658,39 @@
|
|
|
2001
1658
|
this.settemplate(taskDescription);
|
|
2002
1659
|
}
|
|
2003
1660
|
this.buildScreenModeControls();
|
|
2004
|
-
// remove previous subscriptions
|
|
2005
1661
|
if (!util.isNullOrUndefined(this.subscribeRefreshDom))
|
|
2006
1662
|
this.subscribeRefreshDom.unsubscribe();
|
|
2007
1663
|
if (!util.isNullOrUndefined(this.subscribeInteractiveCommands))
|
|
2008
1664
|
this.subscribeInteractiveCommands.unsubscribe();
|
|
2009
1665
|
this.subscribeRefreshDom = this.magic.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
|
|
2010
1666
|
.subscribe(function (command) {
|
|
2011
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
2012
1667
|
_this.executeCommand(command);
|
|
2013
1668
|
});
|
|
2014
1669
|
this.subscribeInteractiveCommands = this.magic.interactiveCommands
|
|
2015
1670
|
.pipe(operators.filter(function (command) { return command.TaskTag === _this.taskId; }))
|
|
2016
1671
|
.subscribe(function (command) {
|
|
2017
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
2018
1672
|
_this.executeInteractiveCommand(command);
|
|
2019
1673
|
});
|
|
2020
1674
|
};
|
|
2021
|
-
/**
|
|
2022
|
-
* @ignore
|
|
2023
|
-
*/
|
|
2024
1675
|
TaskMagicService.prototype.refreshView = function () {
|
|
2025
1676
|
this.detectChanges.next('');
|
|
2026
1677
|
};
|
|
2027
|
-
/**
|
|
2028
|
-
* Insert an event to the Magic WebClient event queue
|
|
2029
|
-
* @param guiEvent The event to insert
|
|
2030
|
-
*/
|
|
2031
1678
|
TaskMagicService.prototype.insertEvent = function (guiEvent) {
|
|
2032
1679
|
guiEvent.TaskID = this.taskId;
|
|
2033
1680
|
this.magic.insertEvent(guiEvent);
|
|
2034
1681
|
};
|
|
2035
|
-
/**
|
|
2036
|
-
* @ignore
|
|
2037
|
-
*/
|
|
2038
1682
|
TaskMagicService.prototype.GetControlPictureMask = function (controlName) {
|
|
2039
1683
|
return this.magic.GetControlPictureMask(this.taskId, controlName);
|
|
2040
1684
|
};
|
|
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
1685
|
TaskMagicService.prototype.ValidateControlValue = function (controlName, value) {
|
|
2048
1686
|
return this.magic.ValidateControlValue(this.taskId, controlName, value);
|
|
2049
1687
|
};
|
|
2050
|
-
/**
|
|
2051
|
-
* @ignore
|
|
2052
|
-
*/
|
|
2053
1688
|
TaskMagicService.prototype.GetRangedValue = function (controlName, value) {
|
|
2054
1689
|
return this.magic.GetRangedValue(this.taskId, controlName, value);
|
|
2055
1690
|
};
|
|
2056
|
-
/**
|
|
2057
|
-
* @ignore
|
|
2058
|
-
*/
|
|
2059
1691
|
TaskMagicService.prototype.GetFldRanges = function (controlName) {
|
|
2060
1692
|
return this.magic.GetFldRanges(this.taskId, controlName);
|
|
2061
1693
|
};
|
|
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
1694
|
TaskMagicService.prototype.getProperty = function (controlId, prop, guiRowId) {
|
|
2070
1695
|
if (util.isNullOrUndefined(guiRowId))
|
|
2071
1696
|
guiRowId = '0';
|
|
@@ -2079,9 +1704,6 @@
|
|
|
2079
1704
|
return this.Records.list[guiRowId].getProperty(controlId, prop);
|
|
2080
1705
|
}
|
|
2081
1706
|
};
|
|
2082
|
-
/**
|
|
2083
|
-
* @ignore
|
|
2084
|
-
*/
|
|
2085
1707
|
TaskMagicService.prototype.getPropertyStub = function (ControlsProperties, controlId, prop) {
|
|
2086
1708
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
2087
1709
|
if (controlId in ControlsProperties) {
|
|
@@ -2091,31 +1713,15 @@
|
|
|
2091
1713
|
}
|
|
2092
1714
|
return '';
|
|
2093
1715
|
};
|
|
2094
|
-
/**
|
|
2095
|
-
* @ignore
|
|
2096
|
-
*/
|
|
2097
1716
|
TaskMagicService.prototype.getStyleStub = function (ControlsProperties, controlId, styleName) {
|
|
2098
1717
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
2099
1718
|
return ControlsProperties[controlId].stylesMap.get(styleName);
|
|
2100
1719
|
};
|
|
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
1720
|
TaskMagicService.prototype.getClasses = function (controlId, guiRowId) {
|
|
2108
1721
|
if (util.isNullOrUndefined(guiRowId))
|
|
2109
1722
|
guiRowId = '0';
|
|
2110
1723
|
return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
|
|
2111
1724
|
};
|
|
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
1725
|
TaskMagicService.prototype.getStyle = function (controlId, styleName, guiRowId) {
|
|
2120
1726
|
if (util.isNullOrUndefined(guiRowId))
|
|
2121
1727
|
guiRowId = '0';
|
|
@@ -2126,36 +1732,21 @@
|
|
|
2126
1732
|
return StylesMapManager.magicValueGetStyle(styleName, magicValue);
|
|
2127
1733
|
}
|
|
2128
1734
|
};
|
|
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
1735
|
TaskMagicService.prototype.getValue = function (controlId, guiRowId) {
|
|
2136
1736
|
if (util.isNullOrUndefined(guiRowId))
|
|
2137
1737
|
guiRowId = '0';
|
|
2138
1738
|
return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
|
|
2139
1739
|
};
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
* @param guiRowId Row Id, if applicable
|
|
2144
|
-
* @param value Value to set
|
|
2145
|
-
*/
|
|
1740
|
+
TaskMagicService.prototype.getFormattedValue = function (controlName, val) {
|
|
1741
|
+
return this.magic.GetFormattedValue(this.taskId, controlName, val);
|
|
1742
|
+
};
|
|
2146
1743
|
TaskMagicService.prototype.setValue = function (controlId, guiRowId, value) {
|
|
2147
1744
|
return this.Records.list[guiRowId].setValue(controlId, value);
|
|
2148
1745
|
};
|
|
2149
|
-
/**
|
|
2150
|
-
* @ignore
|
|
2151
|
-
*/
|
|
2152
1746
|
TaskMagicService.prototype.executeInteractiveCommand = function (guiInteractiveCommand) {
|
|
2153
1747
|
GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
|
|
2154
1748
|
this.interactiveCommands.next(guiInteractiveCommand);
|
|
2155
1749
|
};
|
|
2156
|
-
/**
|
|
2157
|
-
* @ignore
|
|
2158
|
-
*/
|
|
2159
1750
|
TaskMagicService.prototype.handleSetProperty = function (command, isTableChild) {
|
|
2160
1751
|
var controlId = command.CtrlName;
|
|
2161
1752
|
var dvRowId = (command.line || 0);
|
|
@@ -2192,7 +1783,6 @@
|
|
|
2192
1783
|
var controlId = command.CtrlName;
|
|
2193
1784
|
var properties;
|
|
2194
1785
|
var isTableChild = this.isTableControl(controlId);
|
|
2195
|
-
// For non-input type controls on table.
|
|
2196
1786
|
if (command.obj !== null)
|
|
2197
1787
|
isTableChild = isTableChild || command.obj.IsTableChild;
|
|
2198
1788
|
guiRowId = this.getGuiRowId(dvRowId, isTableChild);
|
|
@@ -2243,13 +1833,13 @@
|
|
|
2243
1833
|
break;
|
|
2244
1834
|
case gui.CommandType.SET_PROPERTY:
|
|
2245
1835
|
this.handleSetProperty(command, isTableChild);
|
|
1836
|
+
if (command.Operation == gui.HtmlProperties.ReadOnly)
|
|
1837
|
+
this.refreshDom.next(command);
|
|
2246
1838
|
break;
|
|
2247
1839
|
case gui.CommandType.PROP_SET_USER_PROPERTY:
|
|
2248
1840
|
properties = this.Records.list[guiRowId].getControlMetadata(controlId);
|
|
2249
|
-
// if the property has changed, set the property and raise the subject
|
|
2250
1841
|
if (properties.userProperties.get(command.Operation) !== command.obj1) {
|
|
2251
1842
|
properties.userProperties.set(command.Operation, command.obj1);
|
|
2252
|
-
// the property name is of format <controlName>~<propertyName>
|
|
2253
1843
|
this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
|
|
2254
1844
|
}
|
|
2255
1845
|
break;
|
|
@@ -2294,12 +1884,11 @@
|
|
|
2294
1884
|
case gui.CommandType.SET_EMPTY_DATAVIEW:
|
|
2295
1885
|
this.setIsEmptyDataView(command.Bool1);
|
|
2296
1886
|
break;
|
|
1887
|
+
case gui.CommandType.SET_FOCUS:
|
|
1888
|
+
this.refreshDom.next(command);
|
|
1889
|
+
break;
|
|
2297
1890
|
}
|
|
2298
|
-
this.refreshDom.next(command);
|
|
2299
1891
|
};
|
|
2300
|
-
/**
|
|
2301
|
-
custom validator
|
|
2302
|
-
*/
|
|
2303
1892
|
TaskMagicService.prototype.customValidator = function (rowid, id) {
|
|
2304
1893
|
var _this = this;
|
|
2305
1894
|
return function (control) {
|
|
@@ -2325,13 +1914,6 @@
|
|
|
2325
1914
|
return null;
|
|
2326
1915
|
};
|
|
2327
1916
|
};
|
|
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
1917
|
TaskMagicService.prototype.ConvertValToNative = function (controlId, rowId, val) {
|
|
2336
1918
|
var properties;
|
|
2337
1919
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2380,13 +1962,6 @@
|
|
|
2380
1962
|
return val;
|
|
2381
1963
|
}
|
|
2382
1964
|
};
|
|
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
1965
|
TaskMagicService.prototype.ConvertValFromNative = function (controlId, rowId, val) {
|
|
2391
1966
|
var properties;
|
|
2392
1967
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2429,22 +2004,12 @@
|
|
|
2429
2004
|
return val;
|
|
2430
2005
|
}
|
|
2431
2006
|
};
|
|
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
2007
|
TaskMagicService.prototype.resize = function (pageSize, topGuiRowId) {
|
|
2439
2008
|
var guiEvent = engine.getGuiEventObj('resize', 'table', 0);
|
|
2440
2009
|
guiEvent.PageSize = pageSize;
|
|
2441
|
-
//As 'getRows' event also gets executed, set the guiEvent.Line parameter.
|
|
2442
2010
|
guiEvent.Line = topGuiRowId;
|
|
2443
2011
|
this.insertEvent(guiEvent);
|
|
2444
2012
|
};
|
|
2445
|
-
/**
|
|
2446
|
-
* Fetches data for new table rows when scrolling done
|
|
2447
|
-
*/
|
|
2448
2013
|
TaskMagicService.prototype.onScrollDown = function () {
|
|
2449
2014
|
if (!this.Records.includesLast) {
|
|
2450
2015
|
var guiEvent = engine.getGuiEventObj('getRows', 'table', 0);
|
|
@@ -2452,29 +2017,15 @@
|
|
|
2452
2017
|
this.insertEvent(guiEvent);
|
|
2453
2018
|
}
|
|
2454
2019
|
};
|
|
2455
|
-
/**
|
|
2456
|
-
* Sets the new browser window title
|
|
2457
|
-
* @param newTitle New window title
|
|
2458
|
-
*/
|
|
2459
2020
|
TaskMagicService.prototype.setTitle = function (newTitle) {
|
|
2460
2021
|
this.mgTitleService.setTitle(newTitle);
|
|
2461
2022
|
};
|
|
2462
|
-
/**
|
|
2463
|
-
* @ignore
|
|
2464
|
-
*/
|
|
2465
2023
|
TaskMagicService.prototype.getGuiRowId = function (dvRowId, isTableControl) {
|
|
2466
2024
|
return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
|
|
2467
2025
|
};
|
|
2468
|
-
/**
|
|
2469
|
-
*
|
|
2470
|
-
* @ignore
|
|
2471
|
-
*/
|
|
2472
2026
|
TaskMagicService.prototype.getDvRowId = function (guiRowId) {
|
|
2473
2027
|
return (guiRowId - this.Records.recordsBeforeCurrentView);
|
|
2474
2028
|
};
|
|
2475
|
-
/**
|
|
2476
|
-
* Clean up the service when it is no longer needed
|
|
2477
|
-
*/
|
|
2478
2029
|
TaskMagicService.prototype.dispose = function () {
|
|
2479
2030
|
this.refreshDom.complete();
|
|
2480
2031
|
this.detectChanges.complete();
|
|
@@ -2484,14 +2035,6 @@
|
|
|
2484
2035
|
this.customPropertiesSubject.complete();
|
|
2485
2036
|
this.OnSelectedRowChanged.complete();
|
|
2486
2037
|
};
|
|
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
2038
|
TaskMagicService.prototype.onComboboxSelectionChanged = function (event, idx, line) {
|
|
2496
2039
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, line);
|
|
2497
2040
|
if (typeof (event) == 'number') {
|
|
@@ -2510,11 +2053,6 @@
|
|
|
2510
2053
|
}
|
|
2511
2054
|
this.insertEvent(guiEvent);
|
|
2512
2055
|
};
|
|
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
2056
|
TaskMagicService.prototype.onListBoxSelectionChanged = function (event, idx) {
|
|
2519
2057
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2520
2058
|
var selectedOptions;
|
|
@@ -2530,15 +2068,9 @@
|
|
|
2530
2068
|
else
|
|
2531
2069
|
indexes[i] = (selectedOptions[i]).value;
|
|
2532
2070
|
}
|
|
2533
|
-
guiEvent.Value = indexes;
|
|
2071
|
+
guiEvent.Value = indexes;
|
|
2534
2072
|
this.insertEvent(guiEvent);
|
|
2535
2073
|
};
|
|
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
2074
|
TaskMagicService.prototype.onCheckChanged = function (event, idx, rowId) {
|
|
2543
2075
|
if (typeof rowId === 'undefined')
|
|
2544
2076
|
rowId = 0;
|
|
@@ -2554,21 +2086,11 @@
|
|
|
2554
2086
|
}
|
|
2555
2087
|
this.insertEvent(guiEvent);
|
|
2556
2088
|
};
|
|
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
2089
|
TaskMagicService.prototype.mgOnTabSelectionChanged = function (idx, layer) {
|
|
2563
2090
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
2564
2091
|
guiEvent.Value = layer.toString();
|
|
2565
2092
|
this.insertEvent(guiEvent);
|
|
2566
2093
|
};
|
|
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
2094
|
TaskMagicService.prototype.mgOnRadioSelectionChanged = function (event, idx) {
|
|
2573
2095
|
var result = this.getFormControl('0', idx);
|
|
2574
2096
|
var guiEvent = engine.getGuiEventObj('selectionchanged', idx, 0);
|
|
@@ -2578,28 +2100,15 @@
|
|
|
2578
2100
|
guiEvent.Value = result.value;
|
|
2579
2101
|
this.insertEvent(guiEvent);
|
|
2580
2102
|
};
|
|
2581
|
-
/**
|
|
2582
|
-
* Inserts the "close" event to the magic WebClient event queue
|
|
2583
|
-
*/
|
|
2584
2103
|
TaskMagicService.prototype.close = function () {
|
|
2585
2104
|
this.insertEvent(engine.getGuiEventObj('close', null, 0));
|
|
2586
2105
|
};
|
|
2587
|
-
///////////////////////////////
|
|
2588
|
-
/**
|
|
2589
|
-
* @ignore
|
|
2590
|
-
*/
|
|
2591
2106
|
TaskMagicService.prototype.IsStub = function () {
|
|
2592
2107
|
return this.magic.isStub;
|
|
2593
2108
|
};
|
|
2594
|
-
/**
|
|
2595
|
-
* @ignore
|
|
2596
|
-
*/
|
|
2597
2109
|
TaskMagicService.prototype.saveData = function (data) {
|
|
2598
2110
|
this.magic.saveData(data);
|
|
2599
2111
|
};
|
|
2600
|
-
/**
|
|
2601
|
-
* @ignore
|
|
2602
|
-
*/
|
|
2603
2112
|
TaskMagicService.prototype.createData = function () {
|
|
2604
2113
|
var myData = {
|
|
2605
2114
|
records: this.Records,
|
|
@@ -2611,9 +2120,6 @@
|
|
|
2611
2120
|
console.log(text);
|
|
2612
2121
|
this.saveData(text);
|
|
2613
2122
|
};
|
|
2614
|
-
/**
|
|
2615
|
-
* @ignore
|
|
2616
|
-
*/
|
|
2617
2123
|
TaskMagicService.prototype.loadStubData = function (stubData) {
|
|
2618
2124
|
this.Records = stubData.records;
|
|
2619
2125
|
this.settemplate(stubData.template);
|
|
@@ -2621,15 +2127,9 @@
|
|
|
2621
2127
|
for (var i = 0; i < this.Records.list.length; i++)
|
|
2622
2128
|
this.buildTableRowControls(i);
|
|
2623
2129
|
};
|
|
2624
|
-
/**
|
|
2625
|
-
* @ignore
|
|
2626
|
-
*/
|
|
2627
2130
|
TaskMagicService.prototype.loadData = function () {
|
|
2628
2131
|
alert('Please, overwrite method loadData');
|
|
2629
2132
|
};
|
|
2630
|
-
/**
|
|
2631
|
-
* @ignore
|
|
2632
|
-
*/
|
|
2633
2133
|
TaskMagicService.prototype.setStubValue = function (guiRowId, fc, name) {
|
|
2634
2134
|
if (this.IsStub()) {
|
|
2635
2135
|
try {
|
|
@@ -2642,17 +2142,14 @@
|
|
|
2642
2142
|
};
|
|
2643
2143
|
return TaskMagicService;
|
|
2644
2144
|
}());
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2145
|
+
TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
|
2146
|
+
TaskMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
2147
|
+
(function () {
|
|
2648
2148
|
i0.ɵsetClassMetadata(TaskMagicService, [{
|
|
2649
2149
|
type: i0.Injectable
|
|
2650
2150
|
}], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null);
|
|
2651
2151
|
})();
|
|
2652
2152
|
|
|
2653
|
-
/**
|
|
2654
|
-
* @ignore
|
|
2655
|
-
*/
|
|
2656
2153
|
var CommandsCollectorMagicService = /** @class */ (function () {
|
|
2657
2154
|
function CommandsCollectorMagicService(magic) {
|
|
2658
2155
|
this.magic = magic;
|
|
@@ -2687,25 +2184,19 @@
|
|
|
2687
2184
|
};
|
|
2688
2185
|
return CommandsCollectorMagicService;
|
|
2689
2186
|
}());
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2187
|
+
CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
|
|
2188
|
+
CommandsCollectorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
|
|
2189
|
+
(function () {
|
|
2693
2190
|
i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
|
2694
2191
|
type: i0.Injectable
|
|
2695
2192
|
}], function () { return [{ type: EngineMagicService }]; }, null);
|
|
2696
2193
|
})();
|
|
2697
2194
|
|
|
2698
|
-
/**
|
|
2699
|
-
* @ignore
|
|
2700
|
-
*/
|
|
2701
2195
|
var RouteCommand = /** @class */ (function () {
|
|
2702
2196
|
function RouteCommand() {
|
|
2703
2197
|
}
|
|
2704
2198
|
return RouteCommand;
|
|
2705
2199
|
}());
|
|
2706
|
-
/**
|
|
2707
|
-
* @ignore
|
|
2708
|
-
*/
|
|
2709
2200
|
var RouterCommandsMagicService = /** @class */ (function () {
|
|
2710
2201
|
function RouterCommandsMagicService() {
|
|
2711
2202
|
this.pendingRouteCommands = [];
|
|
@@ -2721,34 +2212,29 @@
|
|
|
2721
2212
|
};
|
|
2722
2213
|
return RouterCommandsMagicService;
|
|
2723
2214
|
}());
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2215
|
+
RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
|
|
2216
|
+
RouterCommandsMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
|
|
2217
|
+
(function () {
|
|
2727
2218
|
i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
|
|
2728
2219
|
type: i0.Injectable
|
|
2729
2220
|
}], null, null);
|
|
2730
2221
|
})();
|
|
2731
2222
|
|
|
2732
|
-
/**
|
|
2733
|
-
* Service for managing subforms and routing
|
|
2734
|
-
*/
|
|
2735
2223
|
var SubformMagicService = /** @class */ (function () {
|
|
2736
|
-
function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
|
|
2224
|
+
function SubformMagicService(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector) {
|
|
2737
2225
|
this.task = task;
|
|
2738
2226
|
this.activatedRoute = activatedRoute;
|
|
2739
2227
|
this.componentList = componentList;
|
|
2740
2228
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
2741
2229
|
this.router = router;
|
|
2742
2230
|
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
2743
|
-
this.
|
|
2744
|
-
this.
|
|
2231
|
+
this.componentListMagicService = componentListMagicService;
|
|
2232
|
+
this.loader = loader;
|
|
2233
|
+
this.injector = injector;
|
|
2234
|
+
this.subformsDict = {};
|
|
2235
|
+
this.routesDict = {};
|
|
2745
2236
|
this.currentRouteDefinition = null;
|
|
2746
2237
|
}
|
|
2747
|
-
/**
|
|
2748
|
-
* Finds and returns the component according to the subform name
|
|
2749
|
-
* @param subformName
|
|
2750
|
-
* @returns
|
|
2751
|
-
*/
|
|
2752
2238
|
SubformMagicService.prototype.mgGetComp = function (subformName) {
|
|
2753
2239
|
if (subformName in this.subformsDict) {
|
|
2754
2240
|
var formName = this.subformsDict[subformName].formName;
|
|
@@ -2757,11 +2243,6 @@
|
|
|
2757
2243
|
}
|
|
2758
2244
|
return null;
|
|
2759
2245
|
};
|
|
2760
|
-
/**
|
|
2761
|
-
* Returns the parameters of the subform
|
|
2762
|
-
* @param subformName
|
|
2763
|
-
* @returns
|
|
2764
|
-
*/
|
|
2765
2246
|
SubformMagicService.prototype.mgGetParameters = function (subformName) {
|
|
2766
2247
|
if (subformName in this.subformsDict) {
|
|
2767
2248
|
return this.subformsDict[subformName].parameters;
|
|
@@ -2769,9 +2250,6 @@
|
|
|
2769
2250
|
else
|
|
2770
2251
|
return "";
|
|
2771
2252
|
};
|
|
2772
|
-
/**
|
|
2773
|
-
* @ignore
|
|
2774
|
-
*/
|
|
2775
2253
|
SubformMagicService.prototype.deleteSubformComp = function (subformControlName, formName) {
|
|
2776
2254
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2777
2255
|
if (this.subformsDict[subformControlName].formName === formName) {
|
|
@@ -2780,27 +2258,42 @@
|
|
|
2780
2258
|
}
|
|
2781
2259
|
}
|
|
2782
2260
|
};
|
|
2783
|
-
/**
|
|
2784
|
-
* @ignore
|
|
2785
|
-
*/
|
|
2786
2261
|
SubformMagicService.prototype.addSubformComp = function (subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
|
2262
|
+
var _this = this;
|
|
2787
2263
|
this.pendingCommandsCollector.startCollecting();
|
|
2788
2264
|
var refreshNeeded = false;
|
|
2789
|
-
if (util.isNullOrUndefined(routerPath)) {
|
|
2265
|
+
if (util.isNullOrUndefined(routerPath)) {
|
|
2790
2266
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2791
2267
|
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2792
2268
|
this.subformsDict[subformControlName] = {};
|
|
2793
2269
|
this.task.refreshView();
|
|
2794
2270
|
}
|
|
2795
2271
|
}
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2272
|
+
var moduleRef_1 = this.componentListMagicService.getModuleRef(formName);
|
|
2273
|
+
if (moduleRef_1 == null) {
|
|
2274
|
+
var lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
|
2275
|
+
if (lazyLoadModule != null) {
|
|
2276
|
+
this.loader
|
|
2277
|
+
.load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
|
|
2278
|
+
.then(function (moduleFactory) {
|
|
2279
|
+
moduleRef_1 = moduleFactory.create(_this.injector);
|
|
2280
|
+
_this.subformsDict[subformControlName] = {
|
|
2281
|
+
formName: formName,
|
|
2282
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2283
|
+
};
|
|
2284
|
+
_this.task.refreshView();
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
else {
|
|
2289
|
+
this.subformsDict[subformControlName] = {
|
|
2290
|
+
formName: formName,
|
|
2291
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2292
|
+
};
|
|
2293
|
+
refreshNeeded = true;
|
|
2294
|
+
}
|
|
2802
2295
|
}
|
|
2803
|
-
else {
|
|
2296
|
+
else {
|
|
2804
2297
|
if (inDefaultOutlet)
|
|
2805
2298
|
subformControlName = "primary";
|
|
2806
2299
|
var routeParams = new mscorelib.List();
|
|
@@ -2815,10 +2308,6 @@
|
|
|
2815
2308
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
|
2816
2309
|
routeParams: routeParams
|
|
2817
2310
|
};
|
|
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
2311
|
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
2823
2312
|
this.ExecuteRouteCommand(routeCommand);
|
|
2824
2313
|
else
|
|
@@ -2827,17 +2316,12 @@
|
|
|
2827
2316
|
if (refreshNeeded)
|
|
2828
2317
|
this.task.refreshView();
|
|
2829
2318
|
};
|
|
2830
|
-
/**
|
|
2831
|
-
* Open the subform using a route command
|
|
2832
|
-
*/
|
|
2833
2319
|
SubformMagicService.prototype.ExecuteRouteCommand = function (routeCommand) {
|
|
2834
2320
|
var _a;
|
|
2835
2321
|
var reusingComponent = false;
|
|
2836
2322
|
var currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
|
2837
2323
|
var relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
|
2838
2324
|
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
2325
|
currentSubformMagicService.router.navigate([{ outlets: (_a = {}, _a[routeCommand.routerOutletName] = null, _a) }], { relativeTo: relativeRoute })
|
|
2842
2326
|
.then(function (result) {
|
|
2843
2327
|
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
@@ -2878,13 +2362,8 @@
|
|
|
2878
2362
|
}
|
|
2879
2363
|
});
|
|
2880
2364
|
};
|
|
2881
|
-
/**
|
|
2882
|
-
* @ignore
|
|
2883
|
-
*/
|
|
2884
2365
|
SubformMagicService.prototype.init = function () {
|
|
2885
2366
|
var _this = this;
|
|
2886
|
-
// If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
|
|
2887
|
-
// So, execute them now.
|
|
2888
2367
|
var pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
|
2889
2368
|
if (pendingCommands.length > 0) {
|
|
2890
2369
|
pendingCommands.forEach(function (command) { _this.task.executeCommand(command); });
|
|
@@ -2892,15 +2371,9 @@
|
|
|
2892
2371
|
}
|
|
2893
2372
|
this.pendingCommandsCollector.stopCollecting();
|
|
2894
2373
|
};
|
|
2895
|
-
/**
|
|
2896
|
-
* @ignore
|
|
2897
|
-
*/
|
|
2898
2374
|
SubformMagicService.prototype.refreshView = function () {
|
|
2899
2375
|
this.task.refreshView();
|
|
2900
2376
|
};
|
|
2901
|
-
///
|
|
2902
|
-
// return the relative route
|
|
2903
|
-
//
|
|
2904
2377
|
SubformMagicService.getRelativeRoute = function (sendActivatedRoute) {
|
|
2905
2378
|
var currentActiveRoute = sendActivatedRoute;
|
|
2906
2379
|
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
|
@@ -2914,72 +2387,39 @@
|
|
|
2914
2387
|
}());
|
|
2915
2388
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
2916
2389
|
SubformMagicService.routerContainers = new Array();
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2390
|
+
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)); };
|
|
2391
|
+
SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
2392
|
+
(function () {
|
|
2920
2393
|
i0.ɵsetClassMetadata(SubformMagicService, [{
|
|
2921
2394
|
type: i0.Injectable
|
|
2922
|
-
}], function () { return [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }]; }, null);
|
|
2395
|
+
}], 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);
|
|
2923
2396
|
})();
|
|
2924
2397
|
|
|
2925
|
-
/**
|
|
2926
|
-
* Implements various table-related functionalities
|
|
2927
|
-
*/
|
|
2928
2398
|
var TableMagicService = /** @class */ (function () {
|
|
2929
|
-
/**
|
|
2930
|
-
*
|
|
2931
|
-
* @param componentList Component-mapping service
|
|
2932
|
-
* @param task Magic task service
|
|
2933
|
-
*/
|
|
2934
2399
|
function TableMagicService(componentList, task) {
|
|
2935
2400
|
this.componentList = componentList;
|
|
2936
2401
|
this.task = task;
|
|
2937
2402
|
this.shouldOpenFieldTextEditor = true;
|
|
2938
2403
|
}
|
|
2939
|
-
/**
|
|
2940
|
-
* Refreshes the DataSource
|
|
2941
|
-
*/
|
|
2942
2404
|
TableMagicService.prototype.refreshDataSource = function () {
|
|
2943
2405
|
};
|
|
2944
|
-
/**
|
|
2945
|
-
* Returns the table page size
|
|
2946
|
-
*/
|
|
2947
2406
|
TableMagicService.prototype.getPageSize = function () {
|
|
2948
2407
|
return 10;
|
|
2949
2408
|
};
|
|
2950
|
-
/**
|
|
2951
|
-
* Returns max no of rows in the table.
|
|
2952
|
-
*/
|
|
2953
2409
|
TableMagicService.prototype.getMaxRowsInTable = function () {
|
|
2954
2410
|
return this.task.Records.list.length;
|
|
2955
2411
|
};
|
|
2956
|
-
/**
|
|
2957
|
-
* Selects the specified row
|
|
2958
|
-
* @param rowId The row to select
|
|
2959
|
-
*/
|
|
2960
2412
|
TableMagicService.prototype.selectRow = function (rowId) {
|
|
2961
2413
|
this.selectedItem = rowId;
|
|
2962
2414
|
};
|
|
2963
2415
|
TableMagicService.prototype.getSelectedRow = function () {
|
|
2964
2416
|
return this.selectedItem;
|
|
2965
2417
|
};
|
|
2966
|
-
/**
|
|
2967
|
-
* Returns the selected row
|
|
2968
|
-
*/
|
|
2969
2418
|
TableMagicService.prototype.selectedRow = function () {
|
|
2970
2419
|
return null;
|
|
2971
2420
|
};
|
|
2972
|
-
/**
|
|
2973
|
-
* Selects the specified page
|
|
2974
|
-
* @param pageId The page to select
|
|
2975
|
-
*/
|
|
2976
2421
|
TableMagicService.prototype.selectPage = function (pageId) {
|
|
2977
2422
|
};
|
|
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
2423
|
TableMagicService.prototype.OpenDialogForControl = function (element) {
|
|
2984
2424
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
|
2985
2425
|
element.tagName === "INPUT" ||
|
|
@@ -2987,34 +2427,17 @@
|
|
|
2987
2427
|
return false;
|
|
2988
2428
|
return true;
|
|
2989
2429
|
};
|
|
2990
|
-
/**
|
|
2991
|
-
* Returns the dialog used to edit values
|
|
2992
|
-
*/
|
|
2993
2430
|
TableMagicService.prototype.getDialog = function () {
|
|
2994
2431
|
return null;
|
|
2995
2432
|
};
|
|
2996
|
-
/**
|
|
2997
|
-
* Handles the table "scrolled" event
|
|
2998
|
-
*/
|
|
2999
2433
|
TableMagicService.prototype.onScrollDown = function () {
|
|
3000
2434
|
this.task.onScrollDown();
|
|
3001
2435
|
};
|
|
3002
|
-
/**
|
|
3003
|
-
* To be overwitten in specific implelemtations
|
|
3004
|
-
*/
|
|
3005
2436
|
TableMagicService.prototype.sortData = function (e) { };
|
|
3006
|
-
/**
|
|
3007
|
-
* To be overwitten in specific implelemtations
|
|
3008
|
-
*/
|
|
3009
2437
|
TableMagicService.prototype.mgOnPaginateChange = function (e) { };
|
|
3010
2438
|
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
2439
|
TableMagicService.prototype.updateTableSize = function (size) {
|
|
3016
|
-
if (size === 0)
|
|
3017
|
-
{
|
|
2440
|
+
if (size === 0) {
|
|
3018
2441
|
size = 1;
|
|
3019
2442
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
|
3020
2443
|
}
|
|
@@ -3022,17 +2445,11 @@
|
|
|
3022
2445
|
this.task.Records.updateSize(size);
|
|
3023
2446
|
this.task.setIncludesFirst(false);
|
|
3024
2447
|
};
|
|
3025
|
-
/**
|
|
3026
|
-
* @ignore
|
|
3027
|
-
*/
|
|
3028
2448
|
TableMagicService.prototype.setTableTopIndex = function (value) {
|
|
3029
2449
|
if (!this.task.Records.includesFirst)
|
|
3030
2450
|
value++;
|
|
3031
2451
|
this.task.Records.setGuiTopIndex(value);
|
|
3032
2452
|
};
|
|
3033
|
-
/**
|
|
3034
|
-
* @ignore
|
|
3035
|
-
*/
|
|
3036
2453
|
TableMagicService.prototype.getTableTopIndex = function () {
|
|
3037
2454
|
var topIndex = this.task.Records.getGuiTopIndex();
|
|
3038
2455
|
if (!this.task.Records.includesFirst)
|
|
@@ -3041,60 +2458,37 @@
|
|
|
3041
2458
|
};
|
|
3042
2459
|
return TableMagicService;
|
|
3043
2460
|
}());
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
2461
|
+
TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
|
|
2462
|
+
TableMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
|
2463
|
+
(function () {
|
|
3047
2464
|
i0.ɵsetClassMetadata(TableMagicService, [{
|
|
3048
2465
|
type: i0.Injectable
|
|
3049
2466
|
}], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null);
|
|
3050
2467
|
})();
|
|
3051
2468
|
|
|
3052
|
-
/**
|
|
3053
|
-
* Enables changing the browser title using Magic expression (SetTitle)
|
|
3054
|
-
*/
|
|
3055
2469
|
var TitleMagicService = /** @class */ (function () {
|
|
3056
|
-
/**
|
|
3057
|
-
*
|
|
3058
|
-
* @param titleService Angular's title-changing class
|
|
3059
|
-
*/
|
|
3060
2470
|
function TitleMagicService(titleService) {
|
|
3061
2471
|
this.titleService = titleService;
|
|
3062
2472
|
}
|
|
3063
|
-
/**
|
|
3064
|
-
* Set the new title of the window
|
|
3065
|
-
* @param newTitle New title of the window
|
|
3066
|
-
*/
|
|
3067
2473
|
TitleMagicService.prototype.setTitle = function (newTitle) {
|
|
3068
2474
|
this.titleService.setTitle(newTitle);
|
|
3069
2475
|
};
|
|
3070
2476
|
return TitleMagicService;
|
|
3071
2477
|
}());
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
2478
|
+
TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
|
|
2479
|
+
TitleMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
|
2480
|
+
(function () {
|
|
3075
2481
|
i0.ɵsetClassMetadata(TitleMagicService, [{
|
|
3076
2482
|
type: i0.Injectable
|
|
3077
2483
|
}], function () { return [{ type: i1$1.Title }]; }, null);
|
|
3078
2484
|
})();
|
|
3079
2485
|
|
|
3080
|
-
/**
|
|
3081
|
-
* Provides the UI with values calculated by the Magic WebClient
|
|
3082
|
-
*/
|
|
3083
2486
|
var AccessorMagicService = /** @class */ (function () {
|
|
3084
|
-
/**
|
|
3085
|
-
* @ignore
|
|
3086
|
-
*/
|
|
3087
2487
|
function AccessorMagicService(task) {
|
|
3088
2488
|
this.task = task;
|
|
3089
2489
|
this.Logger = null;
|
|
3090
2490
|
this.Logger = utils$1.Logger.Instance;
|
|
3091
2491
|
}
|
|
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
2492
|
AccessorMagicService.prototype.checkIsReadOnly = function (controlId) {
|
|
3099
2493
|
var properties;
|
|
3100
2494
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
|
@@ -3103,99 +2497,45 @@
|
|
|
3103
2497
|
else
|
|
3104
2498
|
return true;
|
|
3105
2499
|
};
|
|
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
2500
|
AccessorMagicService.prototype.getText = function (controlId, rowId) {
|
|
3114
2501
|
return this.task.getProperty(controlId, gui.HtmlProperties.Text, rowId);
|
|
3115
2502
|
};
|
|
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
2503
|
AccessorMagicService.prototype.getTabpageText = function (controlId, layer) {
|
|
3124
2504
|
var items = this.task.getProperty(controlId, gui.HtmlProperties.ItemsList);
|
|
3125
2505
|
if (typeof items !== "undefined")
|
|
3126
2506
|
return items[layer].displayValue;
|
|
3127
2507
|
return "";
|
|
3128
2508
|
};
|
|
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
2509
|
AccessorMagicService.prototype.getImage = function (controlId, rowId) {
|
|
3137
2510
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
|
|
3138
2511
|
return result;
|
|
3139
2512
|
};
|
|
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
2513
|
AccessorMagicService.prototype.isImageExists = function (controlId, rowId) {
|
|
3148
2514
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Image, rowId);
|
|
3149
2515
|
return !util.isNullOrUndefined(result);
|
|
3150
2516
|
};
|
|
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
2517
|
AccessorMagicService.prototype.getClasses = function (controlId, rowId) {
|
|
3159
2518
|
return this.task.getClasses(controlId, rowId);
|
|
3160
2519
|
};
|
|
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
2520
|
AccessorMagicService.prototype.getStyle = function (controlId, styleName, rowId) {
|
|
3170
2521
|
var style = this.task.getStyle(controlId, styleName, rowId);
|
|
3171
2522
|
return style;
|
|
3172
2523
|
};
|
|
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
2524
|
AccessorMagicService.prototype.getVisible = function (controlId, rowId) {
|
|
3181
2525
|
var vis = this.getProperty(controlId, gui.HtmlProperties.Visible, rowId);
|
|
3182
2526
|
return vis ? 'visible' : 'hidden';
|
|
3183
2527
|
};
|
|
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
2528
|
AccessorMagicService.prototype.getNumericPicture = function (picture) {
|
|
3191
2529
|
if (util.isNullOrUndefined(picture))
|
|
3192
2530
|
return null;
|
|
3193
2531
|
var pic = new gui.PIC(picture, utils$1.StorageAttribute.NUMERIC, 0);
|
|
3194
2532
|
var obj = {};
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
2533
|
+
obj['prefix'] = "";
|
|
2534
|
+
if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
|
|
2535
|
+
var pref = '-' + pic.getPosPref_();
|
|
2536
|
+
if (pref == pic.getNegPref_())
|
|
2537
|
+
obj['prefix'] = pic.getPosPref_();
|
|
2538
|
+
}
|
|
3199
2539
|
if (pic.getPosSuff_().length > 0)
|
|
3200
2540
|
obj['suffix'] = pic.getPosSuff_();
|
|
3201
2541
|
else
|
|
@@ -3217,128 +2557,51 @@
|
|
|
3217
2557
|
obj['wholes'] = pic.getWholes();
|
|
3218
2558
|
return obj;
|
|
3219
2559
|
};
|
|
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
2560
|
AccessorMagicService.prototype.getMustInput = function (controlId, rowId) {
|
|
3228
2561
|
var vis = this.getProperty(controlId, gui.HtmlProperties.MustInput, rowId);
|
|
3229
2562
|
return vis ? 'true' : 'false';
|
|
3230
2563
|
};
|
|
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
2564
|
AccessorMagicService.prototype.isDisabled = function (controlId, rowId) {
|
|
3239
2565
|
var result = this.getProperty(controlId, gui.HtmlProperties.Enabled, rowId);
|
|
3240
2566
|
return result === true ? null : true;
|
|
3241
2567
|
};
|
|
3242
|
-
/**
|
|
3243
|
-
* @ignore
|
|
3244
|
-
*/
|
|
3245
|
-
// getProperty (not changed)
|
|
3246
2568
|
AccessorMagicService.prototype.getProperty = function (controlId, prop, rowId) {
|
|
3247
2569
|
return this.task.getProperty(controlId, prop, rowId);
|
|
3248
2570
|
};
|
|
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
2571
|
AccessorMagicService.prototype.getTitle = function (controlId, rowId) {
|
|
3257
2572
|
return this.task.getProperty(controlId, gui.HtmlProperties.Tooltip, rowId);
|
|
3258
2573
|
};
|
|
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
2574
|
AccessorMagicService.prototype.getZoomButtonTitle = function (controlId, rowId) {
|
|
3267
2575
|
return this.task.getProperty(controlId, gui.HtmlProperties.ZoomButtonTooltip, rowId);
|
|
3268
2576
|
};
|
|
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
2577
|
AccessorMagicService.prototype.getSelectedValue = function (controlId, rowId) {
|
|
3277
2578
|
return this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue, rowId);
|
|
3278
2579
|
};
|
|
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
2580
|
AccessorMagicService.prototype.getPlaceholder = function (controlId, rowId) {
|
|
3287
2581
|
return this.task.getProperty(controlId, gui.HtmlProperties.PlaceHolder, rowId);
|
|
3288
2582
|
};
|
|
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
2583
|
AccessorMagicService.prototype.getType = function (controlId, rowId) {
|
|
3297
2584
|
var result = this.task.getProperty(controlId, gui.HtmlProperties.Password, rowId);
|
|
3298
2585
|
return result ? "password" : "text";
|
|
3299
2586
|
};
|
|
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
2587
|
AccessorMagicService.prototype.getTabIndex = function (controlId, rowId) {
|
|
3308
2588
|
return this.task.getProperty(controlId, gui.HtmlProperties.TabIndex, rowId);
|
|
3309
2589
|
};
|
|
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
2590
|
AccessorMagicService.prototype.getValue = function (controlId, rowId) {
|
|
3318
2591
|
var val = this.task.getValue(controlId, rowId);
|
|
3319
2592
|
return val;
|
|
3320
2593
|
};
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
*/
|
|
3327
|
-
/// getPicture -->
|
|
2594
|
+
AccessorMagicService.prototype.getFormattedValue = function (controlId, rowId) {
|
|
2595
|
+
var val = this.task.getValue(controlId, rowId);
|
|
2596
|
+
val = this.task.getFormattedValue(controlId, val);
|
|
2597
|
+
return val;
|
|
2598
|
+
};
|
|
3328
2599
|
AccessorMagicService.prototype.getPicture = function (controlId, rowId) {
|
|
3329
2600
|
if (util.isNullOrUndefined(controlId))
|
|
3330
2601
|
return null;
|
|
3331
2602
|
var pic = this.task.GetControlPictureMask(controlId);
|
|
3332
2603
|
return (pic != null) ? pic.getFormat().toString() : null;
|
|
3333
2604
|
};
|
|
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
2605
|
AccessorMagicService.prototype.getCustomProperty = function (controlId, propertyNameOrRowID, rowId) {
|
|
3343
2606
|
if (controlId.indexOf('~') == -1)
|
|
3344
2607
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
|
@@ -3363,22 +2626,21 @@
|
|
|
3363
2626
|
}
|
|
3364
2627
|
return userProperties;
|
|
3365
2628
|
};
|
|
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
2629
|
AccessorMagicService.prototype.getItemListValues = function (id, rowId) {
|
|
3374
2630
|
return this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
|
|
3375
2631
|
};
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
2632
|
+
AccessorMagicService.prototype.getFilteredList = function (controlId, rowId) {
|
|
2633
|
+
if (util.isNullOrUndefined(rowId))
|
|
2634
|
+
rowId = '0';
|
|
2635
|
+
var items = this.getItemListValues(controlId, rowId);
|
|
2636
|
+
var value = this.task.getFormControl(rowId, controlId).value;
|
|
2637
|
+
if (value !== null && value !== "" && items instanceof Array) {
|
|
2638
|
+
value = value.toLowerCase();
|
|
2639
|
+
return items.filter(function (option) { return option.displayValue.toLowerCase().includes(value); });
|
|
2640
|
+
}
|
|
2641
|
+
else
|
|
2642
|
+
return items;
|
|
2643
|
+
};
|
|
3382
2644
|
AccessorMagicService.prototype.getDisplayValue = function (id, rowId) {
|
|
3383
2645
|
var displayValue = "";
|
|
3384
2646
|
var o = this.getProperty(id, gui.HtmlProperties.ItemsList, rowId);
|
|
@@ -3387,12 +2649,6 @@
|
|
|
3387
2649
|
displayValue = o[value].displayValue;
|
|
3388
2650
|
return displayValue;
|
|
3389
2651
|
};
|
|
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
2652
|
AccessorMagicService.prototype.isOptionSelected = function (index, controlId) {
|
|
3397
2653
|
var e_1, _a;
|
|
3398
2654
|
var val = this.task.getValue(controlId, "0");
|
|
@@ -3412,40 +2668,18 @@
|
|
|
3412
2668
|
}
|
|
3413
2669
|
return false;
|
|
3414
2670
|
};
|
|
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
2671
|
AccessorMagicService.prototype.isTabPageSelected = function (controlId, layer) {
|
|
3422
2672
|
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
|
|
2673
|
+
return val == (layer - 1);
|
|
2674
|
+
};
|
|
3431
2675
|
AccessorMagicService.prototype.isTabPageLayerSelected = function (controlId, layer) {
|
|
3432
2676
|
var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedLayer);
|
|
3433
|
-
return val == (layer - 1);
|
|
2677
|
+
return val == (layer - 1);
|
|
3434
2678
|
};
|
|
3435
|
-
/**
|
|
3436
|
-
* Returns the index of the selected tab page
|
|
3437
|
-
* @param controlId Id of control
|
|
3438
|
-
* @returns
|
|
3439
|
-
*/
|
|
3440
2679
|
AccessorMagicService.prototype.getTabSelectedIndex = function (controlId) {
|
|
3441
2680
|
var val = this.task.getProperty(controlId, gui.HtmlProperties.SelectedValue);
|
|
3442
|
-
return val;
|
|
2681
|
+
return val;
|
|
3443
2682
|
};
|
|
3444
|
-
// private methodes
|
|
3445
|
-
/**
|
|
3446
|
-
* @ignore
|
|
3447
|
-
*/
|
|
3448
|
-
// mgIfRowCreated
|
|
3449
2683
|
AccessorMagicService.prototype.ifRowCreated = function (row) {
|
|
3450
2684
|
if (row == null)
|
|
3451
2685
|
return false;
|
|
@@ -3453,48 +2687,25 @@
|
|
|
3453
2687
|
var result = this.getFormGroupByRow(rowId);
|
|
3454
2688
|
return !util.isNullOrUndefined(result);
|
|
3455
2689
|
};
|
|
3456
|
-
/**
|
|
3457
|
-
* @ignore
|
|
3458
|
-
*/
|
|
3459
|
-
// mgGetFormGroupByRow
|
|
3460
2690
|
AccessorMagicService.prototype.getFormGroupByRow = function (id) {
|
|
3461
2691
|
return this.task.formGroups[id];
|
|
3462
2692
|
};
|
|
3463
|
-
/**
|
|
3464
|
-
* @ignore
|
|
3465
|
-
*/
|
|
3466
|
-
// isRowSelected (not changed)
|
|
3467
2693
|
AccessorMagicService.prototype.isRowSelected = function (controlId, rowId) {
|
|
3468
2694
|
var selectedRow = this.task.getProperty(controlId, gui.HtmlProperties.SelectedRow, "0");
|
|
3469
2695
|
return selectedRow == rowId;
|
|
3470
2696
|
};
|
|
3471
|
-
/**
|
|
3472
|
-
* Returns whether a row is in edit state
|
|
3473
|
-
* @param row
|
|
3474
|
-
*/
|
|
3475
2697
|
AccessorMagicService.prototype.isRowInRowEditing = function (row) {
|
|
3476
2698
|
var guiRowId = '0';
|
|
3477
2699
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
|
3478
2700
|
return this.task.isRowInRowEditing(guiRowId);
|
|
3479
2701
|
};
|
|
3480
|
-
/**
|
|
3481
|
-
* Returns whether a row is in edit state, use this method while control outside table control
|
|
3482
|
-
* @param row
|
|
3483
|
-
*/
|
|
3484
2702
|
AccessorMagicService.prototype.isCurrentInRowEditing = function () {
|
|
3485
2703
|
var row = this.task.tableService.getSelectedRow();
|
|
3486
2704
|
return this.task.isRowInRowEditing(row);
|
|
3487
2705
|
};
|
|
3488
|
-
/**
|
|
3489
|
-
* @ignore
|
|
3490
|
-
*/
|
|
3491
|
-
// GetGuiTopIndex
|
|
3492
2706
|
AccessorMagicService.prototype.guiTopIndex = function () {
|
|
3493
2707
|
return this.task.tableService.getTableTopIndex();
|
|
3494
2708
|
};
|
|
3495
|
-
/**
|
|
3496
|
-
* @ignore
|
|
3497
|
-
*/
|
|
3498
2709
|
AccessorMagicService.prototype.getErrMsg = function (id, rowId) {
|
|
3499
2710
|
var e_2, _a;
|
|
3500
2711
|
var c = this.task.getFormControl(rowId, id);
|
|
@@ -3527,12 +2738,6 @@
|
|
|
3527
2738
|
}
|
|
3528
2739
|
return 'unknown error';
|
|
3529
2740
|
};
|
|
3530
|
-
/**
|
|
3531
|
-
* Sets a user-supplied value to the specified control
|
|
3532
|
-
* @param controlName
|
|
3533
|
-
* @param value
|
|
3534
|
-
* @param refreshDisplay
|
|
3535
|
-
*/
|
|
3536
2741
|
AccessorMagicService.prototype.setValueToControl = function (controlName, value, refreshDisplay) {
|
|
3537
2742
|
if (typeof refreshDisplay === "undefined")
|
|
3538
2743
|
refreshDisplay = true;
|
|
@@ -3541,31 +2746,17 @@
|
|
|
3541
2746
|
guiEvent.param = refreshDisplay;
|
|
3542
2747
|
this.task.insertEvent(guiEvent);
|
|
3543
2748
|
};
|
|
3544
|
-
/**
|
|
3545
|
-
* @ignore
|
|
3546
|
-
*/
|
|
3547
2749
|
AccessorMagicService.prototype.isDataviewEmpty = function () {
|
|
3548
2750
|
return this.task.Records.isEmptyDataView;
|
|
3549
2751
|
};
|
|
3550
|
-
/**
|
|
3551
|
-
* simulates a click event on the specified control, for the Magic engine
|
|
3552
|
-
* @param controlName
|
|
3553
|
-
* @param rowId
|
|
3554
|
-
*/
|
|
3555
2752
|
AccessorMagicService.prototype.simulateClick = function (controlName, rowId) {
|
|
3556
2753
|
if (typeof rowId === "undefined")
|
|
3557
2754
|
rowId = 0;
|
|
3558
2755
|
this.task.insertEvent(engine.getGuiEventObj('click', controlName, rowId));
|
|
3559
2756
|
};
|
|
3560
|
-
/**
|
|
3561
|
-
* Return Boolean TRUE if user logged in Else it will return FALSE
|
|
3562
|
-
*/
|
|
3563
2757
|
AccessorMagicService.prototype.isLoggedIn = function () {
|
|
3564
2758
|
return this.task.getIsLoggenIn();
|
|
3565
2759
|
};
|
|
3566
|
-
/**
|
|
3567
|
-
* Returns JS object containing the records with all table fields.
|
|
3568
|
-
*/
|
|
3569
2760
|
AccessorMagicService.prototype.GetFormRecords = function () {
|
|
3570
2761
|
var _this = this;
|
|
3571
2762
|
var rowId = 0;
|
|
@@ -3573,13 +2764,11 @@
|
|
|
3573
2764
|
if (!util.isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
|
3574
2765
|
var recList = this.task.Records.list;
|
|
3575
2766
|
var tableControls_1 = new Array();
|
|
3576
|
-
//Generate list of table fields names
|
|
3577
2767
|
for (var key in this.task.template) {
|
|
3578
2768
|
if (this.task.template[key] == '1')
|
|
3579
2769
|
tableControls_1.push(key);
|
|
3580
2770
|
}
|
|
3581
2771
|
recArray = new Array();
|
|
3582
|
-
//Update the records as list of objects with values for table fields.
|
|
3583
2772
|
if (tableControls_1.length > 0) {
|
|
3584
2773
|
recList.forEach(function (ctrlMetaData) {
|
|
3585
2774
|
if (_this.task.Records.isRowCreated(rowId)) {
|
|
@@ -3595,23 +2784,26 @@
|
|
|
3595
2784
|
}
|
|
3596
2785
|
return recArray;
|
|
3597
2786
|
};
|
|
2787
|
+
AccessorMagicService.prototype.SetCookie = function (name, value, expires, path, domain, secure, sameSite) {
|
|
2788
|
+
engine.CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
|
2789
|
+
};
|
|
2790
|
+
AccessorMagicService.prototype.GetCookie = function (name) {
|
|
2791
|
+
return engine.CookieService.getCookie(name);
|
|
2792
|
+
};
|
|
2793
|
+
AccessorMagicService.prototype.DeleteCookie = function (name) {
|
|
2794
|
+
return engine.CookieService.deleteCookie(name);
|
|
2795
|
+
};
|
|
3598
2796
|
return AccessorMagicService;
|
|
3599
2797
|
}());
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
2798
|
+
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(i0.ɵɵinject(TaskMagicService)); };
|
|
2799
|
+
AccessorMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
2800
|
+
(function () {
|
|
3603
2801
|
i0.ɵsetClassMetadata(AccessorMagicService, [{
|
|
3604
2802
|
type: i0.Injectable
|
|
3605
2803
|
}], function () { return [{ type: TaskMagicService }]; }, null);
|
|
3606
2804
|
})();
|
|
3607
2805
|
|
|
3608
|
-
/**
|
|
3609
|
-
* Central place for adding the Magic services
|
|
3610
|
-
*/
|
|
3611
2806
|
var MagicServices = /** @class */ (function () {
|
|
3612
|
-
/**
|
|
3613
|
-
* @ignore
|
|
3614
|
-
*/
|
|
3615
2807
|
function MagicServices(task, subformService, tableService, titleService, mgAccessorService) {
|
|
3616
2808
|
this.task = task;
|
|
3617
2809
|
this.subformService = subformService;
|
|
@@ -3625,36 +2817,21 @@
|
|
|
3625
2817
|
}
|
|
3626
2818
|
return MagicServices;
|
|
3627
2819
|
}());
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
2820
|
+
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)); };
|
|
2821
|
+
MagicServices.ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
|
2822
|
+
(function () {
|
|
3631
2823
|
i0.ɵsetClassMetadata(MagicServices, [{
|
|
3632
2824
|
type: i0.Injectable
|
|
3633
2825
|
}], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null);
|
|
3634
2826
|
})();
|
|
3635
2827
|
|
|
3636
|
-
/**
|
|
3637
|
-
* Base component representing a Magic task
|
|
3638
|
-
*/
|
|
3639
2828
|
var TaskBaseMagicComponent = /** @class */ (function () {
|
|
3640
|
-
/**
|
|
3641
|
-
*
|
|
3642
|
-
* @param ref changes-detector object
|
|
3643
|
-
* @param magicServices Access point for all Magic services
|
|
3644
|
-
*/
|
|
3645
2829
|
function TaskBaseMagicComponent(ref, magicServices) {
|
|
3646
2830
|
this.ref = ref;
|
|
3647
2831
|
this.magicServices = magicServices;
|
|
3648
|
-
/**
|
|
3649
|
-
* @ignore
|
|
3650
|
-
*/
|
|
3651
2832
|
this.magicProperties = utils$1.MagicProperties;
|
|
3652
2833
|
}
|
|
3653
2834
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "task", {
|
|
3654
|
-
/**
|
|
3655
|
-
* Returns the Magic task service
|
|
3656
|
-
* @returns
|
|
3657
|
-
*/
|
|
3658
2835
|
get: function () {
|
|
3659
2836
|
return this.magicServices.task;
|
|
3660
2837
|
},
|
|
@@ -3662,10 +2839,6 @@
|
|
|
3662
2839
|
configurable: true
|
|
3663
2840
|
});
|
|
3664
2841
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "mgSub", {
|
|
3665
|
-
/**
|
|
3666
|
-
* Returns the Magic subform service
|
|
3667
|
-
* @returns
|
|
3668
|
-
*/
|
|
3669
2842
|
get: function () {
|
|
3670
2843
|
return this.magicServices.subformService;
|
|
3671
2844
|
},
|
|
@@ -3673,10 +2846,6 @@
|
|
|
3673
2846
|
configurable: true
|
|
3674
2847
|
});
|
|
3675
2848
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "tableService", {
|
|
3676
|
-
/**
|
|
3677
|
-
* Returns the Magic table service
|
|
3678
|
-
* @returns
|
|
3679
|
-
*/
|
|
3680
2849
|
get: function () {
|
|
3681
2850
|
return this.magicServices.tableService;
|
|
3682
2851
|
},
|
|
@@ -3684,10 +2853,6 @@
|
|
|
3684
2853
|
configurable: true
|
|
3685
2854
|
});
|
|
3686
2855
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "mg", {
|
|
3687
|
-
/**
|
|
3688
|
-
* Returns the Magic accessor service
|
|
3689
|
-
* @returns
|
|
3690
|
-
*/
|
|
3691
2856
|
get: function () {
|
|
3692
2857
|
return this.magicServices.mgAccessorService;
|
|
3693
2858
|
},
|
|
@@ -3695,10 +2860,6 @@
|
|
|
3695
2860
|
configurable: true
|
|
3696
2861
|
});
|
|
3697
2862
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "taskId", {
|
|
3698
|
-
/**
|
|
3699
|
-
* Returns the task Id
|
|
3700
|
-
* @returns
|
|
3701
|
-
*/
|
|
3702
2863
|
get: function () {
|
|
3703
2864
|
return this.task.taskId;
|
|
3704
2865
|
},
|
|
@@ -3706,19 +2867,12 @@
|
|
|
3706
2867
|
configurable: true
|
|
3707
2868
|
});
|
|
3708
2869
|
Object.defineProperty(TaskBaseMagicComponent.prototype, "screenFormGroup", {
|
|
3709
|
-
/**
|
|
3710
|
-
* Returns the FormGroup for screen-mode forms
|
|
3711
|
-
* @returns
|
|
3712
|
-
*/
|
|
3713
2870
|
get: function () {
|
|
3714
2871
|
return this.task.ScreenModeControls;
|
|
3715
2872
|
},
|
|
3716
2873
|
enumerable: false,
|
|
3717
2874
|
configurable: true
|
|
3718
2875
|
});
|
|
3719
|
-
/**
|
|
3720
|
-
* Interface implementation
|
|
3721
|
-
*/
|
|
3722
2876
|
TaskBaseMagicComponent.prototype.ngOnInit = function () {
|
|
3723
2877
|
var _this = this;
|
|
3724
2878
|
var subscription = this.task.detectChanges.pipe().subscribe(function (c) {
|
|
@@ -3727,48 +2881,19 @@
|
|
|
3727
2881
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
3728
2882
|
this.createFormControlsAccessor(this.screenFormGroup);
|
|
3729
2883
|
this.setInputDateFormat();
|
|
3730
|
-
// subcribe to custom property changes
|
|
3731
2884
|
this.task.customPropertiesSubject.pipe().subscribe(function (property) {
|
|
3732
2885
|
_this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
|
3733
2886
|
});
|
|
3734
|
-
// subcribe to records count changes
|
|
3735
2887
|
this.task.recordsCountChangeSubject.pipe().subscribe(function (value) {
|
|
3736
2888
|
_this.RecordsCountChanged(value);
|
|
3737
2889
|
});
|
|
3738
2890
|
};
|
|
3739
|
-
/**
|
|
3740
|
-
* @ignore
|
|
3741
|
-
*/
|
|
3742
2891
|
TaskBaseMagicComponent.prototype.createFormControlsAccessor = function (formGroup) { };
|
|
3743
|
-
/**
|
|
3744
|
-
* @ignore
|
|
3745
|
-
*/
|
|
3746
2892
|
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
2893
|
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
|
-
*/
|
|
2894
|
+
};
|
|
3766
2895
|
TaskBaseMagicComponent.prototype.RecordsCountChanged = function (recordsCount) {
|
|
3767
|
-
// intentionally left blank because the implementation should be in the derived class
|
|
3768
2896
|
};
|
|
3769
|
-
/**
|
|
3770
|
-
* Interface implementation
|
|
3771
|
-
*/
|
|
3772
2897
|
TaskBaseMagicComponent.prototype.ngAfterViewInit = function () {
|
|
3773
2898
|
this.mgSub.init();
|
|
3774
2899
|
};
|
|
@@ -3778,17 +2903,14 @@
|
|
|
3778
2903
|
this.task.oldPageSize = this.tableService.getPageSize();
|
|
3779
2904
|
}
|
|
3780
2905
|
};
|
|
3781
|
-
/**
|
|
3782
|
-
* Interface implementation
|
|
3783
|
-
*/
|
|
3784
2906
|
TaskBaseMagicComponent.prototype.ngOnDestroy = function () {
|
|
3785
2907
|
this.task.dispose();
|
|
3786
2908
|
};
|
|
3787
2909
|
return TaskBaseMagicComponent;
|
|
3788
2910
|
}());
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
2911
|
+
TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
|
|
2912
|
+
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 });
|
|
2913
|
+
(function () {
|
|
3792
2914
|
i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
|
3793
2915
|
type: i0.Component,
|
|
3794
2916
|
args: [{
|
|
@@ -3803,22 +2925,13 @@
|
|
|
3803
2925
|
}] });
|
|
3804
2926
|
})();
|
|
3805
2927
|
|
|
3806
|
-
/**
|
|
3807
|
-
* @ignore
|
|
3808
|
-
*/
|
|
3809
2928
|
var RowMagicDirective = /** @class */ (function () {
|
|
3810
2929
|
function RowMagicDirective(_task, element) {
|
|
3811
2930
|
this._task = _task;
|
|
3812
2931
|
this.element = element;
|
|
3813
|
-
/**
|
|
3814
|
-
* @ignore
|
|
3815
|
-
*/
|
|
3816
2932
|
this.rowChangedSubscriber = null;
|
|
3817
2933
|
this.htmlElement = this.element.nativeElement;
|
|
3818
2934
|
}
|
|
3819
|
-
/**
|
|
3820
|
-
* Initializes this object
|
|
3821
|
-
*/
|
|
3822
2935
|
RowMagicDirective.prototype.ngOnInit = function () {
|
|
3823
2936
|
var _this = this;
|
|
3824
2937
|
this.rowChangedSubscriber = this._task
|
|
@@ -3834,16 +2947,7 @@
|
|
|
3834
2947
|
return (rect.top >= parentRect.top &&
|
|
3835
2948
|
rect.bottom <= parentRect.bottom);
|
|
3836
2949
|
};
|
|
3837
|
-
/**
|
|
3838
|
-
* Cleanup
|
|
3839
|
-
*/
|
|
3840
2950
|
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
2951
|
if (this.rowChangedSubscriber !== null) {
|
|
3848
2952
|
this.rowChangedSubscriber.unsubscribe();
|
|
3849
2953
|
}
|
|
@@ -3856,13 +2960,13 @@
|
|
|
3856
2960
|
};
|
|
3857
2961
|
return RowMagicDirective;
|
|
3858
2962
|
}());
|
|
3859
|
-
|
|
3860
|
-
|
|
2963
|
+
RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
2964
|
+
RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) {
|
|
3861
2965
|
if (rf & 1) {
|
|
3862
2966
|
i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
|
3863
2967
|
}
|
|
3864
2968
|
}, inputs: { rowId: ["magicRow", "rowId"] } });
|
|
3865
|
-
|
|
2969
|
+
(function () {
|
|
3866
2970
|
i0.ɵsetClassMetadata(RowMagicDirective, [{
|
|
3867
2971
|
type: i0.Directive,
|
|
3868
2972
|
args: [{
|
|
@@ -3877,35 +2981,16 @@
|
|
|
3877
2981
|
}] });
|
|
3878
2982
|
})();
|
|
3879
2983
|
|
|
3880
|
-
/**
|
|
3881
|
-
* Connects HTML elements to the Magic Web Client engine
|
|
3882
|
-
*/
|
|
3883
2984
|
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
2985
|
function MagicDirective(_task, element, renderer, vcRef, magicRow) {
|
|
3893
2986
|
this._task = _task;
|
|
3894
2987
|
this.element = element;
|
|
3895
2988
|
this.renderer = renderer;
|
|
3896
2989
|
this.vcRef = vcRef;
|
|
3897
2990
|
this.magicRow = magicRow;
|
|
3898
|
-
/**
|
|
3899
|
-
* Collection of event handlers for this element
|
|
3900
|
-
*/
|
|
3901
2991
|
this.eventHandlers = {};
|
|
3902
2992
|
this.eventsOnlyVal = false;
|
|
3903
2993
|
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
2994
|
if (!(typeof magicRow === 'undefined' || magicRow === null))
|
|
3910
2995
|
this.rowId = magicRow.rowId;
|
|
3911
2996
|
}
|
|
@@ -3919,9 +3004,6 @@
|
|
|
3919
3004
|
});
|
|
3920
3005
|
;
|
|
3921
3006
|
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
3007
|
set: function (val) {
|
|
3926
3008
|
console.log('eventsOnly');
|
|
3927
3009
|
this.eventsOnlyVal = true;
|
|
@@ -3931,36 +3013,25 @@
|
|
|
3931
3013
|
});
|
|
3932
3014
|
;
|
|
3933
3015
|
Object.defineProperty(MagicDirective.prototype, "task", {
|
|
3934
|
-
/**
|
|
3935
|
-
* Get the task service
|
|
3936
|
-
* @returns
|
|
3937
|
-
*/
|
|
3938
3016
|
get: function () {
|
|
3939
3017
|
return this._task;
|
|
3940
3018
|
},
|
|
3941
3019
|
enumerable: false,
|
|
3942
3020
|
configurable: true
|
|
3943
3021
|
});
|
|
3944
|
-
/**
|
|
3945
|
-
* Register to the events this element may need to handle
|
|
3946
|
-
*/
|
|
3947
3022
|
MagicDirective.prototype.regEvents = function () {
|
|
3948
3023
|
var _this = this;
|
|
3949
|
-
// Handle events for which event handler may be removed and restored
|
|
3950
3024
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
3951
3025
|
Object.keys(this.eventHandlers).forEach(function (key) {
|
|
3952
3026
|
_this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
|
|
3953
3027
|
});
|
|
3954
|
-
|
|
3955
|
-
var events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
|
|
3028
|
+
var events = ['click', 'mousedown', 'dblclick'];
|
|
3956
3029
|
events.forEach(function (event) {
|
|
3957
3030
|
_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
3031
|
var fromButton = false;
|
|
3960
3032
|
if (_this.htmlElement instanceof HTMLButtonElement)
|
|
3961
3033
|
fromButton = true;
|
|
3962
3034
|
_this.task.insertEvent(engine.getGuiEventObj(event, _this.id, +_this.rowId, fromButton));
|
|
3963
|
-
e.cancelBubble = true;
|
|
3964
3035
|
});
|
|
3965
3036
|
});
|
|
3966
3037
|
this.renderer.listen(this.htmlElement, 'change', function (e) {
|
|
@@ -3971,13 +3042,10 @@
|
|
|
3971
3042
|
_this.task.insertEvent(guiEvent);
|
|
3972
3043
|
}
|
|
3973
3044
|
});
|
|
3974
|
-
// handle the input event
|
|
3975
3045
|
fromEvent.fromEvent(this.htmlElement, 'input').pipe(operators.map(function (event) {
|
|
3976
3046
|
return event.target.value;
|
|
3977
|
-
}), operators.debounceTime(200)
|
|
3978
|
-
).subscribe(function (x) {
|
|
3047
|
+
}), operators.debounceTime(200)).subscribe(function (x) {
|
|
3979
3048
|
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
3049
|
var attribute = _this.task.Records.list[0].getControlMetadata(_this.id).dataType;
|
|
3982
3050
|
if (attribute !== utils$1.StorageAttributeType.Date && attribute != utils$1.StorageAttributeType.Time)
|
|
3983
3051
|
_this.task.mgAccessorService.setValueToControl(_this.id, x, true);
|
|
@@ -4003,25 +3071,16 @@
|
|
|
4003
3071
|
(e.keyCode >= gui.GuiConstants.KEY_F1 && e.keyCode <= gui.GuiConstants.KEY_F12);
|
|
4004
3072
|
if (guiEvent.modifiers !== gui.Modifiers.MODIFIER_NONE || supportedKey) {
|
|
4005
3073
|
guiEvent.keyCode = e.keyCode;
|
|
4006
|
-
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
|
4007
3074
|
if (e.keyCode !== gui.GuiConstants.KEY_ESC || e.keyCode === gui.GuiConstants.KEY_ESC && !MagicDirective.opened)
|
|
4008
3075
|
e.cancelBubble = true;
|
|
4009
3076
|
_this.task.insertEvent(guiEvent);
|
|
4010
3077
|
}
|
|
4011
3078
|
});
|
|
4012
3079
|
};
|
|
4013
|
-
/**
|
|
4014
|
-
* Handle focus event
|
|
4015
|
-
*/
|
|
4016
3080
|
MagicDirective.prototype.OnFocus = function () {
|
|
4017
3081
|
this.task.insertEvent(engine.getGuiEventObj('focus', this.id, +this.rowId));
|
|
4018
3082
|
event.cancelBubble = true;
|
|
4019
3083
|
};
|
|
4020
|
-
/**
|
|
4021
|
-
* Is the command's element the same as this directive's element
|
|
4022
|
-
* @param command
|
|
4023
|
-
* @returns true/false
|
|
4024
|
-
*/
|
|
4025
3084
|
MagicDirective.prototype.IsSameElement = function (command) {
|
|
4026
3085
|
var line = command.line;
|
|
4027
3086
|
if (this.task.isTableControl(command.CtrlName))
|
|
@@ -4030,17 +3089,9 @@
|
|
|
4030
3089
|
(line === +this.rowId ||
|
|
4031
3090
|
(line === 0 && util.isNullOrUndefined(this.rowId))));
|
|
4032
3091
|
};
|
|
4033
|
-
/**
|
|
4034
|
-
* Is the command's element the same as this directive's component
|
|
4035
|
-
* @param command
|
|
4036
|
-
* @returns true/false
|
|
4037
|
-
*/
|
|
4038
3092
|
MagicDirective.prototype.IsSameComponent = function (command) {
|
|
4039
3093
|
return (command.controlName === this.id);
|
|
4040
3094
|
};
|
|
4041
|
-
/**
|
|
4042
|
-
* @ignore
|
|
4043
|
-
*/
|
|
4044
3095
|
MagicDirective.prototype.regUpdatesUI = function () {
|
|
4045
3096
|
var _this = this;
|
|
4046
3097
|
this.subscribeRefreshDom = this.task
|
|
@@ -4063,17 +3114,10 @@
|
|
|
4063
3114
|
_this.handleInteractiveCommands(command);
|
|
4064
3115
|
});
|
|
4065
3116
|
};
|
|
4066
|
-
/**
|
|
4067
|
-
* Initializes this object
|
|
4068
|
-
*/
|
|
4069
3117
|
MagicDirective.prototype.ngOnInit = function () {
|
|
4070
3118
|
this.regEvents();
|
|
4071
3119
|
this.regUpdatesUI();
|
|
4072
3120
|
};
|
|
4073
|
-
/**
|
|
4074
|
-
* Handles the commands received from the Magic WebClient engine
|
|
4075
|
-
* @param command
|
|
4076
|
-
*/
|
|
4077
3121
|
MagicDirective.prototype.handleCommand = function (command) {
|
|
4078
3122
|
switch (command.CommandType) {
|
|
4079
3123
|
case gui.CommandType.SET_PROPERTY:
|
|
@@ -4081,16 +3125,12 @@
|
|
|
4081
3125
|
break;
|
|
4082
3126
|
case gui.CommandType.SET_FOCUS:
|
|
4083
3127
|
this.focusUnlistener();
|
|
4084
|
-
// Do not set focus on connected zoom button
|
|
4085
3128
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
|
4086
3129
|
this.htmlElement.focus();
|
|
4087
3130
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
|
|
4088
3131
|
break;
|
|
4089
3132
|
}
|
|
4090
3133
|
};
|
|
4091
|
-
/**
|
|
4092
|
-
* handle the interactive commands like CallJS
|
|
4093
|
-
*/
|
|
4094
3134
|
MagicDirective.prototype.handleInteractiveCommands = function (command) {
|
|
4095
3135
|
switch (command._commandType) {
|
|
4096
3136
|
case gui.InteractiveCommandType.CALL_JS:
|
|
@@ -4100,24 +3140,18 @@
|
|
|
4100
3140
|
var resultString = '';
|
|
4101
3141
|
try {
|
|
4102
3142
|
if (!util.isNullOrUndefined(magicComponent[methodName])) {
|
|
4103
|
-
// invoke the method on instance of magic componenet
|
|
4104
3143
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
|
4105
3144
|
}
|
|
4106
3145
|
else
|
|
4107
|
-
console.error('Instance method ' + methodName + ' does not exists');
|
|
3146
|
+
console.error('Instance method ' + methodName + ' does not exists');
|
|
4108
3147
|
}
|
|
4109
3148
|
catch (e) {
|
|
4110
|
-
// any other exception
|
|
4111
3149
|
console.error(e.message);
|
|
4112
3150
|
}
|
|
4113
|
-
command.resultString = resultString;
|
|
3151
|
+
command.resultString = resultString;
|
|
4114
3152
|
break;
|
|
4115
3153
|
}
|
|
4116
3154
|
};
|
|
4117
|
-
/**
|
|
4118
|
-
* Handle the Magic set-property command
|
|
4119
|
-
* @param command
|
|
4120
|
-
*/
|
|
4121
3155
|
MagicDirective.prototype.handleSetProperty = function (command) {
|
|
4122
3156
|
switch (command.Operation) {
|
|
4123
3157
|
case gui.HtmlProperties.ReadOnly:
|
|
@@ -4128,18 +3162,15 @@
|
|
|
4128
3162
|
break;
|
|
4129
3163
|
}
|
|
4130
3164
|
};
|
|
4131
|
-
/**
|
|
4132
|
-
* Cleanup
|
|
4133
|
-
*/
|
|
4134
3165
|
MagicDirective.prototype.ngOnDestroy = function () {
|
|
4135
3166
|
this.subscribeRefreshDom.unsubscribe();
|
|
4136
3167
|
};
|
|
4137
3168
|
return MagicDirective;
|
|
4138
3169
|
}());
|
|
4139
3170
|
MagicDirective.opened = false;
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
3171
|
+
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)); };
|
|
3172
|
+
MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
|
|
3173
|
+
(function () {
|
|
4143
3174
|
i0.ɵsetClassMetadata(MagicDirective, [{
|
|
4144
3175
|
type: i0.Directive,
|
|
4145
3176
|
args: [{
|
|
@@ -4160,9 +3191,6 @@
|
|
|
4160
3191
|
}] });
|
|
4161
3192
|
})();
|
|
4162
3193
|
|
|
4163
|
-
/**
|
|
4164
|
-
* @ignore
|
|
4165
|
-
*/
|
|
4166
3194
|
var NoControlMagicDirective = /** @class */ (function (_super) {
|
|
4167
3195
|
__extends(NoControlMagicDirective, _super);
|
|
4168
3196
|
function NoControlMagicDirective(_task, element, renderer, vcRef, magicRow) {
|
|
@@ -4203,12 +3231,10 @@
|
|
|
4203
3231
|
}
|
|
4204
3232
|
}
|
|
4205
3233
|
};
|
|
4206
|
-
// is the div a tab control
|
|
4207
3234
|
NoControlMagicDirective.prototype.isTabControl = function () {
|
|
4208
3235
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
4209
3236
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
|
4210
3237
|
};
|
|
4211
|
-
// is the div a radio buttons wrapper
|
|
4212
3238
|
NoControlMagicDirective.prototype.isRadio = function () {
|
|
4213
3239
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
4214
3240
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
|
@@ -4217,7 +3243,6 @@
|
|
|
4217
3243
|
_super.prototype.handleCommand.call(this, command);
|
|
4218
3244
|
switch (command.CommandType) {
|
|
4219
3245
|
case gui.CommandType.SET_CLASS:
|
|
4220
|
-
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
|
4221
3246
|
var controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
|
4222
3247
|
if (controlMetadata.removedClass != '') {
|
|
4223
3248
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
|
@@ -4230,7 +3255,7 @@
|
|
|
4230
3255
|
this.htmlElement.innerText = command.value;
|
|
4231
3256
|
if (this.htmlElement instanceof HTMLSelectElement)
|
|
4232
3257
|
this.htmlElement.value = command.value;
|
|
4233
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
3258
|
+
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
4234
3259
|
this.htmlElement.text = command.value;
|
|
4235
3260
|
if (this.htmlElement instanceof HTMLInputElement) {
|
|
4236
3261
|
if (this.htmlElement.type === "checkbox") {
|
|
@@ -4254,7 +3279,6 @@
|
|
|
4254
3279
|
break;
|
|
4255
3280
|
}
|
|
4256
3281
|
};
|
|
4257
|
-
// handle set-property commands
|
|
4258
3282
|
NoControlMagicDirective.prototype.handleSetProperty = function (command) {
|
|
4259
3283
|
var e_1, _a;
|
|
4260
3284
|
_super.prototype.handleSetProperty.call(this, command);
|
|
@@ -4271,7 +3295,6 @@
|
|
|
4271
3295
|
break;
|
|
4272
3296
|
case gui.HtmlProperties.ItemsList:
|
|
4273
3297
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
|
4274
|
-
// clear the list
|
|
4275
3298
|
var len = this.htmlElement.length;
|
|
4276
3299
|
for (var i = len - 1; i >= 0; i--) {
|
|
4277
3300
|
this.htmlElement.remove(i);
|
|
@@ -4323,8 +3346,7 @@
|
|
|
4323
3346
|
var child = tabControl.children[i];
|
|
4324
3347
|
var layer = child.getAttribute('layer') - 1;
|
|
4325
3348
|
if (child instanceof HTMLButtonElement) {
|
|
4326
|
-
|
|
4327
|
-
if (layer == command.obj1) { // compare int to string
|
|
3349
|
+
if (layer == command.obj1) {
|
|
4328
3350
|
child.classList.add('tab_button_active');
|
|
4329
3351
|
}
|
|
4330
3352
|
else {
|
|
@@ -4332,7 +3354,6 @@
|
|
|
4332
3354
|
}
|
|
4333
3355
|
}
|
|
4334
3356
|
else {
|
|
4335
|
-
// not a buton - hide unselected tabpages
|
|
4336
3357
|
var style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
|
4337
3358
|
child.setAttribute('style', style);
|
|
4338
3359
|
}
|
|
@@ -4355,9 +3376,9 @@
|
|
|
4355
3376
|
};
|
|
4356
3377
|
return NoControlMagicDirective;
|
|
4357
3378
|
}(MagicDirective));
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
3379
|
+
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)); };
|
|
3380
|
+
NoControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
3381
|
+
(function () {
|
|
4361
3382
|
i0.ɵsetClassMetadata(NoControlMagicDirective, [{
|
|
4362
3383
|
type: i0.Directive,
|
|
4363
3384
|
args: [{
|
|
@@ -4373,20 +3394,7 @@
|
|
|
4373
3394
|
}] });
|
|
4374
3395
|
})();
|
|
4375
3396
|
|
|
4376
|
-
/**
|
|
4377
|
-
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
|
4378
|
-
*/
|
|
4379
3397
|
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
3398
|
function RouterContainerMagicComponent(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
4391
3399
|
this.activatedRoute = activatedRoute;
|
|
4392
3400
|
this.magic = magic;
|
|
@@ -4399,9 +3407,6 @@
|
|
|
4399
3407
|
this.componentRef = null;
|
|
4400
3408
|
this.parentMgSubformService = null;
|
|
4401
3409
|
}
|
|
4402
|
-
/**
|
|
4403
|
-
* Initialization
|
|
4404
|
-
*/
|
|
4405
3410
|
RouterContainerMagicComponent.prototype.ngOnInit = function () {
|
|
4406
3411
|
var outletname = this.activatedRoute.outlet;
|
|
4407
3412
|
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
@@ -4419,10 +3424,7 @@
|
|
|
4419
3424
|
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
4420
3425
|
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
4421
3426
|
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
3427
|
var calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
4425
|
-
// add the RouterPath only if exist
|
|
4426
3428
|
if (calcRouterPath.length > 0) {
|
|
4427
3429
|
var routerPath = calcRouterPath;
|
|
4428
3430
|
var tokens = utils$1.StrUtil.tokenize(routerPath, "/:");
|
|
@@ -4436,7 +3438,6 @@
|
|
|
4436
3438
|
};
|
|
4437
3439
|
RouterContainerMagicComponent.prototype.initializeComponent = function () {
|
|
4438
3440
|
var _this = this;
|
|
4439
|
-
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
|
4440
3441
|
var subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
4441
3442
|
if (subformMagicService.currentRouteDefinition !== null) {
|
|
4442
3443
|
var comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
@@ -4449,9 +3450,6 @@
|
|
|
4449
3450
|
this.parentMgSubformService = subformMagicService;
|
|
4450
3451
|
subformMagicService.currentRouteDefinition = null;
|
|
4451
3452
|
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
3453
|
var ignoreParamChange_1 = true;
|
|
4456
3454
|
myActiveRoute_1.paramMap.subscribe(function (params) {
|
|
4457
3455
|
if (!ignoreParamChange_1)
|
|
@@ -4462,12 +3460,7 @@
|
|
|
4462
3460
|
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
4463
3461
|
}
|
|
4464
3462
|
};
|
|
4465
|
-
/**
|
|
4466
|
-
* Cleanup
|
|
4467
|
-
*/
|
|
4468
3463
|
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
3464
|
if (this.componentRef != null) {
|
|
4472
3465
|
this.componentRef.instance.task.close();
|
|
4473
3466
|
var currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
@@ -4476,9 +3469,9 @@
|
|
|
4476
3469
|
};
|
|
4477
3470
|
return RouterContainerMagicComponent;
|
|
4478
3471
|
}());
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
3472
|
+
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)); };
|
|
3473
|
+
RouterContainerMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
3474
|
+
(function () {
|
|
4482
3475
|
i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
4483
3476
|
type: i0.Component,
|
|
4484
3477
|
args: [{
|
|
@@ -4488,18 +3481,12 @@
|
|
|
4488
3481
|
}], function () { return [{ type: i2.ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ComponentFactoryResolver }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null);
|
|
4489
3482
|
})();
|
|
4490
3483
|
|
|
4491
|
-
/**
|
|
4492
|
-
* @ignore
|
|
4493
|
-
*/
|
|
4494
3484
|
var Constants = /** @class */ (function () {
|
|
4495
3485
|
function Constants() {
|
|
4496
3486
|
}
|
|
4497
3487
|
return Constants;
|
|
4498
3488
|
}());
|
|
4499
3489
|
Constants.DATE_FMT = 'dd/MMM/yyyy';
|
|
4500
|
-
/**
|
|
4501
|
-
* @ignore
|
|
4502
|
-
*/
|
|
4503
3490
|
var DateMagicPipe = /** @class */ (function (_super) {
|
|
4504
3491
|
__extends(DateMagicPipe, _super);
|
|
4505
3492
|
function DateMagicPipe(_task) {
|
|
@@ -4513,7 +3500,6 @@
|
|
|
4513
3500
|
var mgDateFormatter = new MgDateFormatter();
|
|
4514
3501
|
if (!util.isNullOrUndefined(value) && mask !== null) {
|
|
4515
3502
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
|
4516
|
-
// If control is label control of table, due to query mode, then save the format here.
|
|
4517
3503
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
|
4518
3504
|
if (this._task.mgInputDateFormat == null)
|
|
4519
3505
|
this._task.mgInputDateFormat = formatStr;
|
|
@@ -4528,9 +3514,9 @@
|
|
|
4528
3514
|
};
|
|
4529
3515
|
return DateMagicPipe;
|
|
4530
3516
|
}(i1.DatePipe));
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
3517
|
+
DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3518
|
+
DateMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
|
3519
|
+
(function () {
|
|
4534
3520
|
i0.ɵsetClassMetadata(DateMagicPipe, [{
|
|
4535
3521
|
type: i0.Pipe,
|
|
4536
3522
|
args: [{
|
|
@@ -4599,18 +3585,12 @@
|
|
|
4599
3585
|
return formatStr.ToString();
|
|
4600
3586
|
}
|
|
4601
3587
|
else
|
|
4602
|
-
return "dd-mm-yyyy";
|
|
3588
|
+
return "dd-mm-yyyy";
|
|
4603
3589
|
};
|
|
4604
3590
|
return MgDateFormatter;
|
|
4605
3591
|
}());
|
|
4606
3592
|
|
|
4607
|
-
/**
|
|
4608
|
-
* Perform Magic validation on input controls which hold alphanumeric strings
|
|
4609
|
-
*/
|
|
4610
3593
|
var MgformatMagicDirective = /** @class */ (function () {
|
|
4611
|
-
/**
|
|
4612
|
-
* @ignore
|
|
4613
|
-
*/
|
|
4614
3594
|
function MgformatMagicDirective(magicDir, _task) {
|
|
4615
3595
|
this.magicDir = magicDir;
|
|
4616
3596
|
this._task = _task;
|
|
@@ -4618,20 +3598,12 @@
|
|
|
4618
3598
|
MgformatMagicDirective.prototype.ngAfterViewInit = function () {
|
|
4619
3599
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4620
3600
|
if (control != null && this._task.mgInputDateFormat == null) {
|
|
4621
|
-
// get the first date control's format.
|
|
4622
3601
|
var pic = this._task.GetControlPictureMask(this.magicDir.id);
|
|
4623
3602
|
if (pic.getAttr() == utils$1.StorageAttribute.DATE) {
|
|
4624
3603
|
this.formatDate(pic);
|
|
4625
3604
|
}
|
|
4626
3605
|
}
|
|
4627
3606
|
};
|
|
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
3607
|
MgformatMagicDirective.prototype.onFocusEvent = function ($event) {
|
|
4636
3608
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4637
3609
|
if (control != null) {
|
|
@@ -4656,10 +3628,6 @@
|
|
|
4656
3628
|
}
|
|
4657
3629
|
}
|
|
4658
3630
|
};
|
|
4659
|
-
/**
|
|
4660
|
-
* @ignore
|
|
4661
|
-
*/
|
|
4662
|
-
// This can be used to implement uppercase/lower case
|
|
4663
3631
|
MgformatMagicDirective.prototype.onChangeEvent = function ($event) {
|
|
4664
3632
|
var control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4665
3633
|
var attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
@@ -4677,9 +3645,6 @@
|
|
|
4677
3645
|
var mgDateFormatter = new MgDateFormatter();
|
|
4678
3646
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
|
4679
3647
|
};
|
|
4680
|
-
/**
|
|
4681
|
-
* @ignore
|
|
4682
|
-
*/
|
|
4683
3648
|
MgformatMagicDirective.prototype.formatAlphaUnicode = function (control) {
|
|
4684
3649
|
var value = control.value;
|
|
4685
3650
|
if (value !== null && value.length > 0) {
|
|
@@ -4705,9 +3670,6 @@
|
|
|
4705
3670
|
control.setValue(valueStr.ToString());
|
|
4706
3671
|
}
|
|
4707
3672
|
};
|
|
4708
|
-
/**
|
|
4709
|
-
* @ignore
|
|
4710
|
-
*/
|
|
4711
3673
|
MgformatMagicDirective.prototype.formatBoolean = function (control) {
|
|
4712
3674
|
var value = control.value;
|
|
4713
3675
|
if (value !== null && value.length > 0) {
|
|
@@ -4720,12 +3682,6 @@
|
|
|
4720
3682
|
}
|
|
4721
3683
|
}
|
|
4722
3684
|
};
|
|
4723
|
-
/**
|
|
4724
|
-
* @ignore
|
|
4725
|
-
*/
|
|
4726
|
-
/// <summary>
|
|
4727
|
-
/// generate pattern from fld's format
|
|
4728
|
-
/// </summary>
|
|
4729
3685
|
MgformatMagicDirective.prototype.generatePattern = function (attribute, pic) {
|
|
4730
3686
|
var pattern = "";
|
|
4731
3687
|
switch (attribute) {
|
|
@@ -4739,12 +3695,6 @@
|
|
|
4739
3695
|
}
|
|
4740
3696
|
return pattern;
|
|
4741
3697
|
};
|
|
4742
|
-
/**
|
|
4743
|
-
* @ignore
|
|
4744
|
-
*/
|
|
4745
|
-
/// <summary>
|
|
4746
|
-
/// generate pattern for Alpha
|
|
4747
|
-
/// </summary>
|
|
4748
3698
|
MgformatMagicDirective.prototype.generatePatternForNumber = function (pic) {
|
|
4749
3699
|
var patternStr = new mscorelib.StringBuilder();
|
|
4750
3700
|
patternStr.Append("^");
|
|
@@ -4757,9 +3707,6 @@
|
|
|
4757
3707
|
patternStr.Append("$");
|
|
4758
3708
|
return patternStr.ToString();
|
|
4759
3709
|
};
|
|
4760
|
-
/**
|
|
4761
|
-
* @ignore
|
|
4762
|
-
*/
|
|
4763
3710
|
MgformatMagicDirective.prototype.isPatternGenerationNeeded = function (attr, pic) {
|
|
4764
3711
|
switch (attr) {
|
|
4765
3712
|
case utils$1.StorageAttribute.NUMERIC:
|
|
@@ -4769,12 +3716,6 @@
|
|
|
4769
3716
|
return (pic.getMaskChars() > 0) ? true : false;
|
|
4770
3717
|
}
|
|
4771
3718
|
};
|
|
4772
|
-
/**
|
|
4773
|
-
* @ignore
|
|
4774
|
-
*/
|
|
4775
|
-
/// <summary>
|
|
4776
|
-
/// generate pattern for Alpha
|
|
4777
|
-
/// </summary>
|
|
4778
3719
|
MgformatMagicDirective.prototype.generatePatternForAlpha = function (pic) {
|
|
4779
3720
|
var cnt = 0;
|
|
4780
3721
|
var inputAllChars = false;
|
|
@@ -4785,7 +3726,6 @@
|
|
|
4785
3726
|
var pattern = new mscorelib.StringBuilder();
|
|
4786
3727
|
pattern.Append("^");
|
|
4787
3728
|
for (var i = 0; i < mask.length;) {
|
|
4788
|
-
//start new subset , if mask[i] is one of these.
|
|
4789
3729
|
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
3730
|
|| mask.charCodeAt(i) == utils$1.PICInterface.PIC_X)) {
|
|
4791
3731
|
pattern.Append("(");
|
|
@@ -4831,13 +3771,9 @@
|
|
|
4831
3771
|
pattern.Append("$");
|
|
4832
3772
|
return pattern.ToString();
|
|
4833
3773
|
};
|
|
4834
|
-
/**
|
|
4835
|
-
* @ignore
|
|
4836
|
-
*/
|
|
4837
3774
|
MgformatMagicDirective.prototype.getDirectiveCount = function (mask, idx, pattern, changeInPattern) {
|
|
4838
3775
|
changeInPattern.value = false;
|
|
4839
3776
|
var patternCount = 0;
|
|
4840
|
-
// find max chars
|
|
4841
3777
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
|
4842
3778
|
patternCount++;
|
|
4843
3779
|
idx++;
|
|
@@ -4846,9 +3782,6 @@
|
|
|
4846
3782
|
changeInPattern.value = true;
|
|
4847
3783
|
return patternCount;
|
|
4848
3784
|
};
|
|
4849
|
-
/**
|
|
4850
|
-
* @ignore
|
|
4851
|
-
*/
|
|
4852
3785
|
MgformatMagicDirective.prototype.IsPatternMatches = function (mask, pattern) {
|
|
4853
3786
|
for (var i = 0; i < pattern.length; i++)
|
|
4854
3787
|
if (mask == pattern[i])
|
|
@@ -4857,13 +3790,13 @@
|
|
|
4857
3790
|
};
|
|
4858
3791
|
return MgformatMagicDirective;
|
|
4859
3792
|
}());
|
|
4860
|
-
|
|
4861
|
-
|
|
3793
|
+
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3794
|
+
MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
|
|
4862
3795
|
if (rf & 1) {
|
|
4863
3796
|
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
|
4864
3797
|
}
|
|
4865
3798
|
} });
|
|
4866
|
-
|
|
3799
|
+
(function () {
|
|
4867
3800
|
i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
|
4868
3801
|
type: i0.Directive,
|
|
4869
3802
|
args: [{
|
|
@@ -4878,9 +3811,6 @@
|
|
|
4878
3811
|
}] });
|
|
4879
3812
|
})();
|
|
4880
3813
|
|
|
4881
|
-
/**
|
|
4882
|
-
* @ignore
|
|
4883
|
-
*/
|
|
4884
3814
|
var TimeMagicPipe = /** @class */ (function (_super) {
|
|
4885
3815
|
__extends(TimeMagicPipe, _super);
|
|
4886
3816
|
function TimeMagicPipe(_task) {
|
|
@@ -4919,9 +3849,9 @@
|
|
|
4919
3849
|
};
|
|
4920
3850
|
return TimeMagicPipe;
|
|
4921
3851
|
}(i1.DatePipe));
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
3852
|
+
TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService)); };
|
|
3853
|
+
TimeMagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
|
3854
|
+
(function () {
|
|
4925
3855
|
i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
|
4926
3856
|
type: i0.Pipe,
|
|
4927
3857
|
args: [{
|
|
@@ -4930,24 +3860,11 @@
|
|
|
4930
3860
|
}], function () { return [{ type: TaskMagicService }]; }, null);
|
|
4931
3861
|
})();
|
|
4932
3862
|
|
|
4933
|
-
/**
|
|
4934
|
-
* Validates the field range.
|
|
4935
|
-
*/
|
|
4936
3863
|
var RangeValidatorMagicDirective = /** @class */ (function () {
|
|
4937
|
-
/**
|
|
4938
|
-
*
|
|
4939
|
-
* @param _task The task service
|
|
4940
|
-
* @param vcRef
|
|
4941
|
-
*/
|
|
4942
3864
|
function RangeValidatorMagicDirective(_task, vcRef) {
|
|
4943
3865
|
this._task = _task;
|
|
4944
3866
|
this.vcRef = vcRef;
|
|
4945
3867
|
}
|
|
4946
|
-
/**
|
|
4947
|
-
* Validation method
|
|
4948
|
-
* @param c FormControl to validate
|
|
4949
|
-
* @returns If validation fails, return error message, else returns null
|
|
4950
|
-
*/
|
|
4951
3868
|
RangeValidatorMagicDirective.prototype.validate = function (c) {
|
|
4952
3869
|
var controlName;
|
|
4953
3870
|
controlName = this.getControlName(c);
|
|
@@ -4969,24 +3886,21 @@
|
|
|
4969
3886
|
};
|
|
4970
3887
|
}
|
|
4971
3888
|
};
|
|
4972
|
-
/**
|
|
4973
|
-
* @ignore
|
|
4974
|
-
*/
|
|
4975
3889
|
RangeValidatorMagicDirective.prototype.getControlName = function (c) {
|
|
4976
3890
|
var formGroup = c.parent.controls;
|
|
4977
3891
|
return Object.keys(formGroup).find(function (name) { return c === formGroup[name]; }) || null;
|
|
4978
3892
|
};
|
|
4979
3893
|
return RangeValidatorMagicDirective;
|
|
4980
3894
|
}());
|
|
4981
|
-
|
|
4982
|
-
|
|
3895
|
+
RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
|
3896
|
+
RangeValidatorMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
|
|
4983
3897
|
{
|
|
4984
3898
|
provide: forms.NG_VALIDATORS,
|
|
4985
3899
|
useExisting: RangeValidatorMagicDirective,
|
|
4986
3900
|
multi: true,
|
|
4987
3901
|
}
|
|
4988
3902
|
])] });
|
|
4989
|
-
|
|
3903
|
+
(function () {
|
|
4990
3904
|
i0.ɵsetClassMetadata(RangeValidatorMagicDirective, [{
|
|
4991
3905
|
type: i0.Directive,
|
|
4992
3906
|
args: [{
|
|
@@ -5011,36 +3925,20 @@
|
|
|
5011
3925
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
|
5012
3926
|
}
|
|
5013
3927
|
}
|
|
5014
|
-
/**
|
|
5015
|
-
* Represents a Magic subform
|
|
5016
|
-
*/
|
|
5017
3928
|
var SubformMagicComponent = /** @class */ (function () {
|
|
5018
|
-
/**
|
|
5019
|
-
* @ignore
|
|
5020
|
-
*/
|
|
5021
3929
|
function SubformMagicComponent(vcRef, mgSub) {
|
|
5022
3930
|
this.vcRef = vcRef;
|
|
5023
3931
|
this.mgSub = mgSub;
|
|
5024
|
-
/**
|
|
5025
|
-
* @ignore
|
|
5026
|
-
*/
|
|
5027
3932
|
this.component = null;
|
|
5028
|
-
// For angular 10 - find the component from views
|
|
5029
3933
|
this.component = (this.vcRef._hostView).find(function (v) { return !util.isNullOrUndefined(v); });
|
|
5030
3934
|
}
|
|
5031
3935
|
Object.defineProperty(SubformMagicComponent.prototype, "magic", {
|
|
5032
|
-
/**
|
|
5033
|
-
* @ignore
|
|
5034
|
-
*/
|
|
5035
3936
|
set: function (val) { this.id = val; },
|
|
5036
3937
|
enumerable: false,
|
|
5037
3938
|
configurable: true
|
|
5038
3939
|
});
|
|
5039
3940
|
;
|
|
5040
3941
|
Object.defineProperty(SubformMagicComponent.prototype, "Component", {
|
|
5041
|
-
/**
|
|
5042
|
-
* @ignore
|
|
5043
|
-
*/
|
|
5044
3942
|
get: function () {
|
|
5045
3943
|
return this.mgSub.mgGetComp(this.id);
|
|
5046
3944
|
},
|
|
@@ -5048,9 +3946,6 @@
|
|
|
5048
3946
|
configurable: true
|
|
5049
3947
|
});
|
|
5050
3948
|
Object.defineProperty(SubformMagicComponent.prototype, "Parameters", {
|
|
5051
|
-
/**
|
|
5052
|
-
* @ignore
|
|
5053
|
-
*/
|
|
5054
3949
|
get: function () {
|
|
5055
3950
|
return this.mgSub.mgGetParameters(this.id);
|
|
5056
3951
|
},
|
|
@@ -5059,8 +3954,8 @@
|
|
|
5059
3954
|
});
|
|
5060
3955
|
return SubformMagicComponent;
|
|
5061
3956
|
}());
|
|
5062
|
-
|
|
5063
|
-
|
|
3957
|
+
SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
|
|
3958
|
+
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
3959
|
if (rf & 1) {
|
|
5065
3960
|
i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
|
5066
3961
|
}
|
|
@@ -5068,7 +3963,7 @@
|
|
|
5068
3963
|
i0.ɵɵproperty("ngIf", ctx.Component);
|
|
5069
3964
|
}
|
|
5070
3965
|
}, directives: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
|
|
5071
|
-
|
|
3966
|
+
(function () {
|
|
5072
3967
|
i0.ɵsetClassMetadata(SubformMagicComponent, [{
|
|
5073
3968
|
type: i0.Component,
|
|
5074
3969
|
args: [{
|
|
@@ -5110,25 +4005,15 @@
|
|
|
5110
4005
|
}
|
|
5111
4006
|
}
|
|
5112
4007
|
var _c1$1 = ["*"];
|
|
5113
|
-
/**
|
|
5114
|
-
* Represents a Magic subform
|
|
5115
|
-
*/
|
|
5116
4008
|
var ErrorMagicComponent = /** @class */ (function () {
|
|
5117
|
-
/**
|
|
5118
|
-
* @ignore
|
|
5119
|
-
*/
|
|
5120
4009
|
function ErrorMagicComponent(_task, mgService, changeDetectorRef) {
|
|
5121
4010
|
this._task = _task;
|
|
5122
4011
|
this.mgService = mgService;
|
|
5123
4012
|
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
4013
|
this.defaultDisplay = true;
|
|
5126
4014
|
this.rowId = "0";
|
|
5127
4015
|
}
|
|
5128
4016
|
Object.defineProperty(ErrorMagicComponent.prototype, "magic", {
|
|
5129
|
-
/**
|
|
5130
|
-
* @ignore
|
|
5131
|
-
*/
|
|
5132
4017
|
set: function (val) {
|
|
5133
4018
|
this.id = val;
|
|
5134
4019
|
},
|
|
@@ -5153,10 +4038,6 @@
|
|
|
5153
4038
|
configurable: true
|
|
5154
4039
|
});
|
|
5155
4040
|
;
|
|
5156
|
-
/**
|
|
5157
|
-
* returns true if the html element has no children
|
|
5158
|
-
* @param element
|
|
5159
|
-
*/
|
|
5160
4041
|
ErrorMagicComponent.prototype.isEmpty = function (element) {
|
|
5161
4042
|
var nodes = element.childNodes;
|
|
5162
4043
|
for (var i = 0; i < nodes.length; i++) {
|
|
@@ -5167,9 +4048,6 @@
|
|
|
5167
4048
|
}
|
|
5168
4049
|
return true;
|
|
5169
4050
|
};
|
|
5170
|
-
/**
|
|
5171
|
-
* @ignore
|
|
5172
|
-
*/
|
|
5173
4051
|
ErrorMagicComponent.prototype.HasErrors = function (id) {
|
|
5174
4052
|
var e_1, _a;
|
|
5175
4053
|
if (!util.isUndefined(id)) {
|
|
@@ -5203,8 +4081,8 @@
|
|
|
5203
4081
|
};
|
|
5204
4082
|
return ErrorMagicComponent;
|
|
5205
4083
|
}());
|
|
5206
|
-
|
|
5207
|
-
|
|
4084
|
+
ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
4085
|
+
ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) {
|
|
5208
4086
|
if (rf & 1) {
|
|
5209
4087
|
i0.ɵɵviewQuery(_c0$2, true);
|
|
5210
4088
|
}
|
|
@@ -5221,7 +4099,7 @@
|
|
|
5221
4099
|
i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
|
5222
4100
|
}
|
|
5223
4101
|
}, directives: [i1.NgIf], encapsulation: 2 });
|
|
5224
|
-
|
|
4102
|
+
(function () {
|
|
5225
4103
|
i0.ɵsetClassMetadata(ErrorMagicComponent, [{
|
|
5226
4104
|
type: i0.Component,
|
|
5227
4105
|
args: [{
|
|
@@ -5240,31 +4118,22 @@
|
|
|
5240
4118
|
}] });
|
|
5241
4119
|
})();
|
|
5242
4120
|
|
|
5243
|
-
/**
|
|
5244
|
-
* Directive for checkboxes, to handle the 'change' event
|
|
5245
|
-
*/
|
|
5246
4121
|
var CheckboxMagicDirective = /** @class */ (function () {
|
|
5247
|
-
/**
|
|
5248
|
-
* @ignore
|
|
5249
|
-
*/
|
|
5250
4122
|
function CheckboxMagicDirective(magicDirective) {
|
|
5251
4123
|
this.magicDirective = magicDirective;
|
|
5252
4124
|
}
|
|
5253
|
-
/**
|
|
5254
|
-
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
|
5255
|
-
*/
|
|
5256
4125
|
CheckboxMagicDirective.prototype.onChange = function ($event) {
|
|
5257
4126
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5258
4127
|
};
|
|
5259
4128
|
return CheckboxMagicDirective;
|
|
5260
4129
|
}());
|
|
5261
|
-
|
|
5262
|
-
|
|
4130
|
+
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4131
|
+
CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) {
|
|
5263
4132
|
if (rf & 1) {
|
|
5264
4133
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5265
4134
|
}
|
|
5266
4135
|
} });
|
|
5267
|
-
|
|
4136
|
+
(function () {
|
|
5268
4137
|
i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
|
5269
4138
|
type: i0.Directive,
|
|
5270
4139
|
args: [{
|
|
@@ -5276,28 +4145,22 @@
|
|
|
5276
4145
|
}] });
|
|
5277
4146
|
})();
|
|
5278
4147
|
|
|
5279
|
-
/**
|
|
5280
|
-
* Directive for comboboxes, to handle the 'change' event
|
|
5281
|
-
*/
|
|
5282
4148
|
var ComboboxMagicDirective = /** @class */ (function () {
|
|
5283
4149
|
function ComboboxMagicDirective(magicDirective) {
|
|
5284
4150
|
this.magicDirective = magicDirective;
|
|
5285
4151
|
}
|
|
5286
|
-
/**
|
|
5287
|
-
* Handles the Combobox 'change' event - pass it to the Magic engine
|
|
5288
|
-
*/
|
|
5289
4152
|
ComboboxMagicDirective.prototype.onChange = function ($event) {
|
|
5290
4153
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5291
4154
|
};
|
|
5292
4155
|
return ComboboxMagicDirective;
|
|
5293
4156
|
}());
|
|
5294
|
-
|
|
5295
|
-
|
|
4157
|
+
ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4158
|
+
ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) {
|
|
5296
4159
|
if (rf & 1) {
|
|
5297
4160
|
i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5298
4161
|
}
|
|
5299
4162
|
} });
|
|
5300
|
-
|
|
4163
|
+
(function () {
|
|
5301
4164
|
i0.ɵsetClassMetadata(ComboboxMagicDirective, [{
|
|
5302
4165
|
type: i0.Directive,
|
|
5303
4166
|
args: [{
|
|
@@ -5309,23 +4172,17 @@
|
|
|
5309
4172
|
}] });
|
|
5310
4173
|
})();
|
|
5311
4174
|
|
|
5312
|
-
/**
|
|
5313
|
-
* This service supports custom actions on magic exit
|
|
5314
|
-
*/
|
|
5315
4175
|
var ExitMagicService = /** @class */ (function () {
|
|
5316
4176
|
function ExitMagicService() {
|
|
5317
4177
|
}
|
|
5318
|
-
/**
|
|
5319
|
-
* Override this method to implement custom logic on magic exit
|
|
5320
|
-
*/
|
|
5321
4178
|
ExitMagicService.prototype.exitMagic = function () {
|
|
5322
4179
|
console.log("Magic application terminated");
|
|
5323
4180
|
};
|
|
5324
4181
|
return ExitMagicService;
|
|
5325
4182
|
}());
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
4183
|
+
ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
|
|
4184
|
+
ExitMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
|
4185
|
+
(function () {
|
|
5329
4186
|
i0.ɵsetClassMetadata(ExitMagicService, [{
|
|
5330
4187
|
type: i0.Injectable
|
|
5331
4188
|
}], null, null);
|
|
@@ -5359,19 +4216,7 @@
|
|
|
5359
4216
|
i0.ɵɵelement(0, "div", 9);
|
|
5360
4217
|
}
|
|
5361
4218
|
}
|
|
5362
|
-
/**
|
|
5363
|
-
* Root Magic component
|
|
5364
|
-
*/
|
|
5365
4219
|
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
4220
|
function MagicShellComponent(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
|
|
5376
4221
|
this.engineMagicService = engineMagicService;
|
|
5377
4222
|
this.componentList = componentList;
|
|
@@ -5381,32 +4226,22 @@
|
|
|
5381
4226
|
this.httpClient = httpClient;
|
|
5382
4227
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
5383
4228
|
this.exitMagicService = exitMagicService;
|
|
5384
|
-
/**
|
|
5385
|
-
* Root component to be displayed in the window
|
|
5386
|
-
*/
|
|
5387
4229
|
this.RootComponent = null;
|
|
5388
4230
|
this.magicEngineTerminated = false;
|
|
5389
4231
|
this.initialize();
|
|
5390
4232
|
this.setTitle();
|
|
5391
4233
|
}
|
|
5392
|
-
/**
|
|
5393
|
-
* Before-unload event listener
|
|
5394
|
-
* @param event
|
|
5395
|
-
*/
|
|
5396
4234
|
MagicShellComponent.prototype.onBeforeUnload = function (event) {
|
|
5397
4235
|
if (this.engineMagicService.TransCacheExists()) {
|
|
5398
|
-
// Show the confirmation box before unloading the browser
|
|
5399
4236
|
event.returnValue = 'Are you sure?';
|
|
5400
4237
|
return 'Are you sure?';
|
|
5401
4238
|
}
|
|
5402
4239
|
else {
|
|
5403
|
-
// terminate the magic server context using fetch API with keep-alive
|
|
5404
4240
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
5405
4241
|
this.magicEngineTerminated = true;
|
|
5406
4242
|
}
|
|
5407
4243
|
};
|
|
5408
4244
|
MagicShellComponent.prototype.onUnload = function (event) {
|
|
5409
|
-
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
|
5410
4245
|
if (!this.magicEngineTerminated)
|
|
5411
4246
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
5412
4247
|
};
|
|
@@ -5417,26 +4252,13 @@
|
|
|
5417
4252
|
MagicShellComponent.prototype.setViewContainerRef = function (vcRef) {
|
|
5418
4253
|
this.overlayWindowsContainerViewRef = vcRef;
|
|
5419
4254
|
};
|
|
5420
|
-
/**
|
|
5421
|
-
* Initialization of Magic mechanisms
|
|
5422
|
-
*/
|
|
5423
4255
|
MagicShellComponent.prototype.initialize = function () {
|
|
5424
4256
|
this.registerUICommands();
|
|
5425
4257
|
};
|
|
5426
|
-
/**
|
|
5427
|
-
* Set the title
|
|
5428
|
-
*/
|
|
5429
4258
|
MagicShellComponent.prototype.setTitle = function () {
|
|
5430
4259
|
var newTitle = this.componentList.title;
|
|
5431
4260
|
this.titleService.setTitle(newTitle);
|
|
5432
4261
|
};
|
|
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
4262
|
MagicShellComponent.prototype.setComponent = function (formName, taskId, taskDescription, isModal) {
|
|
5441
4263
|
this.pendingCommandsCollector.startCollecting();
|
|
5442
4264
|
if (isModal) {
|
|
@@ -5448,9 +4270,6 @@
|
|
|
5448
4270
|
}
|
|
5449
4271
|
this.changeDetectorRef.detectChanges();
|
|
5450
4272
|
};
|
|
5451
|
-
/**
|
|
5452
|
-
* @ignore
|
|
5453
|
-
*/
|
|
5454
4273
|
MagicShellComponent.prototype.registerUICommands = function () {
|
|
5455
4274
|
var _this = this;
|
|
5456
4275
|
this.engineMagicService.refreshDom.pipe(operators.filter(function (command) { return command.TaskTag === '0'; }))
|
|
@@ -5463,10 +4282,6 @@
|
|
|
5463
4282
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, _this.overlayWindowService);
|
|
5464
4283
|
});
|
|
5465
4284
|
};
|
|
5466
|
-
/**
|
|
5467
|
-
* Execute commands received from the Magic WebClient engine
|
|
5468
|
-
* @param command
|
|
5469
|
-
*/
|
|
5470
4285
|
MagicShellComponent.prototype.executeCommand = function (command) {
|
|
5471
4286
|
switch (command.CommandType) {
|
|
5472
4287
|
case gui.CommandType.OPEN_FORM:
|
|
@@ -5481,7 +4296,7 @@
|
|
|
5481
4296
|
this.RootComponentParameters = {};
|
|
5482
4297
|
this.changeDetectorRef.detectChanges();
|
|
5483
4298
|
}
|
|
5484
|
-
else {
|
|
4299
|
+
else {
|
|
5485
4300
|
this.overlayWindowService.close(command.str);
|
|
5486
4301
|
this.changeDetectorRef.detectChanges();
|
|
5487
4302
|
}
|
|
@@ -5499,12 +4314,15 @@
|
|
|
5499
4314
|
if (this.exitMagicService)
|
|
5500
4315
|
this.exitMagicService.exitMagic();
|
|
5501
4316
|
break;
|
|
4317
|
+
case gui.CommandType.SHOW_HTML_ERROR:
|
|
4318
|
+
window.document.write(command.str);
|
|
4319
|
+
break;
|
|
5502
4320
|
}
|
|
5503
4321
|
};
|
|
5504
4322
|
return MagicShellComponent;
|
|
5505
4323
|
}());
|
|
5506
|
-
|
|
5507
|
-
|
|
4324
|
+
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)); };
|
|
4325
|
+
MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) {
|
|
5508
4326
|
if (rf & 1) {
|
|
5509
4327
|
i0.ɵɵstaticViewQuery(_c0$3, true);
|
|
5510
4328
|
}
|
|
@@ -5516,9 +4334,7 @@
|
|
|
5516
4334
|
if (rf & 1) {
|
|
5517
4335
|
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
4336
|
}
|
|
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) {
|
|
4337
|
+
}, 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
4338
|
if (rf & 1) {
|
|
5523
4339
|
i0.ɵɵelementStart(0, "div", null, 0);
|
|
5524
4340
|
i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
|
|
@@ -5534,14 +4350,12 @@
|
|
|
5534
4350
|
i0.ɵɵproperty("ngIf", ctx.showSpinner);
|
|
5535
4351
|
}
|
|
5536
4352
|
}, 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
|
-
|
|
4353
|
+
(function () {
|
|
5538
4354
|
i0.ɵsetClassMetadata(MagicShellComponent, [{
|
|
5539
4355
|
type: i0.Component,
|
|
5540
4356
|
args: [{
|
|
5541
4357
|
selector: 'magic-root',
|
|
5542
|
-
providers: [
|
|
5543
|
-
// ExitMagicService
|
|
5544
|
-
],
|
|
4358
|
+
providers: [],
|
|
5545
4359
|
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
4360
|
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
4361
|
}]
|
|
@@ -5563,17 +4377,11 @@
|
|
|
5563
4377
|
}] });
|
|
5564
4378
|
})();
|
|
5565
4379
|
|
|
5566
|
-
/**
|
|
5567
|
-
* @ignore
|
|
5568
|
-
*/
|
|
5569
4380
|
var CHECKBOX_VALUE_ACCESSOR = {
|
|
5570
4381
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
5571
4382
|
useExisting: i0.forwardRef(function () { return MagicCheckboxControlValueAccessor; }),
|
|
5572
4383
|
multi: true,
|
|
5573
4384
|
};
|
|
5574
|
-
/**
|
|
5575
|
-
* Value accessor for Checkbox without a FormControl
|
|
5576
|
-
*/
|
|
5577
4385
|
var MagicCheckboxControlValueAccessor = /** @class */ (function (_super) {
|
|
5578
4386
|
__extends(MagicCheckboxControlValueAccessor, _super);
|
|
5579
4387
|
function MagicCheckboxControlValueAccessor() {
|
|
@@ -5581,14 +4389,14 @@
|
|
|
5581
4389
|
}
|
|
5582
4390
|
return MagicCheckboxControlValueAccessor;
|
|
5583
4391
|
}(forms.CheckboxControlValueAccessor));
|
|
5584
|
-
|
|
5585
|
-
|
|
4392
|
+
MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
|
|
4393
|
+
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
4394
|
if (rf & 1) {
|
|
5587
4395
|
i0.ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5588
4396
|
}
|
|
5589
4397
|
}, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
5590
|
-
var ɵMagicCheckboxControlValueAccessor_BaseFactory =
|
|
5591
|
-
|
|
4398
|
+
var ɵMagicCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
|
|
4399
|
+
(function () {
|
|
5592
4400
|
i0.ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
|
5593
4401
|
type: i0.Directive,
|
|
5594
4402
|
args: [{
|
|
@@ -5599,17 +4407,11 @@
|
|
|
5599
4407
|
}], null, null);
|
|
5600
4408
|
})();
|
|
5601
4409
|
|
|
5602
|
-
/**
|
|
5603
|
-
* @ignore
|
|
5604
|
-
*/
|
|
5605
4410
|
var MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
|
5606
4411
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
5607
4412
|
useExisting: i0.forwardRef(function () { return MagicDefaultValueAccessor; }),
|
|
5608
4413
|
multi: true
|
|
5609
4414
|
};
|
|
5610
|
-
/**
|
|
5611
|
-
* @ignore
|
|
5612
|
-
*/
|
|
5613
4415
|
var MagicDefaultValueAccessor = /** @class */ (function (_super) {
|
|
5614
4416
|
__extends(MagicDefaultValueAccessor, _super);
|
|
5615
4417
|
function MagicDefaultValueAccessor() {
|
|
@@ -5617,14 +4419,14 @@
|
|
|
5617
4419
|
}
|
|
5618
4420
|
return MagicDefaultValueAccessor;
|
|
5619
4421
|
}(forms.DefaultValueAccessor));
|
|
5620
|
-
|
|
5621
|
-
|
|
4422
|
+
MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
|
|
4423
|
+
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
4424
|
if (rf & 1) {
|
|
5623
4425
|
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
4426
|
}
|
|
5625
4427
|
}, exportAs: ["magic"], features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
|
5626
|
-
var ɵMagicDefaultValueAccessor_BaseFactory =
|
|
5627
|
-
|
|
4428
|
+
var ɵMagicDefaultValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
|
|
4429
|
+
(function () {
|
|
5628
4430
|
i0.ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
|
5629
4431
|
type: i0.Directive,
|
|
5630
4432
|
args: [{
|
|
@@ -5641,28 +4443,22 @@
|
|
|
5641
4443
|
}], null, null);
|
|
5642
4444
|
})();
|
|
5643
4445
|
|
|
5644
|
-
/**
|
|
5645
|
-
* Directive for checkboxes which should not have a form control
|
|
5646
|
-
*/
|
|
5647
4446
|
var CheckboxNoFormControlMagicDirective = /** @class */ (function () {
|
|
5648
4447
|
function CheckboxNoFormControlMagicDirective(magicDirective) {
|
|
5649
4448
|
this.magicDirective = magicDirective;
|
|
5650
4449
|
}
|
|
5651
|
-
/**
|
|
5652
|
-
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
|
5653
|
-
*/
|
|
5654
4450
|
CheckboxNoFormControlMagicDirective.prototype.onChange = function ($event) {
|
|
5655
4451
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5656
4452
|
};
|
|
5657
4453
|
return CheckboxNoFormControlMagicDirective;
|
|
5658
4454
|
}());
|
|
5659
|
-
|
|
5660
|
-
|
|
4455
|
+
CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4456
|
+
CheckboxNoFormControlMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) {
|
|
5661
4457
|
if (rf & 1) {
|
|
5662
4458
|
i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5663
4459
|
}
|
|
5664
4460
|
} });
|
|
5665
|
-
|
|
4461
|
+
(function () {
|
|
5666
4462
|
i0.ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
|
5667
4463
|
type: i0.Directive,
|
|
5668
4464
|
args: [{
|
|
@@ -5674,28 +4470,22 @@
|
|
|
5674
4470
|
}] });
|
|
5675
4471
|
})();
|
|
5676
4472
|
|
|
5677
|
-
/**
|
|
5678
|
-
* Directive for non-checkbox input controls which do not have a form control
|
|
5679
|
-
*/
|
|
5680
4473
|
var InputNoFormControlMagicDirective = /** @class */ (function () {
|
|
5681
4474
|
function InputNoFormControlMagicDirective(magicDirective) {
|
|
5682
4475
|
this.magicDirective = magicDirective;
|
|
5683
4476
|
}
|
|
5684
|
-
/**
|
|
5685
|
-
* Handles the 'change' event - pass it to the Magic engine
|
|
5686
|
-
*/
|
|
5687
4477
|
InputNoFormControlMagicDirective.prototype.onChange = function ($event) {
|
|
5688
4478
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
|
5689
4479
|
};
|
|
5690
4480
|
return InputNoFormControlMagicDirective;
|
|
5691
4481
|
}());
|
|
5692
|
-
|
|
5693
|
-
|
|
4482
|
+
InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
|
4483
|
+
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
4484
|
if (rf & 1) {
|
|
5695
4485
|
i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5696
4486
|
}
|
|
5697
4487
|
} });
|
|
5698
|
-
|
|
4488
|
+
(function () {
|
|
5699
4489
|
i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
|
5700
4490
|
type: i0.Directive,
|
|
5701
4491
|
args: [{
|
|
@@ -5712,14 +4502,6 @@
|
|
|
5712
4502
|
useExisting: i0.forwardRef(function () { return DateValueAccessor; }),
|
|
5713
4503
|
multi: true
|
|
5714
4504
|
};
|
|
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
4505
|
var DateValueAccessor = /** @class */ (function () {
|
|
5724
4506
|
function DateValueAccessor(renderer, elementRef) {
|
|
5725
4507
|
this.renderer = renderer;
|
|
@@ -5727,7 +4509,6 @@
|
|
|
5727
4509
|
this.onChange = function (_) { };
|
|
5728
4510
|
this.onTouched = function () { };
|
|
5729
4511
|
}
|
|
5730
|
-
/** Writes a new value to the element (model -> view) */
|
|
5731
4512
|
DateValueAccessor.prototype.writeValue = function (value) {
|
|
5732
4513
|
if (!value) {
|
|
5733
4514
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
|
@@ -5735,29 +4516,26 @@
|
|
|
5735
4516
|
}
|
|
5736
4517
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
|
5737
4518
|
};
|
|
5738
|
-
/** Registers a callback function, called when value changes (view -> model) */
|
|
5739
4519
|
DateValueAccessor.prototype.registerOnChange = function (fn) {
|
|
5740
4520
|
this.onChange = function (v) { return fn(v instanceof Date
|
|
5741
4521
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
|
5742
4522
|
: v); };
|
|
5743
4523
|
};
|
|
5744
|
-
/** Registers a callback function, called when the control is blurred */
|
|
5745
4524
|
DateValueAccessor.prototype.registerOnTouched = function (fn) {
|
|
5746
4525
|
this.onTouched = fn;
|
|
5747
4526
|
};
|
|
5748
|
-
/** Enables or disables the element when the control status changes */
|
|
5749
4527
|
DateValueAccessor.prototype.setDisabledState = function (isDisabled) {
|
|
5750
4528
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
|
5751
4529
|
};
|
|
5752
4530
|
return DateValueAccessor;
|
|
5753
4531
|
}());
|
|
5754
|
-
|
|
5755
|
-
|
|
4532
|
+
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
|
4533
|
+
DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) {
|
|
5756
4534
|
if (rf & 1) {
|
|
5757
4535
|
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5758
4536
|
}
|
|
5759
4537
|
}, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
|
5760
|
-
|
|
4538
|
+
(function () {
|
|
5761
4539
|
i0.ɵsetClassMetadata(DateValueAccessor, [{
|
|
5762
4540
|
type: i0.Directive,
|
|
5763
4541
|
args: [{
|
|
@@ -5773,25 +4551,12 @@
|
|
|
5773
4551
|
}] });
|
|
5774
4552
|
})();
|
|
5775
4553
|
|
|
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
4554
|
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
4555
|
function NonMagicControlDirective(_task, element, renderer, vcRef) {
|
|
5788
4556
|
this._task = _task;
|
|
5789
4557
|
this.element = element;
|
|
5790
4558
|
this.renderer = renderer;
|
|
5791
4559
|
this.vcRef = vcRef;
|
|
5792
|
-
/**
|
|
5793
|
-
* Collection of event handlers for this element
|
|
5794
|
-
*/
|
|
5795
4560
|
this.eventHandlers = {};
|
|
5796
4561
|
this.eventsOnlyVal = false;
|
|
5797
4562
|
this.htmlElement = this.element.nativeElement;
|
|
@@ -5806,45 +4571,31 @@
|
|
|
5806
4571
|
});
|
|
5807
4572
|
;
|
|
5808
4573
|
Object.defineProperty(NonMagicControlDirective.prototype, "task", {
|
|
5809
|
-
/**
|
|
5810
|
-
* Get the task service
|
|
5811
|
-
* @returns
|
|
5812
|
-
*/
|
|
5813
4574
|
get: function () {
|
|
5814
4575
|
return this._task;
|
|
5815
4576
|
},
|
|
5816
4577
|
enumerable: false,
|
|
5817
4578
|
configurable: true
|
|
5818
4579
|
});
|
|
5819
|
-
/**
|
|
5820
|
-
* Register to the events this element may need to handle
|
|
5821
|
-
*/
|
|
5822
4580
|
NonMagicControlDirective.prototype.regEvents = function () {
|
|
5823
4581
|
var _this = this;
|
|
5824
|
-
// Handle events for which event handler may be removed and restored
|
|
5825
4582
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
5826
4583
|
Object.keys(this.eventHandlers).forEach(function (key) {
|
|
5827
4584
|
_this.focusUnlistener = _this.renderer.listen(_this.htmlElement, key, _this.eventHandlers[key]);
|
|
5828
4585
|
});
|
|
5829
4586
|
};
|
|
5830
|
-
/**
|
|
5831
|
-
* Handle focus event
|
|
5832
|
-
*/
|
|
5833
4587
|
NonMagicControlDirective.prototype.OnFocus = function () {
|
|
5834
4588
|
this.task.insertEvent(engine.getGuiEventObj('focusOnNonMagicControl', "", -1));
|
|
5835
4589
|
event.cancelBubble = true;
|
|
5836
4590
|
};
|
|
5837
|
-
/**
|
|
5838
|
-
* Initialize this object
|
|
5839
|
-
*/
|
|
5840
4591
|
NonMagicControlDirective.prototype.ngOnInit = function () {
|
|
5841
4592
|
this.regEvents();
|
|
5842
4593
|
};
|
|
5843
4594
|
return NonMagicControlDirective;
|
|
5844
4595
|
}());
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
4596
|
+
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)); };
|
|
4597
|
+
NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
|
|
4598
|
+
(function () {
|
|
5848
4599
|
i0.ɵsetClassMetadata(NonMagicControlDirective, [{
|
|
5849
4600
|
type: i0.Directive,
|
|
5850
4601
|
args: [{
|
|
@@ -5856,9 +4607,6 @@
|
|
|
5856
4607
|
}] });
|
|
5857
4608
|
})();
|
|
5858
4609
|
|
|
5859
|
-
/**
|
|
5860
|
-
* @ignore
|
|
5861
|
-
*/
|
|
5862
4610
|
var decs = [
|
|
5863
4611
|
MagicDirective,
|
|
5864
4612
|
CheckboxMagicDirective,
|
|
@@ -5889,9 +4637,6 @@
|
|
|
5889
4637
|
MagicFocusDirective,
|
|
5890
4638
|
MagicViewContainerRef
|
|
5891
4639
|
];
|
|
5892
|
-
/**
|
|
5893
|
-
* @ignore
|
|
5894
|
-
*/
|
|
5895
4640
|
var MagicModule = /** @class */ (function () {
|
|
5896
4641
|
function MagicModule() {
|
|
5897
4642
|
}
|
|
@@ -5909,12 +4654,11 @@
|
|
|
5909
4654
|
};
|
|
5910
4655
|
return MagicModule;
|
|
5911
4656
|
}());
|
|
5912
|
-
|
|
5913
|
-
|
|
4657
|
+
MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
|
|
4658
|
+
MagicModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
|
|
5914
4659
|
i1.CommonModule,
|
|
5915
4660
|
forms.FormsModule,
|
|
5916
4661
|
forms.ReactiveFormsModule,
|
|
5917
|
-
//ThemeModule,
|
|
5918
4662
|
i2.RouterModule,
|
|
5919
4663
|
i3.DynamicModule,
|
|
5920
4664
|
i5.HttpClientModule
|
|
@@ -5950,7 +4694,6 @@
|
|
|
5950
4694
|
MagicViewContainerRef], imports: [i1.CommonModule,
|
|
5951
4695
|
forms.FormsModule,
|
|
5952
4696
|
forms.ReactiveFormsModule,
|
|
5953
|
-
//ThemeModule,
|
|
5954
4697
|
i2.RouterModule,
|
|
5955
4698
|
i3.DynamicModule,
|
|
5956
4699
|
i5.HttpClientModule], exports: [MagicDirective,
|
|
@@ -5982,7 +4725,7 @@
|
|
|
5982
4725
|
MagicFocusDirective,
|
|
5983
4726
|
MagicViewContainerRef] });
|
|
5984
4727
|
})();
|
|
5985
|
-
|
|
4728
|
+
(function () {
|
|
5986
4729
|
i0.ɵsetClassMetadata(MagicModule, [{
|
|
5987
4730
|
type: i0.NgModule,
|
|
5988
4731
|
args: [{
|
|
@@ -5993,12 +4736,10 @@
|
|
|
5993
4736
|
i1.CommonModule,
|
|
5994
4737
|
forms.FormsModule,
|
|
5995
4738
|
forms.ReactiveFormsModule,
|
|
5996
|
-
//ThemeModule,
|
|
5997
4739
|
i2.RouterModule,
|
|
5998
4740
|
i3.DynamicModule,
|
|
5999
4741
|
i5.HttpClientModule
|
|
6000
4742
|
],
|
|
6001
|
-
//Customizable providers
|
|
6002
4743
|
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
|
|
6003
4744
|
}]
|
|
6004
4745
|
}], null, null);
|
|
@@ -6089,7 +4830,7 @@
|
|
|
6089
4830
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
6090
4831
|
if (displayFormat === 'input') {
|
|
6091
4832
|
if (this.mgdtfmt == null)
|
|
6092
|
-
this.mgdtfmt = 'M/d/yyyy';
|
|
4833
|
+
this.mgdtfmt = 'M/d/yyyy';
|
|
6093
4834
|
return i1.formatDate(date, this.mgdtfmt, this.locale);
|
|
6094
4835
|
}
|
|
6095
4836
|
else {
|
|
@@ -6098,9 +4839,9 @@
|
|
|
6098
4839
|
};
|
|
6099
4840
|
return MgDateAdapter;
|
|
6100
4841
|
}(core.NativeDateAdapter));
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
4842
|
+
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$2.Platform), i0.ɵɵinject(TaskMagicService)); };
|
|
4843
|
+
MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
4844
|
+
(function () {
|
|
6104
4845
|
i0.ɵsetClassMetadata(MgDateAdapter, [{
|
|
6105
4846
|
type: i0.Injectable
|
|
6106
4847
|
}], function () { return [{ type: i1$2.Platform }, { type: TaskMagicService }]; }, null);
|
|
@@ -6110,9 +4851,6 @@
|
|
|
6110
4851
|
{ provide: core.DateAdapter, useClass: MgDateAdapter },
|
|
6111
4852
|
{ provide: core.MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
|
6112
4853
|
];
|
|
6113
|
-
/**
|
|
6114
|
-
* Magic service providers
|
|
6115
|
-
*/
|
|
6116
4854
|
var basicMagicProviders = [
|
|
6117
4855
|
MagicServices,
|
|
6118
4856
|
TaskMagicService,
|
|
@@ -6125,20 +4863,9 @@
|
|
|
6125
4863
|
TableMagicService
|
|
6126
4864
|
]);
|
|
6127
4865
|
|
|
6128
|
-
/**
|
|
6129
|
-
* @ignore
|
|
6130
|
-
*/
|
|
6131
|
-
///////////////////////////////////////////////////////////
|
|
6132
|
-
// class to hold gui-related helper methods
|
|
6133
|
-
///////////////////////////////////////////////////////////
|
|
6134
4866
|
var utils = /** @class */ (function () {
|
|
6135
4867
|
function utils() {
|
|
6136
4868
|
}
|
|
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
4869
|
utils.addChildren = function (parent, children, selector) {
|
|
6143
4870
|
for (var i = 0; i < parent.children.length; i++) {
|
|
6144
4871
|
if (typeof parent.children[i].attributes[selector] !== "undefined") {
|
|
@@ -6147,9 +4874,6 @@
|
|
|
6147
4874
|
this.addChildren(parent.children[i], children, selector);
|
|
6148
4875
|
}
|
|
6149
4876
|
};
|
|
6150
|
-
///////////////////////////////////////////////////////////
|
|
6151
|
-
// Calculate the distance between the control and the supplied x,y coordinates
|
|
6152
|
-
///////////////////////////////////////////////////////////
|
|
6153
4877
|
utils.getDistance = function (control, x, y) {
|
|
6154
4878
|
var left = control.clientLeft, top = control.clientTop;
|
|
6155
4879
|
var dx, dy;
|
|
@@ -6176,9 +4900,6 @@
|
|
|
6176
4900
|
var ret = (dx * dx + dy * dy);
|
|
6177
4901
|
return ret;
|
|
6178
4902
|
};
|
|
6179
|
-
///////////////////////////////////////////////////////////
|
|
6180
|
-
//
|
|
6181
|
-
///////////////////////////////////////////////////////////
|
|
6182
4903
|
utils.getDimentions = function (el) {
|
|
6183
4904
|
var xPos = 0;
|
|
6184
4905
|
var yPos = 0;
|
|
@@ -6186,14 +4907,12 @@
|
|
|
6186
4907
|
var height = el.height;
|
|
6187
4908
|
while (el) {
|
|
6188
4909
|
if (el.tagName == "BODY") {
|
|
6189
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
6190
4910
|
var xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
6191
4911
|
var yScroll = el.scrollTop || document.documentElement.scrollTop;
|
|
6192
4912
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
|
6193
4913
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
|
6194
4914
|
}
|
|
6195
4915
|
else {
|
|
6196
|
-
// for all other non-BODY elements
|
|
6197
4916
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
|
6198
4917
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
|
6199
4918
|
}
|
|
@@ -6209,9 +4928,6 @@
|
|
|
6209
4928
|
return utils;
|
|
6210
4929
|
}());
|
|
6211
4930
|
|
|
6212
|
-
/**
|
|
6213
|
-
* @ignore
|
|
6214
|
-
*/
|
|
6215
4931
|
var ModalFormDefinition = /** @class */ (function () {
|
|
6216
4932
|
function ModalFormDefinition() {
|
|
6217
4933
|
this.taskId = "";
|
|
@@ -6221,10 +4937,6 @@
|
|
|
6221
4937
|
return ModalFormDefinition;
|
|
6222
4938
|
}());
|
|
6223
4939
|
|
|
6224
|
-
/**
|
|
6225
|
-
* Generated bundle index. Do not edit.
|
|
6226
|
-
*/
|
|
6227
|
-
|
|
6228
4940
|
exports.AccessorMagicService = AccessorMagicService;
|
|
6229
4941
|
exports.BaseMagicAlertComponent = BaseMagicAlertComponent;
|
|
6230
4942
|
exports.BaseMagicConfirmComponent = BaseMagicConfirmComponent;
|