@magic-xpa/angular 4.1200.0-dev4120.34 → 4.1200.0-dev4120.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/magic-xpa-angular.mjs +1767 -183
- package/fesm2022/magic-xpa-angular.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/package.json +6 -8
- package/src/controls.metadata.model.d.ts +16 -0
- package/src/interfaces/sub-form-definition.iterface.d.ts +6 -0
- package/src/magic.core.module.d.ts +5 -3
- package/src/services/OverlayWindowService.d.ts +19 -0
- package/src/services/StylesMapManager.d.ts +3 -0
- package/src/services/accessor.magic.service.d.ts +242 -3
- package/src/services/commands-collector.magic.service.d.ts +3 -0
- package/src/services/component-list.magic.service.d.ts +27 -0
- package/src/services/confirmation.components.magic.provider.d.ts +16 -0
- package/src/services/engine.magic.service.d.ts +3 -0
- package/src/services/exit.magic.service.d.ts +6 -0
- package/src/services/magic-color.service.d.ts +6 -0
- package/src/services/magic.providers.d.ts +3 -0
- package/src/services/magic.services.d.ts +6 -0
- package/src/services/router-commands.magic.service.d.ts +6 -0
- package/src/services/subform.magic.service.d.ts +28 -0
- package/src/services/table.magic.service.d.ts +56 -0
- package/src/services/task.magics.service.d.ts +300 -0
- package/src/services/title.magic.service.d.ts +11 -0
- package/src/ui/GuiInteractiveExecutor.d.ts +3 -0
- package/src/ui/components/base-magic-alert.component.d.ts +16 -0
- package/src/ui/components/base-magic-confirm.component.d.ts +18 -0
- package/src/ui/components/magic-alert.component.d.ts +3 -0
- package/src/ui/components/magic-confirmation-box.component.d.ts +3 -0
- package/src/ui/directives/NonMagicControlDirective.d.ts +41 -0
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +6 -0
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +12 -0
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +9 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +6 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +13 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +6 -0
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +6 -0
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +3 -0
- package/src/ui/directives/magic/row.magic.directive.d.ts +15 -0
- package/src/ui/directives/magic-focus.directive.d.ts +3 -0
- package/src/ui/directives/magic.directive.d.ts +82 -0
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +3 -0
- package/src/ui/directives/mgformat.magic.directive.d.ts +44 -0
- package/src/ui/directives/range-validator.magic.directive.d.ts +16 -0
- package/src/ui/magic-confirmationBox.d.ts +19 -0
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +9 -0
- package/src/ui/magic-modal/magic-modal-form.d.ts +3 -0
- package/src/ui/magic-modal/magic-modal-interface.d.ts +27 -0
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +20 -0
- package/src/ui/magic-modal/magic-overlay-container.d.ts +51 -0
- package/src/ui/magic-root.component.d.ts +42 -0
- package/src/ui/mgerror.magic.component.d.ts +19 -0
- package/src/ui/pipes/date.magic.pipe.d.ts +6 -0
- package/src/ui/pipes/time.magic.pipe.d.ts +3 -0
- package/src/ui/router-container.magic.component.d.ts +19 -0
- package/src/ui/subform.magic.component.d.ts +21 -0
- package/src/ui/task-base.magic.component.d.ts +78 -0
- package/src/ui/utils.d.ts +3 -0
- package/esm2022/index.mjs +0 -59
- package/esm2022/magic-xpa-angular.mjs +0 -2
- package/esm2022/src/controls.metadata.model.mjs +0 -183
- package/esm2022/src/interfaces/sub-form-definition.iterface.mjs +0 -2
- package/esm2022/src/magic.core.module.mjs +0 -159
- package/esm2022/src/services/ISubformMagicService.mjs +0 -2
- package/esm2022/src/services/OverlayWindowService.mjs +0 -245
- package/esm2022/src/services/StylesMapManager.mjs +0 -28
- package/esm2022/src/services/accessor.magic.service.mjs +0 -365
- package/esm2022/src/services/commands-collector.magic.service.mjs +0 -47
- package/esm2022/src/services/component-list.magic.service.mjs +0 -45
- package/esm2022/src/services/confirmation.components.magic.provider.mjs +0 -21
- package/esm2022/src/services/engine.magic.service.mjs +0 -80
- package/esm2022/src/services/exit.magic.service.mjs +0 -13
- package/esm2022/src/services/magic-color.service.mjs +0 -101
- package/esm2022/src/services/magic.lazy.loader.service.mjs +0 -16
- package/esm2022/src/services/magic.providers.mjs +0 -25
- package/esm2022/src/services/magic.services.mjs +0 -36
- package/esm2022/src/services/mg-date-adapter.mjs +0 -108
- package/esm2022/src/services/overlay.conainer.magic.provider.mjs +0 -14
- package/esm2022/src/services/router-commands.magic.service.mjs +0 -31
- package/esm2022/src/services/subform.magic.service.mjs +0 -195
- package/esm2022/src/services/table.magic.service.mjs +0 -81
- package/esm2022/src/services/task.magics.service.mjs +0 -648
- package/esm2022/src/services/title.magic.service.mjs +0 -19
- package/esm2022/src/ui/GuiInteractiveExecutor.mjs +0 -114
- package/esm2022/src/ui/components/base-magic-alert.component.mjs +0 -24
- package/esm2022/src/ui/components/base-magic-confirm.component.mjs +0 -24
- package/esm2022/src/ui/components/magic-alert.component.mjs +0 -36
- package/esm2022/src/ui/components/magic-confirmation-box.component.mjs +0 -42
- package/esm2022/src/ui/directives/NonMagicControlDirective.mjs +0 -58
- package/esm2022/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +0 -29
- package/esm2022/src/ui/directives/magic/checkbox.magic.directive.mjs +0 -100
- package/esm2022/src/ui/directives/magic/combobox.magic.directive.mjs +0 -37
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +0 -27
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +0 -85
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +0 -32
- package/esm2022/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +0 -28
- package/esm2022/src/ui/directives/magic/nocontrol.magic.directive.mjs +0 -193
- package/esm2022/src/ui/directives/magic/row.magic.directive.mjs +0 -62
- package/esm2022/src/ui/directives/magic-focus.directive.mjs +0 -20
- package/esm2022/src/ui/directives/magic.directive.mjs +0 -232
- package/esm2022/src/ui/directives/magicViewContainerRef.directive.mjs +0 -20
- package/esm2022/src/ui/directives/mgformat.magic.directive.mjs +0 -579
- package/esm2022/src/ui/directives/range-validator.magic.directive.mjs +0 -60
- package/esm2022/src/ui/magic-confirmationBox.mjs +0 -42
- package/esm2022/src/ui/magic-modal/base-magic-overlay-container.mjs +0 -22
- package/esm2022/src/ui/magic-modal/magic-modal-form.mjs +0 -6
- package/esm2022/src/ui/magic-modal/magic-modal-interface.mjs +0 -2
- package/esm2022/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +0 -125
- package/esm2022/src/ui/magic-modal/magic-overlay-container.mjs +0 -162
- package/esm2022/src/ui/magic-root.component.mjs +0 -236
- package/esm2022/src/ui/mgerror.magic.component.mjs +0 -125
- package/esm2022/src/ui/pipes/date.magic.pipe.mjs +0 -106
- package/esm2022/src/ui/pipes/time.magic.pipe.mjs +0 -52
- package/esm2022/src/ui/pipes/time24.magic.pipe.mjs +0 -35
- package/esm2022/src/ui/router-container.magic.component.mjs +0 -115
- package/esm2022/src/ui/subform.magic.component.mjs +0 -56
- package/esm2022/src/ui/task-base.magic.component.mjs +0 -91
- package/esm2022/src/ui/utils.mjs +0 -54
@@ -16,12 +16,15 @@ import { Subject, EMPTY, fromEvent } from 'rxjs';
|
|
16
16
|
import { __decorate, __metadata } from 'tslib';
|
17
17
|
import * as i1$1 from '@angular/platform-browser';
|
18
18
|
import * as i1$2 from '@angular/common/http';
|
19
|
-
import {
|
19
|
+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
20
20
|
import { maskitoTimeOptionsGenerator } from '@maskito/kit';
|
21
21
|
import * as i2$1 from '@angular/cdk/platform';
|
22
22
|
import { MaskitoModule } from '@maskito/angular';
|
23
23
|
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
24
24
|
|
25
|
+
/**
|
26
|
+
* @ignore
|
27
|
+
*/
|
25
28
|
class ControlMetadata {
|
26
29
|
controlType;
|
27
30
|
dataType;
|
@@ -31,9 +34,11 @@ class ControlMetadata {
|
|
31
34
|
removedClass;
|
32
35
|
classes;
|
33
36
|
rangeValidator;
|
37
|
+
// user properties
|
34
38
|
userProperties = new Map();
|
35
39
|
customValidators = new Map();
|
36
40
|
setClass(key, value) {
|
41
|
+
// for no-control - hold the name of the class to be removed later
|
37
42
|
if (this.classesMap.has(key)) {
|
38
43
|
this.removedClass = this.classesMap.get(key);
|
39
44
|
}
|
@@ -48,8 +53,13 @@ class ControlMetadata {
|
|
48
53
|
this.stylesMap.set(key, value);
|
49
54
|
}
|
50
55
|
}
|
56
|
+
/**
|
57
|
+
* @ignore
|
58
|
+
*/
|
51
59
|
class ControlsMetadata {
|
60
|
+
//values of control
|
52
61
|
values = new Map();
|
62
|
+
// dictionary of controls with there properties
|
53
63
|
ControlsProperties = new Map();
|
54
64
|
rowId;
|
55
65
|
isCreated = false;
|
@@ -63,6 +73,8 @@ class ControlsMetadata {
|
|
63
73
|
return this.ControlsProperties.get(controlId);
|
64
74
|
}
|
65
75
|
update(obj) {
|
76
|
+
//should we keep the values here ?
|
77
|
+
//this.values = obj.ControlsValues;
|
66
78
|
let props = obj.ControlsMetaData;
|
67
79
|
for (let controlName in props) {
|
68
80
|
if (!this.ControlsProperties.has(controlName))
|
@@ -91,15 +103,18 @@ class ControlsMetadata {
|
|
91
103
|
return this.values.get(controlName);
|
92
104
|
}
|
93
105
|
}
|
106
|
+
/**
|
107
|
+
* @ignore
|
108
|
+
*/
|
94
109
|
class Records {
|
95
110
|
data = new Map();
|
96
|
-
list = [];
|
111
|
+
list = []; //used for sequential access in table
|
97
112
|
includesFirst;
|
98
113
|
includesLast;
|
99
114
|
guiTopIndex;
|
100
115
|
recordsBeforeCurrentView = 0;
|
101
116
|
isEmptyDataView = false;
|
102
|
-
sizeUpdated = false;
|
117
|
+
sizeUpdated = false; //used for evaluating the RecordsSizeChange.
|
103
118
|
getRow(dvRowId) {
|
104
119
|
return this.list[dvRowId + this.recordsBeforeCurrentView];
|
105
120
|
}
|
@@ -122,14 +137,24 @@ class Records {
|
|
122
137
|
}
|
123
138
|
return false;
|
124
139
|
}
|
140
|
+
/*
|
141
|
+
* for row editing
|
142
|
+
* */
|
125
143
|
startRowEditing(guiRowId) {
|
126
144
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
127
145
|
this.data.get(guiRowId).isEditing = true;
|
128
146
|
}
|
147
|
+
/*
|
148
|
+
* stop row editing on row Id
|
149
|
+
* */
|
129
150
|
stopRowEditing(guiRowId) {
|
130
151
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
131
152
|
this.data.get(guiRowId).isEditing = false;
|
132
153
|
}
|
154
|
+
/*
|
155
|
+
* return if row is in editing
|
156
|
+
* Called by the HTML code, so parameter is a string, not a numebr
|
157
|
+
* */
|
133
158
|
isRowInRowEditing(guiRowId) {
|
134
159
|
if (+guiRowId < this.list.length) {
|
135
160
|
if (!this.data.has(+guiRowId) || isNullOrUndefined(this.data.get(+guiRowId)))
|
@@ -158,6 +183,7 @@ class Records {
|
|
158
183
|
updateSize(len) {
|
159
184
|
if (this.list.length != len) {
|
160
185
|
if (len < this.list.length) {
|
186
|
+
//remove rows
|
161
187
|
for (let i = len; i < this.list.length; i++) {
|
162
188
|
this.data.delete(i);
|
163
189
|
}
|
@@ -166,6 +192,10 @@ class Records {
|
|
166
192
|
this.sizeUpdated = true;
|
167
193
|
}
|
168
194
|
}
|
195
|
+
/**
|
196
|
+
* crears data for the first record
|
197
|
+
* @param template
|
198
|
+
*/
|
169
199
|
clearFirstTableRecord(template) {
|
170
200
|
if (this.list.length >= 1) {
|
171
201
|
for (const key in template) {
|
@@ -196,6 +226,9 @@ class Records {
|
|
196
226
|
return this.guiTopIndex;
|
197
227
|
}
|
198
228
|
}
|
229
|
+
/**
|
230
|
+
* @ignore
|
231
|
+
*/
|
199
232
|
var HtmlClasses;
|
200
233
|
(function (HtmlClasses) {
|
201
234
|
HtmlClasses["Color"] = "color";
|
@@ -204,6 +237,9 @@ var HtmlClasses;
|
|
204
237
|
HtmlClasses["HintColor"] = "hintcolor";
|
205
238
|
})(HtmlClasses || (HtmlClasses = {}));
|
206
239
|
|
240
|
+
/**
|
241
|
+
* @ignore
|
242
|
+
*/
|
207
243
|
class StylesMapManager {
|
208
244
|
static StylesMap = new Map([
|
209
245
|
[MagicProperties.LineDivider, new Map([[true, "solid"], [false, "hidden"]])],
|
@@ -230,10 +266,15 @@ class StylesMapManager {
|
|
230
266
|
}
|
231
267
|
}
|
232
268
|
|
269
|
+
/**
|
270
|
+
* @ignore
|
271
|
+
*/
|
233
272
|
class EngineMagicService {
|
234
273
|
magicBridge = MagicBridge;
|
235
274
|
isStub = false;
|
275
|
+
// true when user is logged in magic
|
236
276
|
isLoggedIn = false;
|
277
|
+
//TODO - unregister
|
237
278
|
refreshDom = new Subject();
|
238
279
|
interactiveCommands = new Subject();
|
239
280
|
startMagicEngine(httpClient, args) {
|
@@ -283,6 +324,7 @@ class EngineMagicService {
|
|
283
324
|
return this.magicBridge.GetFldRanges(taskId, controlName);
|
284
325
|
}
|
285
326
|
saveData(data) {
|
327
|
+
//this.magicBridge.saveData(data);
|
286
328
|
}
|
287
329
|
getIsLoggedIn() {
|
288
330
|
return this.isLoggedIn;
|
@@ -296,8 +338,8 @@ class EngineMagicService {
|
|
296
338
|
TerminateContextUsingFetchAPI() {
|
297
339
|
this.magicBridge.TerminateContextUsingFetchAPI();
|
298
340
|
}
|
299
|
-
static ɵfac = function EngineMagicService_Factory(
|
300
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac, providedIn: 'root' });
|
341
|
+
/** @nocollapse */ static ɵfac = function EngineMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EngineMagicService)(); };
|
342
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac, providedIn: 'root' });
|
301
343
|
}
|
302
344
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EngineMagicService, [{
|
303
345
|
type: Injectable,
|
@@ -306,8 +348,17 @@ class EngineMagicService {
|
|
306
348
|
}]
|
307
349
|
}], null, null); })();
|
308
350
|
|
351
|
+
/**
|
352
|
+
* Manages the list of components in a project, and the project title
|
353
|
+
*/
|
309
354
|
class ComponentListMagicService {
|
355
|
+
/**
|
356
|
+
* Map of project components
|
357
|
+
*/
|
310
358
|
components = new Map();
|
359
|
+
/**
|
360
|
+
* Map of project dialogs
|
361
|
+
*/
|
311
362
|
dialogs = new Map();
|
312
363
|
lazyLoadModulesMap = null;
|
313
364
|
getData(name, mustHaveData) {
|
@@ -320,6 +371,11 @@ class ComponentListMagicService {
|
|
320
371
|
data = this.components.get(name);
|
321
372
|
return data;
|
322
373
|
}
|
374
|
+
/**
|
375
|
+
* Return a component according to name
|
376
|
+
* @param name Name of requested component
|
377
|
+
* @returns The requested component
|
378
|
+
*/
|
323
379
|
getComponent(name, mustHaveData = true) {
|
324
380
|
let data = this.getData(name, mustHaveData);
|
325
381
|
return data ? data.component : null;
|
@@ -330,17 +386,30 @@ class ComponentListMagicService {
|
|
330
386
|
this.components.set(key, data);
|
331
387
|
}
|
332
388
|
}
|
389
|
+
/**
|
390
|
+
* Return a component according to name
|
391
|
+
* @param name Name of requested component
|
392
|
+
* @returns The requested component
|
393
|
+
*/
|
333
394
|
getModuleRef(name) {
|
334
395
|
let data = this.getData(name, false);
|
335
396
|
return data ? data.moduleRef : null;
|
336
397
|
;
|
337
398
|
}
|
399
|
+
/**
|
400
|
+
* Return the lazy load module details of the specified component
|
401
|
+
* @param name: Name of requested component
|
402
|
+
* @returns: lazy load module details
|
403
|
+
*/
|
338
404
|
getLazyLoadModuleData(name) {
|
339
405
|
return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
|
340
406
|
}
|
407
|
+
/**
|
408
|
+
* Project title
|
409
|
+
*/
|
341
410
|
title;
|
342
|
-
static ɵfac = function ComponentListMagicService_Factory(
|
343
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ComponentListMagicService, factory: ComponentListMagicService.ɵfac, providedIn: 'root' });
|
411
|
+
/** @nocollapse */ static ɵfac = function ComponentListMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComponentListMagicService)(); };
|
412
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ComponentListMagicService, factory: ComponentListMagicService.ɵfac, providedIn: 'root' });
|
344
413
|
}
|
345
414
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentListMagicService, [{
|
346
415
|
type: Injectable,
|
@@ -349,6 +418,9 @@ class ComponentListMagicService {
|
|
349
418
|
}]
|
350
419
|
}], null, null); })();
|
351
420
|
|
421
|
+
/**
|
422
|
+
* @ignore
|
423
|
+
*/
|
352
424
|
class CommandsCollectorMagicService {
|
353
425
|
magic;
|
354
426
|
count = 0;
|
@@ -380,8 +452,8 @@ class CommandsCollectorMagicService {
|
|
380
452
|
commands.forEach(command => { this.commands.Remove(command); });
|
381
453
|
return commands;
|
382
454
|
}
|
383
|
-
static ɵfac = function CommandsCollectorMagicService_Factory(
|
384
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
|
455
|
+
/** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
|
456
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
|
385
457
|
}
|
386
458
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
387
459
|
type: Injectable,
|
@@ -390,6 +462,9 @@ class CommandsCollectorMagicService {
|
|
390
462
|
}]
|
391
463
|
}], () => [{ type: EngineMagicService }], null); })();
|
392
464
|
|
465
|
+
/**
|
466
|
+
* @ignore
|
467
|
+
*/
|
393
468
|
class RouteCommand {
|
394
469
|
callerMgSubformServiceRef;
|
395
470
|
routerOutletName;
|
@@ -397,6 +472,9 @@ class RouteCommand {
|
|
397
472
|
parameters;
|
398
473
|
routeParams;
|
399
474
|
}
|
475
|
+
/**
|
476
|
+
* @ignore
|
477
|
+
*/
|
400
478
|
class RouterCommandsMagicService {
|
401
479
|
pendingRouteCommands = [];
|
402
480
|
AddRouteCommand(routeCommand) {
|
@@ -408,8 +486,8 @@ class RouterCommandsMagicService {
|
|
408
486
|
pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
|
409
487
|
}
|
410
488
|
}
|
411
|
-
static ɵfac = function RouterCommandsMagicService_Factory(
|
412
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac, providedIn: 'root' });
|
489
|
+
/** @nocollapse */ static ɵfac = function RouterCommandsMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterCommandsMagicService)(); };
|
490
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac, providedIn: 'root' });
|
413
491
|
}
|
414
492
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
|
415
493
|
type: Injectable,
|
@@ -422,8 +500,8 @@ class MagicLazyLoaderService {
|
|
422
500
|
Load(path) {
|
423
501
|
return Promise.reject('error in loading module :' + path);
|
424
502
|
}
|
425
|
-
static ɵfac = function MagicLazyLoaderService_Factory(
|
426
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicLazyLoaderService, factory: MagicLazyLoaderService.ɵfac, providedIn: 'root' });
|
503
|
+
/** @nocollapse */ static ɵfac = function MagicLazyLoaderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicLazyLoaderService)(); };
|
504
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicLazyLoaderService, factory: MagicLazyLoaderService.ɵfac, providedIn: 'root' });
|
427
505
|
}
|
428
506
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicLazyLoaderService, [{
|
429
507
|
type: Injectable,
|
@@ -432,6 +510,9 @@ class MagicLazyLoaderService {
|
|
432
510
|
}]
|
433
511
|
}], null, null); })();
|
434
512
|
|
513
|
+
/**
|
514
|
+
* Service for managing subforms and routing
|
515
|
+
*/
|
435
516
|
class SubformMagicService {
|
436
517
|
task;
|
437
518
|
activatedRoute;
|
@@ -443,8 +524,8 @@ class SubformMagicService {
|
|
443
524
|
loader;
|
444
525
|
injector;
|
445
526
|
compiler;
|
446
|
-
subformsDict = {};
|
447
|
-
routesDict = {};
|
527
|
+
subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
|
528
|
+
routesDict = {}; // dictionary of router outlet to router path
|
448
529
|
currentRouteDefinition = null;
|
449
530
|
static currentCallerMgSubformServiceRef = null;
|
450
531
|
static routerContainers = new Array();
|
@@ -460,6 +541,11 @@ class SubformMagicService {
|
|
460
541
|
this.injector = injector;
|
461
542
|
this.compiler = compiler;
|
462
543
|
}
|
544
|
+
/**
|
545
|
+
* Finds and returns the component according to the subform name
|
546
|
+
* @param subformName
|
547
|
+
* @returns
|
548
|
+
*/
|
463
549
|
mgGetComp(subformName) {
|
464
550
|
if (subformName in this.subformsDict) {
|
465
551
|
let formName = this.subformsDict[subformName].formName;
|
@@ -468,6 +554,11 @@ class SubformMagicService {
|
|
468
554
|
}
|
469
555
|
return null;
|
470
556
|
}
|
557
|
+
/**
|
558
|
+
* Returns the parameters of the subform
|
559
|
+
* @param subformName
|
560
|
+
* @returns
|
561
|
+
*/
|
471
562
|
mgGetParameters(subformName) {
|
472
563
|
if (subformName in this.subformsDict) {
|
473
564
|
return this.subformsDict[subformName].parameters;
|
@@ -475,6 +566,9 @@ class SubformMagicService {
|
|
475
566
|
else
|
476
567
|
return '';
|
477
568
|
}
|
569
|
+
/**
|
570
|
+
* @ignore
|
571
|
+
*/
|
478
572
|
deleteSubformComp(subformControlName, formName) {
|
479
573
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
480
574
|
if (this.subformsDict[subformControlName].formName === formName) {
|
@@ -483,22 +577,27 @@ class SubformMagicService {
|
|
483
577
|
}
|
484
578
|
}
|
485
579
|
}
|
580
|
+
/**
|
581
|
+
* @ignore
|
582
|
+
*/
|
486
583
|
addSubformComp(subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
487
584
|
this.pendingCommandsCollector.startCollecting();
|
488
585
|
let refreshNeeded = false;
|
489
|
-
if (isNullOrUndefined(routerPath)) {
|
586
|
+
if (isNullOrUndefined(routerPath)) { // call in destination subform
|
490
587
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
491
588
|
if (this.subformsDict[subformControlName].formName === formName) {
|
492
589
|
this.subformsDict[subformControlName] = {};
|
493
590
|
this.task.refreshView();
|
494
591
|
}
|
495
592
|
}
|
593
|
+
// Load the lazy load module, if needed
|
496
594
|
let moduleRef = this.componentListMagicService.getModuleRef(formName);
|
497
595
|
if (moduleRef == null) {
|
498
596
|
let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
499
597
|
if (lazyLoadModule != null) {
|
500
598
|
const Magic = 'Magic';
|
501
599
|
const Module = 'Module';
|
600
|
+
// extract name of module(XX) from 'MagicXXModule'
|
502
601
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
503
602
|
this.loader.Load(moduleName).then(m => {
|
504
603
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -516,10 +615,11 @@ class SubformMagicService {
|
|
516
615
|
formName,
|
517
616
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
518
617
|
};
|
618
|
+
//this.ref.detectChanges();
|
519
619
|
refreshNeeded = true;
|
520
620
|
}
|
521
621
|
}
|
522
|
-
else {
|
622
|
+
else { // call route
|
523
623
|
if (inDefaultOutlet)
|
524
624
|
subformControlName = 'primary';
|
525
625
|
let routeParams = new List();
|
@@ -534,6 +634,10 @@ class SubformMagicService {
|
|
534
634
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
535
635
|
routeParams: routeParams
|
536
636
|
};
|
637
|
+
// If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
|
638
|
+
// called once, but angular has not yet executed it (ngOnInit of the new component is not called).
|
639
|
+
// In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
|
640
|
+
// So, put a command in the queue which will be executed after the first one is executed.
|
537
641
|
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
538
642
|
this.ExecuteRouteCommand(routeCommand);
|
539
643
|
else
|
@@ -542,10 +646,15 @@ class SubformMagicService {
|
|
542
646
|
if (refreshNeeded)
|
543
647
|
this.task.refreshView();
|
544
648
|
}
|
649
|
+
/**
|
650
|
+
* Open the subform using a route command
|
651
|
+
*/
|
545
652
|
ExecuteRouteCommand(routeCommand) {
|
546
653
|
let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
547
654
|
let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
548
655
|
if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
|
656
|
+
// If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
|
657
|
+
// So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
|
549
658
|
currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
|
550
659
|
.then((result) => {
|
551
660
|
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
@@ -585,7 +694,12 @@ class SubformMagicService {
|
|
585
694
|
}
|
586
695
|
});
|
587
696
|
}
|
697
|
+
/**
|
698
|
+
* @ignore
|
699
|
+
*/
|
588
700
|
init() {
|
701
|
+
// If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
|
702
|
+
// So, execute them now.
|
589
703
|
const pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
590
704
|
if (pendingCommands.length > 0) {
|
591
705
|
pendingCommands.forEach(command => { this.task.executeCommand(command); });
|
@@ -593,9 +707,15 @@ class SubformMagicService {
|
|
593
707
|
}
|
594
708
|
this.pendingCommandsCollector.stopCollecting();
|
595
709
|
}
|
710
|
+
/**
|
711
|
+
* @ignore
|
712
|
+
*/
|
596
713
|
refreshView() {
|
597
714
|
this.task.refreshView();
|
598
715
|
}
|
716
|
+
///
|
717
|
+
// return the relative route
|
718
|
+
//
|
599
719
|
static getRelativeRoute(sendActivatedRoute) {
|
600
720
|
let currentActiveRoute = sendActivatedRoute;
|
601
721
|
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
@@ -605,13 +725,16 @@ class SubformMagicService {
|
|
605
725
|
}
|
606
726
|
return currentActiveRoute;
|
607
727
|
}
|
608
|
-
static ɵfac = function SubformMagicService_Factory(
|
609
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
728
|
+
/** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler)); };
|
729
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
610
730
|
}
|
611
731
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicService, [{
|
612
732
|
type: Injectable
|
613
733
|
}], () => [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }], null); })();
|
614
734
|
|
735
|
+
/**
|
736
|
+
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
737
|
+
*/
|
615
738
|
class RouterContainerMagicComponent {
|
616
739
|
activatedRoute;
|
617
740
|
router;
|
@@ -627,6 +750,16 @@ class RouterContainerMagicComponent {
|
|
627
750
|
static get LastRoute() {
|
628
751
|
return RouterContainerMagicComponent.lastRoute;
|
629
752
|
}
|
753
|
+
/**
|
754
|
+
*
|
755
|
+
* @param changeDetectorRef
|
756
|
+
* @param activatedRoute
|
757
|
+
* @param magic
|
758
|
+
* @param componentFactoryResolver
|
759
|
+
* @param viewContainerRef
|
760
|
+
* @param componentList
|
761
|
+
* @param pendingCommandsCollector
|
762
|
+
*/
|
630
763
|
constructor(activatedRoute, router, magic, containerTaskService, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
631
764
|
this.activatedRoute = activatedRoute;
|
632
765
|
this.router = router;
|
@@ -637,6 +770,9 @@ class RouterContainerMagicComponent {
|
|
637
770
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
638
771
|
this.routerCommandsMagicService = routerCommandsMagicService;
|
639
772
|
}
|
773
|
+
/**
|
774
|
+
* Initialization
|
775
|
+
*/
|
640
776
|
ngOnInit() {
|
641
777
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
642
778
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
@@ -654,7 +790,10 @@ class RouterContainerMagicComponent {
|
|
654
790
|
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
655
791
|
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
656
792
|
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
793
|
+
// if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
|
794
|
+
// need to take the path form routeConfig.path
|
657
795
|
let calcRouterPath = currentActiveRoute.routeConfig.path;
|
796
|
+
// add the RouterPath only if exist
|
658
797
|
if (calcRouterPath.length > 0) {
|
659
798
|
let routerPath = calcRouterPath;
|
660
799
|
let tokens = StrUtil.tokenize(routerPath, "/:");
|
@@ -667,6 +806,7 @@ class RouterContainerMagicComponent {
|
|
667
806
|
this.containerTaskService.insertEvent(guiEvent);
|
668
807
|
}
|
669
808
|
initializeComponent() {
|
809
|
+
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
670
810
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
671
811
|
if (subformMagicService.currentRouteDefinition !== null) {
|
672
812
|
let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
@@ -678,6 +818,9 @@ class RouterContainerMagicComponent {
|
|
678
818
|
this.parentMgSubformService = subformMagicService;
|
679
819
|
subformMagicService.currentRouteDefinition = null;
|
680
820
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
821
|
+
//When the component is initialized, then also we get the notification for paramMap subscription.
|
822
|
+
//But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
|
823
|
+
//So, control it via ignoreParamChange flag.
|
681
824
|
let ignoreParamChange = true;
|
682
825
|
myActiveRoute.paramMap.subscribe(params => {
|
683
826
|
if (!ignoreParamChange)
|
@@ -688,7 +831,12 @@ class RouterContainerMagicComponent {
|
|
688
831
|
this.routerCommandsMagicService.ExecuteNextCommand();
|
689
832
|
}
|
690
833
|
}
|
834
|
+
/**
|
835
|
+
* Cleanup
|
836
|
+
*/
|
691
837
|
ngOnDestroy() {
|
838
|
+
// TODO Routing: Call close() only if the task is not already closed.
|
839
|
+
// Task can be closed when a router is overlayed by another task via call operation.
|
692
840
|
if (this.componentRef != null) {
|
693
841
|
this.componentRef.instance.task.close();
|
694
842
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
@@ -696,25 +844,30 @@ class RouterContainerMagicComponent {
|
|
696
844
|
RouterContainerMagicComponent.lastRoute = this.router.url;
|
697
845
|
}
|
698
846
|
}
|
699
|
-
static ɵfac = function RouterContainerMagicComponent_Factory(
|
700
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
847
|
+
/** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
|
848
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], standalone: false, decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
701
849
|
}
|
702
850
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
703
851
|
type: Component,
|
704
852
|
args: [{
|
705
853
|
selector: 'magic-route-outlet',
|
706
854
|
template: `
|
707
|
-
|
855
|
+
`,
|
856
|
+
standalone: false
|
708
857
|
}]
|
709
858
|
}], () => [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }], null); })();
|
710
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src
|
859
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber: 23 }); })();
|
711
860
|
|
861
|
+
/**
|
862
|
+
* @ignore
|
863
|
+
*/
|
712
864
|
class GuiInteractiveExecutor {
|
713
865
|
command;
|
714
866
|
component;
|
715
867
|
task;
|
716
868
|
overlayService;
|
717
869
|
Run() {
|
870
|
+
// Sets the currentContextID
|
718
871
|
try {
|
719
872
|
switch (this.command._commandType) {
|
720
873
|
case InteractiveCommandType.GET_VALUE:
|
@@ -751,6 +904,7 @@ class GuiInteractiveExecutor {
|
|
751
904
|
}
|
752
905
|
catch (ex) {
|
753
906
|
throw ex;
|
907
|
+
//want to see all the exceptions for now
|
754
908
|
}
|
755
909
|
}
|
756
910
|
static executeInteractiveCommand(task, guiIntactiveCommand, overlayService) {
|
@@ -769,6 +923,7 @@ class GuiInteractiveExecutor {
|
|
769
923
|
}
|
770
924
|
else if (this.task.isTableControl(this.command.controlName))
|
771
925
|
val = this.task.getValue(this.command.controlName, guiRowId.toString());
|
926
|
+
// If this is Three State Checkbox, then check if value is indeterminate.
|
772
927
|
if (this.command._boolVal) {
|
773
928
|
const indeterminate = this.task.getProperty(this.command.controlName, HtmlProperties.CheckBoxIndeterminate, guiRowId.toString());
|
774
929
|
if (indeterminate)
|
@@ -839,20 +994,25 @@ BaseMagicOverlayContainer = __decorate([
|
|
839
994
|
Output()
|
840
995
|
], BaseMagicOverlayContainer);
|
841
996
|
|
997
|
+
/**
|
998
|
+
* Directive for setting ViewContainerRef on element
|
999
|
+
*/
|
842
1000
|
class MagicViewContainerRef {
|
843
1001
|
vcRef;
|
844
1002
|
constructor(vcRef) {
|
845
1003
|
this.vcRef = vcRef;
|
1004
|
+
// For angular 10 - find the component from the views
|
846
1005
|
let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
|
847
1006
|
comp.setViewContainerRef(vcRef);
|
848
1007
|
}
|
849
|
-
static ɵfac = function MagicViewContainerRef_Factory(
|
850
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
|
1008
|
+
/** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
1009
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]], standalone: false });
|
851
1010
|
}
|
852
1011
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
|
853
1012
|
type: Directive,
|
854
1013
|
args: [{
|
855
1014
|
selector: '[magicViewContainerRef]',
|
1015
|
+
standalone: false
|
856
1016
|
}]
|
857
1017
|
}], () => [{ type: i0.ViewContainerRef }], null); })();
|
858
1018
|
|
@@ -878,17 +1038,46 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
878
1038
|
i0.ɵɵadvance(2);
|
879
1039
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
880
1040
|
} }
|
1041
|
+
/**
|
1042
|
+
* Creates a modal window for Magic modal window components
|
1043
|
+
*/
|
881
1044
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
1045
|
+
/**
|
1046
|
+
* HTML to be displayed in the modal window
|
1047
|
+
*/
|
882
1048
|
modalbodyViewContainerRef;
|
1049
|
+
/**
|
1050
|
+
* Header of the modal window
|
1051
|
+
*/
|
883
1052
|
headerElementRef;
|
1053
|
+
/**
|
1054
|
+
* Foreground of the modal window
|
1055
|
+
*/
|
884
1056
|
foregroundElementRef;
|
1057
|
+
/**
|
1058
|
+
*
|
1059
|
+
*/
|
885
1060
|
ModalComp = null;
|
1061
|
+
/**
|
1062
|
+
*
|
1063
|
+
*/
|
886
1064
|
ModalCompParameters = {};
|
887
1065
|
onClose = new EventEmitter();
|
1066
|
+
/**
|
1067
|
+
*
|
1068
|
+
*/
|
888
1069
|
componentRef = null;
|
1070
|
+
/**
|
1071
|
+
*
|
1072
|
+
* @param injector
|
1073
|
+
* @param componentFactoryResolver
|
1074
|
+
*/
|
889
1075
|
constructor() {
|
890
1076
|
super();
|
891
1077
|
}
|
1078
|
+
/**
|
1079
|
+
*
|
1080
|
+
*/
|
892
1081
|
ngOnInit() {
|
893
1082
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(this.ModalComp);
|
894
1083
|
Object.assign(this.componentRef.instance, this.ModalCompParameters);
|
@@ -896,6 +1085,10 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
896
1085
|
setViewContainerRef(vcRef) {
|
897
1086
|
this.modalbodyViewContainerRef = vcRef;
|
898
1087
|
}
|
1088
|
+
/**
|
1089
|
+
* Returns the form name
|
1090
|
+
* @returns
|
1091
|
+
*/
|
899
1092
|
getText() {
|
900
1093
|
if (this.componentRef !== null) {
|
901
1094
|
let comp = this.componentRef.instance;
|
@@ -904,6 +1097,10 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
904
1097
|
else
|
905
1098
|
return '';
|
906
1099
|
}
|
1100
|
+
/**
|
1101
|
+
* Returns CSS styles for the window
|
1102
|
+
* @returns
|
1103
|
+
*/
|
907
1104
|
getStyle() {
|
908
1105
|
let styles = {};
|
909
1106
|
if (this.componentRef != undefined) {
|
@@ -920,6 +1117,10 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
920
1117
|
}
|
921
1118
|
return styles;
|
922
1119
|
}
|
1120
|
+
/**
|
1121
|
+
* Returns the CSS styles for the client area
|
1122
|
+
* @returns
|
1123
|
+
*/
|
923
1124
|
getClientAreaStyles() {
|
924
1125
|
let styles = {};
|
925
1126
|
if (this.componentRef != undefined) {
|
@@ -934,29 +1135,39 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
934
1135
|
}
|
935
1136
|
return styles;
|
936
1137
|
}
|
1138
|
+
/**
|
1139
|
+
* Should the title bar be displayed
|
1140
|
+
* @returns
|
1141
|
+
*/
|
937
1142
|
getShowTitleBar() {
|
938
1143
|
if (this.componentRef != undefined) {
|
939
1144
|
let comp = this.componentRef.instance;
|
940
1145
|
return comp.ShowTitleBar();
|
941
1146
|
}
|
942
1147
|
}
|
1148
|
+
/**
|
1149
|
+
*
|
1150
|
+
*/
|
943
1151
|
OnClose() {
|
944
1152
|
this.onClose.emit();
|
945
1153
|
}
|
1154
|
+
/**
|
1155
|
+
* Handles click in the background window
|
1156
|
+
*/
|
946
1157
|
OnBackgroundClick() {
|
947
1158
|
let comp = this.componentRef.instance;
|
948
1159
|
if (comp.ShouldCloseOnBackgroundClick())
|
949
1160
|
this.OnClose();
|
950
1161
|
}
|
951
|
-
static ɵfac = function MagicOverlayContainer_Factory(
|
952
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
1162
|
+
/** @nocollapse */ static ɵfac = function MagicOverlayContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainer)(); };
|
1163
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
953
1164
|
i0.ɵɵviewQuery(_c0$3, 5);
|
954
1165
|
i0.ɵɵviewQuery(_c1$1, 5);
|
955
1166
|
} if (rf & 2) {
|
956
1167
|
let _t;
|
957
1168
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerElementRef = _t.first);
|
958
1169
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.foregroundElementRef = _t.first);
|
959
|
-
} }, inputs: { ModalComp: "ModalComp", ModalCompParameters: "ModalCompParameters" }, outputs: { onClose: "onClose" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 4, consts: [["modalForeground", ""], ["modalbody", ""], ["modalheader", ""], [1, "modal-background", 3, "click"], ["tabindex", "-1", "style", "float:right; border: none; background-color: transparent; outline: none; color: white", 3, "click", 4, "ngIf"], [1, "modal-foreground", 3, "ngStyle"], ["class", "modal-header", 4, "ngIf"], [3, "ngStyle"], ["magicViewContainerRef", ""], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white", 3, "click"], [1, "modal-header"], ["tabindex", "-1", 2, "float", "right", 3, "click"]], template: function MagicOverlayContainer_Template(rf, ctx) { if (rf & 1) {
|
1170
|
+
} }, inputs: { ModalComp: "ModalComp", ModalCompParameters: "ModalCompParameters" }, outputs: { onClose: "onClose" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 4, consts: [["modalForeground", ""], ["modalbody", ""], ["modalheader", ""], [1, "modal-background", 3, "click"], ["tabindex", "-1", "style", "float:right; border: none; background-color: transparent; outline: none; color: white", 3, "click", 4, "ngIf"], [1, "modal-foreground", 3, "ngStyle"], ["class", "modal-header", 4, "ngIf"], [3, "ngStyle"], ["magicViewContainerRef", ""], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white", 3, "click"], [1, "modal-header"], ["tabindex", "-1", 2, "float", "right", 3, "click"]], template: function MagicOverlayContainer_Template(rf, ctx) { if (rf & 1) {
|
960
1171
|
const _r1 = i0.ɵɵgetCurrentView();
|
961
1172
|
i0.ɵɵelementStart(0, "div")(1, "div", 3);
|
962
1173
|
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnBackgroundClick()); });
|
@@ -996,7 +1207,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
996
1207
|
</div>
|
997
1208
|
</div>
|
998
1209
|
</div>
|
999
|
-
`, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
|
1210
|
+
`, standalone: false, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
|
1000
1211
|
}], () => [], { headerElementRef: [{
|
1001
1212
|
type: ViewChild,
|
1002
1213
|
args: ['modalheader', { static: false }]
|
@@ -1010,32 +1221,54 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
1010
1221
|
}], onClose: [{
|
1011
1222
|
type: Output
|
1012
1223
|
}] }); })();
|
1013
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src
|
1224
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 41 }); })();
|
1014
1225
|
|
1226
|
+
/**
|
1227
|
+
* Service managing overlay windows
|
1228
|
+
* This is Magic's default provider
|
1229
|
+
*/
|
1015
1230
|
class OverlayContainerMagicProvider {
|
1016
1231
|
getComponent() {
|
1017
1232
|
return MagicOverlayContainer;
|
1018
1233
|
}
|
1019
|
-
static ɵfac = function OverlayContainerMagicProvider_Factory(
|
1020
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
1234
|
+
/** @nocollapse */ static ɵfac = function OverlayContainerMagicProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayContainerMagicProvider)(); };
|
1235
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
1021
1236
|
}
|
1022
1237
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayContainerMagicProvider, [{
|
1023
1238
|
type: Injectable
|
1024
1239
|
}], null, null); })();
|
1025
1240
|
|
1241
|
+
/**
|
1242
|
+
* This is a base class for the magic confirm components
|
1243
|
+
*/
|
1026
1244
|
class BaseMagicConfirmComponent {
|
1245
|
+
/**
|
1246
|
+
* title of the component
|
1247
|
+
*/
|
1027
1248
|
title;
|
1249
|
+
/**
|
1250
|
+
* message of the component
|
1251
|
+
*/
|
1028
1252
|
message;
|
1253
|
+
/**
|
1254
|
+
* onClose Event - to be raised when the component is closed
|
1255
|
+
* should pass true when OK is pressed and false when cancel is pressed
|
1256
|
+
*/
|
1029
1257
|
onClose = new EventEmitter();
|
1258
|
+
/**
|
1259
|
+
* raises close Event
|
1260
|
+
* @param result true when OK is pressed and false when cancel is pressed
|
1261
|
+
*
|
1262
|
+
*/
|
1030
1263
|
OnClose(result) {
|
1031
1264
|
this.onClose.emit(result);
|
1032
1265
|
}
|
1033
|
-
static ɵfac = function BaseMagicConfirmComponent_Factory(
|
1034
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { } });
|
1266
|
+
/** @nocollapse */ static ɵfac = function BaseMagicConfirmComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicConfirmComponent)(); };
|
1267
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
1035
1268
|
}
|
1036
1269
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
1037
1270
|
type: Component,
|
1038
|
-
args: [{ selector: 'mg-base-confirm', template: '' }]
|
1271
|
+
args: [{ selector: 'mg-base-confirm', template: '', standalone: false }]
|
1039
1272
|
}], null, { title: [{
|
1040
1273
|
type: Input
|
1041
1274
|
}], message: [{
|
@@ -1043,21 +1276,37 @@ class BaseMagicConfirmComponent {
|
|
1043
1276
|
}], onClose: [{
|
1044
1277
|
type: Output
|
1045
1278
|
}] }); })();
|
1046
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src
|
1279
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber: 13 }); })();
|
1047
1280
|
|
1281
|
+
/**
|
1282
|
+
* This is a base class for the magic alert components
|
1283
|
+
*/
|
1048
1284
|
class BaseMagicAlertComponent {
|
1285
|
+
/**
|
1286
|
+
* title of the component
|
1287
|
+
*/
|
1049
1288
|
title;
|
1289
|
+
/**
|
1290
|
+
* message of the component
|
1291
|
+
*/
|
1050
1292
|
message;
|
1293
|
+
/**
|
1294
|
+
* onClose Event - to be raised when the component is closed
|
1295
|
+
|
1296
|
+
*/
|
1051
1297
|
onClose = new EventEmitter();
|
1298
|
+
/**
|
1299
|
+
* close magic alert
|
1300
|
+
*/
|
1052
1301
|
OnClose() {
|
1053
1302
|
this.onClose.emit();
|
1054
1303
|
}
|
1055
|
-
static ɵfac = function BaseMagicAlertComponent_Factory(
|
1056
|
-
static ɵ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) { } });
|
1304
|
+
/** @nocollapse */ static ɵfac = function BaseMagicAlertComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicAlertComponent)(); };
|
1305
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
1057
1306
|
}
|
1058
1307
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
1059
1308
|
type: Component,
|
1060
|
-
args: [{ selector: 'mg-base-alert', template: '' }]
|
1309
|
+
args: [{ selector: 'mg-base-alert', template: '', standalone: false }]
|
1061
1310
|
}], null, { title: [{
|
1062
1311
|
type: Input
|
1063
1312
|
}], message: [{
|
@@ -1065,8 +1314,11 @@ class BaseMagicAlertComponent {
|
|
1065
1314
|
}], onClose: [{
|
1066
1315
|
type: Output
|
1067
1316
|
}] }); })();
|
1068
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src
|
1317
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber: 14 }); })();
|
1069
1318
|
|
1319
|
+
/**
|
1320
|
+
* Directive for setting focus on element
|
1321
|
+
*/
|
1070
1322
|
class MagicFocusDirective {
|
1071
1323
|
hostElement;
|
1072
1324
|
constructor(hostElement) {
|
@@ -1075,13 +1327,14 @@ class MagicFocusDirective {
|
|
1075
1327
|
ngAfterViewInit() {
|
1076
1328
|
this.hostElement.nativeElement.focus();
|
1077
1329
|
}
|
1078
|
-
static ɵfac = function MagicFocusDirective_Factory(
|
1079
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
|
1330
|
+
/** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
1331
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]], standalone: false });
|
1080
1332
|
}
|
1081
1333
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicFocusDirective, [{
|
1082
1334
|
type: Directive,
|
1083
1335
|
args: [{
|
1084
|
-
selector: '[magicFocus]'
|
1336
|
+
selector: '[magicFocus]',
|
1337
|
+
standalone: false
|
1085
1338
|
}]
|
1086
1339
|
}], () => [{ type: i0.ElementRef }], null); })();
|
1087
1340
|
|
@@ -1092,17 +1345,34 @@ class MagicOverlayContainerWrapper {
|
|
1092
1345
|
injector;
|
1093
1346
|
changeDetectorRef;
|
1094
1347
|
compiler;
|
1348
|
+
/**
|
1349
|
+
*
|
1350
|
+
*/
|
1095
1351
|
Component = null;
|
1352
|
+
/**
|
1353
|
+
*
|
1354
|
+
*/
|
1096
1355
|
Parameters = {};
|
1097
1356
|
OverlayTypeParam;
|
1098
1357
|
onClose = new EventEmitter();
|
1358
|
+
/**
|
1359
|
+
* HTML to be displayed in the modal window
|
1360
|
+
*/
|
1099
1361
|
overlayContentViewContainerRef;
|
1100
1362
|
overlayContainerWrapperElementRef;
|
1363
|
+
/**
|
1364
|
+
* @ignore
|
1365
|
+
* contais data of allowed base components to use
|
1366
|
+
*/
|
1101
1367
|
static allowedBaseComps = new Map([
|
1102
1368
|
[OverlayType.Overlay, { comp: BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
|
1103
1369
|
[OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
1104
1370
|
[OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
1105
1371
|
]);
|
1372
|
+
/**
|
1373
|
+
*
|
1374
|
+
* @param componentFactoryResolver
|
1375
|
+
*/
|
1106
1376
|
constructor(componentListMagicService, magicLazyModuleLoader, injector, changeDetectorRef, compiler) {
|
1107
1377
|
this.componentListMagicService = componentListMagicService;
|
1108
1378
|
this.magicLazyModuleLoader = magicLazyModuleLoader;
|
@@ -1110,6 +1380,9 @@ class MagicOverlayContainerWrapper {
|
|
1110
1380
|
this.changeDetectorRef = changeDetectorRef;
|
1111
1381
|
this.compiler = compiler;
|
1112
1382
|
}
|
1383
|
+
/**
|
1384
|
+
*
|
1385
|
+
*/
|
1113
1386
|
ngOnInit() {
|
1114
1387
|
let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
1115
1388
|
if (moduleRef == null) {
|
@@ -1117,6 +1390,7 @@ class MagicOverlayContainerWrapper {
|
|
1117
1390
|
if (lazyLoadModule != null) {
|
1118
1391
|
const Magic = 'Magic';
|
1119
1392
|
const Module = 'Module';
|
1393
|
+
// extract name of module(XX) from 'MagicXXModule'
|
1120
1394
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
1121
1395
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
1122
1396
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -1155,13 +1429,13 @@ class MagicOverlayContainerWrapper {
|
|
1155
1429
|
DetectChanges() {
|
1156
1430
|
this.changeDetectorRef.detectChanges();
|
1157
1431
|
}
|
1158
|
-
static ɵfac = function MagicOverlayContainerWrapper_Factory(
|
1159
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
1432
|
+
/** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(MagicLazyLoaderService), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Compiler)); };
|
1433
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
1160
1434
|
i0.ɵɵviewQuery(_c0$2, 7);
|
1161
1435
|
} if (rf & 2) {
|
1162
1436
|
let _t;
|
1163
1437
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.overlayContainerWrapperElementRef = _t.first);
|
1164
|
-
} }, inputs: { Component: "Component", Parameters: "Parameters", OverlayTypeParam: "OverlayTypeParam" }, outputs: { onClose: "onClose" }, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
|
1438
|
+
} }, inputs: { Component: "Component", Parameters: "Parameters", OverlayTypeParam: "OverlayTypeParam" }, outputs: { onClose: "onClose" }, standalone: false, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
|
1165
1439
|
i0.ɵɵelementStart(0, "div");
|
1166
1440
|
i0.ɵɵelement(1, "div", 2);
|
1167
1441
|
i0.ɵɵelementStart(2, "div", 3, 0);
|
@@ -1182,7 +1456,7 @@ class MagicOverlayContainerWrapper {
|
|
1182
1456
|
</div>
|
1183
1457
|
<div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
|
1184
1458
|
</div>
|
1185
|
-
`, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
1459
|
+
`, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
1186
1460
|
}], () => [{ type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i0.Compiler }], { Component: [{
|
1187
1461
|
type: Input
|
1188
1462
|
}], Parameters: [{
|
@@ -1195,11 +1469,14 @@ class MagicOverlayContainerWrapper {
|
|
1195
1469
|
type: ViewChild,
|
1196
1470
|
args: ['overlayContainerWrapper', { static: true }]
|
1197
1471
|
}] }); })();
|
1198
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src
|
1472
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src/ui/magic-modal/magic-overlay-container-wrapper.ts", lineNumber: 46 }); })();
|
1199
1473
|
|
1474
|
+
/***
|
1475
|
+
* This is sample component for the alert message
|
1476
|
+
*/
|
1200
1477
|
class MagicAlertComponent extends BaseMagicAlertComponent {
|
1201
|
-
static ɵfac = (() => { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(
|
1202
|
-
static ɵ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) { if (rf & 1) {
|
1478
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(__ngFactoryType__) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(__ngFactoryType__ || MagicAlertComponent); }; })();
|
1479
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
1203
1480
|
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
1204
1481
|
i0.ɵɵtext(3);
|
1205
1482
|
i0.ɵɵelementEnd();
|
@@ -1226,13 +1503,16 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
1226
1503
|
|
1227
1504
|
<button (click)="OnClose()">OK</button>
|
1228
1505
|
</div>
|
1229
|
-
</div>`, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}\n"] }]
|
1506
|
+
</div>`, standalone: false, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}\n"] }]
|
1230
1507
|
}], null, null); })();
|
1231
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicAlertComponent, { className: "MagicAlertComponent", filePath: "src
|
1508
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicAlertComponent, { className: "MagicAlertComponent", filePath: "src/ui/components/magic-alert.component.ts", lineNumber: 49 }); })();
|
1232
1509
|
|
1510
|
+
/***
|
1511
|
+
* This is sample component for the confirmation box
|
1512
|
+
*/
|
1233
1513
|
class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
1234
|
-
static ɵfac = (() => { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(
|
1235
|
-
static ɵ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) { if (rf & 1) {
|
1514
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(__ngFactoryType__) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(__ngFactoryType__ || MagicConfirmationBoxComponent); }; })();
|
1515
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) { if (rf & 1) {
|
1236
1516
|
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
1237
1517
|
i0.ɵɵtext(3);
|
1238
1518
|
i0.ɵɵelementEnd();
|
@@ -1265,29 +1545,56 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
1265
1545
|
<button (click)="OnClose(true)">OK</button>
|
1266
1546
|
<button class="cancel" (click)="OnClose(false)">Cancel</button>
|
1267
1547
|
</div>
|
1268
|
-
</div>`, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel{background-color:#c1c1c1}\n"] }]
|
1548
|
+
</div>`, standalone: false, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel{background-color:#c1c1c1}\n"] }]
|
1269
1549
|
}], null, null); })();
|
1270
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicConfirmationBoxComponent, { className: "MagicConfirmationBoxComponent", filePath: "src
|
1550
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicConfirmationBoxComponent, { className: "MagicConfirmationBoxComponent", filePath: "src/ui/components/magic-confirmation-box.component.ts", lineNumber: 55 }); })();
|
1271
1551
|
|
1552
|
+
/**
|
1553
|
+
* Service managing overlay windows
|
1554
|
+
* This is Magic's default provider
|
1555
|
+
*/
|
1556
|
+
/**
|
1557
|
+
* Service managing alert and confirmation windows
|
1558
|
+
* This is Magic's default provider
|
1559
|
+
*/
|
1272
1560
|
class ConfirmationComponentsMagicProvider {
|
1561
|
+
/**
|
1562
|
+
* Return true when use default javascript alert and confirmation or return false to provide custom components
|
1563
|
+
* @returns true is we want to use default javascript alert and confirmation
|
1564
|
+
*/
|
1273
1565
|
showDefaultConfirmations() {
|
1274
1566
|
return true;
|
1275
1567
|
}
|
1568
|
+
/**
|
1569
|
+
* Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
|
1570
|
+
* @returns component that will replace javascript Alert
|
1571
|
+
*/
|
1276
1572
|
getAlertComponent() {
|
1277
1573
|
return MagicAlertComponent;
|
1278
1574
|
}
|
1575
|
+
/**
|
1576
|
+
* Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
|
1577
|
+
* @returns component that will replace javascript confirmation box
|
1578
|
+
*/
|
1279
1579
|
getConfirmtionComponent() {
|
1280
1580
|
return MagicConfirmationBoxComponent;
|
1281
1581
|
}
|
1282
|
-
static ɵfac = function ConfirmationComponentsMagicProvider_Factory(
|
1283
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
1582
|
+
/** @nocollapse */ static ɵfac = function ConfirmationComponentsMagicProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConfirmationComponentsMagicProvider)(); };
|
1583
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
1284
1584
|
}
|
1285
1585
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
|
1286
1586
|
type: Injectable
|
1287
1587
|
}], null, null); })();
|
1288
1588
|
|
1589
|
+
/**
|
1590
|
+
* Displays a message-box
|
1591
|
+
*/
|
1289
1592
|
class confirmationBox {
|
1593
|
+
/**
|
1594
|
+
* @ignore
|
1595
|
+
*/
|
1290
1596
|
static isConfirmBox(style) {
|
1597
|
+
// button format mask is in first nibble from right
|
1291
1598
|
let buttonMode = style & 0x0F;
|
1292
1599
|
var isConfirm = (buttonMode === Styles.MSGBOX_BUTTON_OK_CANCEL) ||
|
1293
1600
|
(buttonMode === Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
|
@@ -1296,7 +1603,14 @@ class confirmationBox {
|
|
1296
1603
|
(buttonMode === Styles.MSGBOX_BUTTON_RETRY_CANCEL);
|
1297
1604
|
return (isConfirm);
|
1298
1605
|
}
|
1606
|
+
/**
|
1607
|
+
* Converts the result from the HTML window to the expected result type
|
1608
|
+
* @param style Result received from HTML window
|
1609
|
+
* @param okWasPressed Was the "OK" pressed
|
1610
|
+
* @returns MessageBox result type
|
1611
|
+
*/
|
1299
1612
|
static convertToExcpectedResultBox(style, okWasPressed) {
|
1613
|
+
// button format mask is in first nibble from right
|
1300
1614
|
let buttonMode = style & 0x0F;
|
1301
1615
|
let retValue = Styles.MSGBOX_RESULT_OK;
|
1302
1616
|
if (buttonMode === Styles.MSGBOX_BUTTON_OK)
|
@@ -1313,9 +1627,18 @@ class confirmationBox {
|
|
1313
1627
|
retValue = okWasPressed ? Styles.MSGBOX_RESULT_RETRY : Styles.MSGBOX_RESULT_CANCEL;
|
1314
1628
|
return retValue;
|
1315
1629
|
}
|
1630
|
+
/**
|
1631
|
+
* Show a message box as an HTML window
|
1632
|
+
* @param title Title of the message box
|
1633
|
+
* @param message Message that will be display in the message box
|
1634
|
+
* @param style Style that include buttons \ Icons
|
1635
|
+
* @returns MessageBox result
|
1636
|
+
*/
|
1316
1637
|
static showConfirmationBox(title, message, style) {
|
1317
1638
|
let okWasPressed = false;
|
1639
|
+
// check if it is confirmation box
|
1318
1640
|
let isConfirm = this.isConfirmBox(style);
|
1641
|
+
// the title will be added to the string and we will add new line after the title
|
1319
1642
|
let titleAndString = title + '\n' + '\n' + message;
|
1320
1643
|
if (isConfirm)
|
1321
1644
|
okWasPressed = confirm(titleAndString);
|
@@ -1323,10 +1646,14 @@ class confirmationBox {
|
|
1323
1646
|
alert(titleAndString);
|
1324
1647
|
okWasPressed = true;
|
1325
1648
|
}
|
1649
|
+
// return the result from the user
|
1326
1650
|
return okWasPressed;
|
1327
1651
|
}
|
1328
1652
|
}
|
1329
1653
|
|
1654
|
+
/**
|
1655
|
+
* Service managing overlay windows
|
1656
|
+
*/
|
1330
1657
|
class OverlayWindowService {
|
1331
1658
|
componentList;
|
1332
1659
|
engineMagicService;
|
@@ -1344,6 +1671,7 @@ class OverlayWindowService {
|
|
1344
1671
|
this.overlayContainerMagicProvider = overlayContainerMagicProvider;
|
1345
1672
|
this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
|
1346
1673
|
}
|
1674
|
+
// The view reference of container of overlay window
|
1347
1675
|
overlayWindowsContainerViewRef;
|
1348
1676
|
overlayWindowFocusManager = null;
|
1349
1677
|
changeDetectorRef = null;
|
@@ -1359,6 +1687,7 @@ class OverlayWindowService {
|
|
1359
1687
|
if (lazyLoadModule != null) {
|
1360
1688
|
const Magic = 'Magic';
|
1361
1689
|
const Module = 'Module';
|
1690
|
+
// extract name of module(XX) from 'MagicXXModule'
|
1362
1691
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
1363
1692
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
1364
1693
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -1374,6 +1703,7 @@ class OverlayWindowService {
|
|
1374
1703
|
}
|
1375
1704
|
}
|
1376
1705
|
open(formName, taskId, taskDescription) {
|
1706
|
+
// for overlay which are lazy loaded don't find data in component-list
|
1377
1707
|
let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
|
1378
1708
|
let parameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
1379
1709
|
let componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), OverlayType.Overlay);
|
@@ -1382,21 +1712,31 @@ class OverlayWindowService {
|
|
1382
1712
|
guiEvent.TaskID = taskId;
|
1383
1713
|
this.engineMagicService.insertEvent(guiEvent);
|
1384
1714
|
});
|
1715
|
+
//using the same changeDetectorRef from root-component
|
1385
1716
|
this.changeDetectorRef.detectChanges();
|
1386
1717
|
}
|
1387
1718
|
close(commandStr) {
|
1719
|
+
// Close the overlay by removing the overlay window from its container
|
1388
1720
|
this.overlayWindowsContainerViewRef.remove();
|
1389
1721
|
this.overlayWindowFocusManager.popDialog();
|
1390
1722
|
let guiEvent1 = getGuiEventObj("dispose", null, 0);
|
1391
1723
|
guiEvent1.TaskID = commandStr;
|
1392
1724
|
this.engineMagicService.insertEvent(guiEvent1);
|
1393
1725
|
}
|
1726
|
+
/**
|
1727
|
+
* Open Confirmation box
|
1728
|
+
* @param title title of the box
|
1729
|
+
* @param msg message
|
1730
|
+
* @param style Magic style
|
1731
|
+
*/
|
1394
1732
|
openConfirmationBox(title, msg, style) {
|
1733
|
+
//show default confirmations
|
1395
1734
|
if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
|
1396
1735
|
let res = confirmationBox.showConfirmationBox(title, msg, style);
|
1397
1736
|
this.finishConfirmation(style, res);
|
1398
1737
|
}
|
1399
1738
|
else {
|
1739
|
+
//show custom confirmations
|
1400
1740
|
let comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
|
1401
1741
|
let overlayType = confirmationBox.isConfirmBox(style) ? OverlayType.ConfirmationBox : OverlayType.Alert;
|
1402
1742
|
let componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
|
@@ -1407,11 +1747,21 @@ class OverlayWindowService {
|
|
1407
1747
|
});
|
1408
1748
|
}
|
1409
1749
|
}
|
1750
|
+
/**
|
1751
|
+
* This method is called on close of the confirmation
|
1752
|
+
* @param style Magic style
|
1753
|
+
* @param result
|
1754
|
+
*/
|
1410
1755
|
finishConfirmation(style, result) {
|
1411
1756
|
let guiEvent = getGuiEventObj("confirmationClosed", null, 0);
|
1412
1757
|
guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
|
1413
1758
|
this.engineMagicService.insertEvent(guiEvent);
|
1414
1759
|
}
|
1760
|
+
/**
|
1761
|
+
* creates a modal component. Can be used for overlay, message box or confirmation box
|
1762
|
+
* @param parameters component's parameters
|
1763
|
+
* @param component components to create
|
1764
|
+
*/
|
1415
1765
|
createModalComponent(parameters, component, overlayType) {
|
1416
1766
|
let componentRef;
|
1417
1767
|
let magicModalContainerParameters = {
|
@@ -1419,15 +1769,17 @@ class OverlayWindowService {
|
|
1419
1769
|
Parameters: parameters,
|
1420
1770
|
OverlayTypeParam: overlayType
|
1421
1771
|
};
|
1772
|
+
// Create the UI component of modal window
|
1422
1773
|
let viewCRef = this.overlayWindowsContainerViewRef;
|
1423
1774
|
componentRef = viewCRef.createComponent(MagicOverlayContainerWrapper);
|
1775
|
+
// Set the data to newly created component
|
1424
1776
|
Object.assign(componentRef.instance, magicModalContainerParameters);
|
1425
1777
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
1426
1778
|
componentRef.instance.DetectChanges();
|
1427
1779
|
return componentRef;
|
1428
1780
|
}
|
1429
|
-
static ɵfac = function OverlayWindowService_Factory(
|
1430
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
|
1781
|
+
/** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
|
1782
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
|
1431
1783
|
}
|
1432
1784
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
|
1433
1785
|
type: Injectable,
|
@@ -1555,50 +1907,135 @@ class DialogInfo {
|
|
1555
1907
|
}
|
1556
1908
|
}
|
1557
1909
|
|
1910
|
+
/**
|
1911
|
+
* Main service to connect the UI with the Magic WebCLient
|
1912
|
+
*/
|
1558
1913
|
class TaskMagicService {
|
1559
1914
|
magic;
|
1560
1915
|
overlayWindowService;
|
1916
|
+
/**
|
1917
|
+
* Service to provide table-related functionalities
|
1918
|
+
*/
|
1561
1919
|
tableService;
|
1920
|
+
/**
|
1921
|
+
* Collection of data for all controls
|
1922
|
+
*/
|
1562
1923
|
Records = new Records();
|
1924
|
+
/**
|
1925
|
+
* FormGroup collection for line mode
|
1926
|
+
*/
|
1563
1927
|
formGroups = [];
|
1928
|
+
/**
|
1929
|
+
* FormGroup for all controls in screen mode
|
1930
|
+
*/
|
1564
1931
|
ScreenModeControls;
|
1932
|
+
/**
|
1933
|
+
* @ignore
|
1934
|
+
*/
|
1565
1935
|
refreshDom = new Subject();
|
1936
|
+
/**
|
1937
|
+
* @ignore
|
1938
|
+
*/
|
1566
1939
|
subscribeRefreshDom;
|
1940
|
+
/**
|
1941
|
+
* @ignore
|
1942
|
+
*/
|
1567
1943
|
detectChanges = new Subject();
|
1944
|
+
/**
|
1945
|
+
* @ignore
|
1946
|
+
*/
|
1568
1947
|
subscribeInteractiveCommands;
|
1948
|
+
/**
|
1949
|
+
* @ignore
|
1950
|
+
*/
|
1569
1951
|
interactiveCommands = new Subject();
|
1952
|
+
/**
|
1953
|
+
* @ignore
|
1954
|
+
* This event is emitted when the selected row in a table changes.
|
1955
|
+
*/
|
1570
1956
|
OnSelectedRowChanged = new EventEmitter();
|
1957
|
+
/**
|
1958
|
+
* @ignore
|
1959
|
+
*/
|
1571
1960
|
customPropertiesSubject = new Subject();
|
1961
|
+
/**
|
1962
|
+
* @ignore
|
1963
|
+
*/
|
1572
1964
|
recordsCountChangeSubject = new Subject();
|
1573
1965
|
mgLoadSubject = new Subject();
|
1966
|
+
/**
|
1967
|
+
* @ignore
|
1968
|
+
*/
|
1574
1969
|
template;
|
1970
|
+
/**
|
1971
|
+
* Service to provide subform-related functionalities
|
1972
|
+
*/
|
1575
1973
|
mgSubformService;
|
1974
|
+
/**
|
1975
|
+
* Service to provide the title-change functionality
|
1976
|
+
*/
|
1576
1977
|
mgTitleService;
|
1978
|
+
/**
|
1979
|
+
* Service which enables getting/setting values from/to the Magic WebClient engine
|
1980
|
+
*/
|
1577
1981
|
mgAccessorService;
|
1578
1982
|
mgInputDateFormat;
|
1983
|
+
/**
|
1984
|
+
* @ignore
|
1985
|
+
*/
|
1579
1986
|
oldPageSize = 0;
|
1987
|
+
/**
|
1988
|
+
*
|
1989
|
+
* @param magic
|
1990
|
+
*/
|
1580
1991
|
constructor(magic, overlayWindowService) {
|
1581
1992
|
this.magic = magic;
|
1582
1993
|
this.overlayWindowService = overlayWindowService;
|
1583
1994
|
this.Records.setGuiTopIndex(0);
|
1584
1995
|
this.mgInputDateFormat = null;
|
1585
1996
|
}
|
1997
|
+
/**
|
1998
|
+
* returns true if used is logged in
|
1999
|
+
* @returns
|
2000
|
+
*/
|
1586
2001
|
getIsLoggenIn() {
|
1587
2002
|
return this.magic.getIsLoggedIn();
|
1588
2003
|
}
|
2004
|
+
/**
|
2005
|
+
* Id of task to which this service refers
|
2006
|
+
*/
|
1589
2007
|
_taskId;
|
2008
|
+
/**
|
2009
|
+
* returns the task Id
|
2010
|
+
* @returns
|
2011
|
+
*/
|
1590
2012
|
get taskId() {
|
1591
2013
|
return this._taskId;
|
1592
2014
|
}
|
2015
|
+
/**
|
2016
|
+
* Sets the task Id
|
2017
|
+
* @param value the task id to set
|
2018
|
+
*/
|
1593
2019
|
set taskId(value) {
|
2020
|
+
// debugger;
|
1594
2021
|
this._taskId = value;
|
1595
2022
|
}
|
2023
|
+
/**
|
2024
|
+
* Returns the task's data in Screen mode
|
2025
|
+
* @returns
|
2026
|
+
*/
|
1596
2027
|
get ScreenControlsData() {
|
1597
2028
|
return this.Records.list['0'];
|
1598
2029
|
}
|
2030
|
+
/**
|
2031
|
+
* @ignore
|
2032
|
+
*/
|
1599
2033
|
settemplate(value) {
|
1600
2034
|
this.template = value;
|
1601
2035
|
}
|
2036
|
+
/**
|
2037
|
+
* Builds the FormControl for each and every control
|
2038
|
+
*/
|
1602
2039
|
buildScreenModeControls() {
|
1603
2040
|
const group = new FormGroup({});
|
1604
2041
|
for (const key in this.template) {
|
@@ -1610,10 +2047,21 @@ class TaskMagicService {
|
|
1610
2047
|
}
|
1611
2048
|
this.ScreenModeControls = group;
|
1612
2049
|
}
|
2050
|
+
/**
|
2051
|
+
* Is the control a table control
|
2052
|
+
* @param id Id of the control
|
2053
|
+
* @returns
|
2054
|
+
*/
|
1613
2055
|
isTableControl(id) {
|
1614
2056
|
return this.template[id] == '1';
|
1615
2057
|
}
|
1616
2058
|
getMgInputDateFormat() { return this.mgInputDateFormat; }
|
2059
|
+
/**
|
2060
|
+
* Returns the FormControl of a control
|
2061
|
+
* @param guiRowid Id of the requested row
|
2062
|
+
* @param id Id of the control
|
2063
|
+
* @returns
|
2064
|
+
*/
|
1617
2065
|
getFormControl(guiRowid, id) {
|
1618
2066
|
let c;
|
1619
2067
|
let group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
|
@@ -1623,12 +2071,21 @@ class TaskMagicService {
|
|
1623
2071
|
}
|
1624
2072
|
return c;
|
1625
2073
|
}
|
2074
|
+
/**
|
2075
|
+
* handle the change of text for input control inside table
|
2076
|
+
* @param guiRowId Id of the row for which the FormControls are built
|
2077
|
+
* set the new value of the formcontrol
|
2078
|
+
*/
|
1626
2079
|
setInputTextValue(controlId, guiRowid, val) {
|
1627
2080
|
this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
|
1628
2081
|
const fc = this.getFormControl(guiRowid, controlId);
|
1629
2082
|
if (!isNullOrUndefined(val))
|
1630
2083
|
fc.setValue(val);
|
1631
2084
|
}
|
2085
|
+
/**
|
2086
|
+
* Build the FormControls for a table row
|
2087
|
+
* @param guiRowId Id of the row for which the FormControls are built
|
2088
|
+
*/
|
1632
2089
|
buildTableRowControls(guiRowId) {
|
1633
2090
|
const group = new FormGroup({});
|
1634
2091
|
for (const key in this.template) {
|
@@ -1640,30 +2097,58 @@ class TaskMagicService {
|
|
1640
2097
|
}
|
1641
2098
|
this.formGroups[guiRowId] = group;
|
1642
2099
|
}
|
2100
|
+
/**
|
2101
|
+
*
|
2102
|
+
* @ignore
|
2103
|
+
*/
|
1643
2104
|
updateRecordsBeforeCurrentView(value) {
|
1644
2105
|
this.Records.recordsBeforeCurrentView = value;
|
1645
2106
|
}
|
2107
|
+
/**
|
2108
|
+
* @ignore
|
2109
|
+
*/
|
1646
2110
|
setIncludesFirst(value) {
|
1647
2111
|
this.Records.includesFirst = value;
|
1648
2112
|
}
|
2113
|
+
/**
|
2114
|
+
* @ignore
|
2115
|
+
*/
|
1649
2116
|
setIncludesLast(value) {
|
1650
2117
|
this.Records.includesLast = value;
|
1651
2118
|
}
|
2119
|
+
/**
|
2120
|
+
* @ignore
|
2121
|
+
*/
|
1652
2122
|
markRowAsCreated(guiRowId) {
|
1653
2123
|
this.Records.markRowAsCreated(guiRowId);
|
1654
2124
|
}
|
2125
|
+
/**
|
2126
|
+
* @ignore
|
2127
|
+
*/
|
1655
2128
|
markRowAsNotCreated(guiRowId) {
|
1656
2129
|
this.Records.markRowAsNotCreated(guiRowId);
|
1657
2130
|
}
|
2131
|
+
/**
|
2132
|
+
* @ignore
|
2133
|
+
*/
|
1658
2134
|
startRowEditing(guiRowId) {
|
1659
2135
|
this.Records.startRowEditing(guiRowId);
|
1660
2136
|
}
|
2137
|
+
/**
|
2138
|
+
* @ignore
|
2139
|
+
*/
|
1661
2140
|
stopRowEditing(guiRowId) {
|
1662
2141
|
this.Records.stopRowEditing(guiRowId);
|
1663
2142
|
}
|
2143
|
+
/**
|
2144
|
+
* @ignore
|
2145
|
+
*/
|
1664
2146
|
isRowInRowEditing(guiRowId) {
|
1665
2147
|
return this.Records.isRowInRowEditing(guiRowId);
|
1666
2148
|
}
|
2149
|
+
/**
|
2150
|
+
* @ignore
|
2151
|
+
*/
|
1667
2152
|
setIsEmptyDataView(isEmpty) {
|
1668
2153
|
if (this.Records.isEmptyDataView !== isEmpty) {
|
1669
2154
|
if (isEmpty)
|
@@ -1673,6 +2158,11 @@ class TaskMagicService {
|
|
1673
2158
|
this.refreshView();
|
1674
2159
|
}
|
1675
2160
|
}
|
2161
|
+
/**
|
2162
|
+
* Initialize the service to work with the task
|
2163
|
+
* @param taskId Id of the task
|
2164
|
+
* @param taskDescription
|
2165
|
+
*/
|
1676
2166
|
initTask(taskId, taskDescription) {
|
1677
2167
|
this.Records.createFirst();
|
1678
2168
|
this.oldPageSize = 0;
|
@@ -1684,39 +2174,71 @@ class TaskMagicService {
|
|
1684
2174
|
this.settemplate(taskDescription);
|
1685
2175
|
}
|
1686
2176
|
this.buildScreenModeControls();
|
2177
|
+
// remove previous subscriptions
|
1687
2178
|
if (!isNullOrUndefined(this.subscribeRefreshDom))
|
1688
2179
|
this.subscribeRefreshDom.unsubscribe();
|
1689
2180
|
if (!isNullOrUndefined(this.subscribeInteractiveCommands))
|
1690
2181
|
this.subscribeInteractiveCommands.unsubscribe();
|
1691
2182
|
this.subscribeRefreshDom = this.magic.refreshDom.pipe(filter(command => command.TaskTag === this.taskId))
|
1692
2183
|
.subscribe(command => {
|
2184
|
+
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
1693
2185
|
this.executeCommand(command);
|
1694
2186
|
});
|
1695
2187
|
this.subscribeInteractiveCommands = this.magic.interactiveCommands
|
1696
2188
|
.pipe(filter(command => command.TaskTag === this.taskId))
|
1697
2189
|
.subscribe(command => {
|
2190
|
+
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
1698
2191
|
this.executeInteractiveCommand(command);
|
1699
2192
|
});
|
1700
2193
|
}
|
2194
|
+
/**
|
2195
|
+
* @ignore
|
2196
|
+
*/
|
1701
2197
|
refreshView() {
|
1702
2198
|
this.detectChanges.next('');
|
1703
2199
|
}
|
2200
|
+
/**
|
2201
|
+
* Insert an event to the Magic WebClient event queue
|
2202
|
+
* @param guiEvent The event to insert
|
2203
|
+
*/
|
1704
2204
|
insertEvent(guiEvent) {
|
1705
2205
|
guiEvent.TaskID = this.taskId;
|
1706
2206
|
this.magic.insertEvent(guiEvent);
|
1707
2207
|
}
|
2208
|
+
/**
|
2209
|
+
* @ignore
|
2210
|
+
*/
|
1708
2211
|
GetControlPictureMask(controlName) {
|
1709
2212
|
return this.magic.GetControlPictureMask(this.taskId, controlName);
|
1710
2213
|
}
|
2214
|
+
/**
|
2215
|
+
* Validates the control value, using the Magic WebClient
|
2216
|
+
* @param controlName Id of validated control
|
2217
|
+
* @param value value to be validated
|
2218
|
+
* @returns If validation fails, returns error message, else returns null
|
2219
|
+
*/
|
1711
2220
|
ValidateControlValue(controlName, value) {
|
1712
2221
|
return this.magic.ValidateControlValue(this.taskId, controlName, value);
|
1713
2222
|
}
|
2223
|
+
/**
|
2224
|
+
* @ignore
|
2225
|
+
*/
|
1714
2226
|
GetRangedValue(controlName, value) {
|
1715
2227
|
return this.magic.GetRangedValue(this.taskId, controlName, value);
|
1716
2228
|
}
|
2229
|
+
/**
|
2230
|
+
* @ignore
|
2231
|
+
*/
|
1717
2232
|
GetFldRanges(controlName) {
|
1718
2233
|
return this.magic.GetFldRanges(this.taskId, controlName);
|
1719
2234
|
}
|
2235
|
+
/**
|
2236
|
+
* returns the value of a property of the control
|
2237
|
+
* @param controlId Id of control
|
2238
|
+
* @param prop Property
|
2239
|
+
* @param guiRowId Row Id, if applicable
|
2240
|
+
* @returns Property value
|
2241
|
+
*/
|
1720
2242
|
getProperty(controlId, prop, guiRowId) {
|
1721
2243
|
if (isNullOrUndefined(guiRowId))
|
1722
2244
|
guiRowId = '0';
|
@@ -1730,6 +2252,9 @@ class TaskMagicService {
|
|
1730
2252
|
return this.Records.list[guiRowId].getProperty(controlId, prop);
|
1731
2253
|
}
|
1732
2254
|
}
|
2255
|
+
/**
|
2256
|
+
* @ignore
|
2257
|
+
*/
|
1733
2258
|
getPropertyStub(ControlsProperties, controlId, prop) {
|
1734
2259
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
1735
2260
|
if (controlId in ControlsProperties) {
|
@@ -1739,15 +2264,31 @@ class TaskMagicService {
|
|
1739
2264
|
}
|
1740
2265
|
return '';
|
1741
2266
|
}
|
2267
|
+
/**
|
2268
|
+
* @ignore
|
2269
|
+
*/
|
1742
2270
|
getStyleStub(ControlsProperties, controlId, styleName) {
|
1743
2271
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
1744
2272
|
return ControlsProperties[controlId].stylesMap.get(styleName);
|
1745
2273
|
}
|
2274
|
+
/**
|
2275
|
+
* Return the CSS classes used for this control
|
2276
|
+
* @param controlId Id of control
|
2277
|
+
* @param guiRowId Row Id, if applicable
|
2278
|
+
* @returns String containing the classes currently defined for this control
|
2279
|
+
*/
|
1746
2280
|
getClasses(controlId, guiRowId) {
|
1747
2281
|
if (isNullOrUndefined(guiRowId))
|
1748
2282
|
guiRowId = '0';
|
1749
2283
|
return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
|
1750
2284
|
}
|
2285
|
+
/**
|
2286
|
+
* Return the value of a style used for a control
|
2287
|
+
* @param controlId Id of control
|
2288
|
+
* @param styleName Name of style
|
2289
|
+
* @param guiRowId Row Id, if applicable
|
2290
|
+
* @returns value of style of the control
|
2291
|
+
*/
|
1751
2292
|
getStyle(controlId, styleName, guiRowId) {
|
1752
2293
|
if (isNullOrUndefined(guiRowId))
|
1753
2294
|
guiRowId = '0';
|
@@ -1758,21 +2299,45 @@ class TaskMagicService {
|
|
1758
2299
|
return StylesMapManager.magicValueGetStyle(styleName, magicValue);
|
1759
2300
|
}
|
1760
2301
|
}
|
2302
|
+
/**
|
2303
|
+
* Return the value of a control
|
2304
|
+
* @param controlId Id of control
|
2305
|
+
* @param guiRowId Row Id, if applicable
|
2306
|
+
* @returns value of the control
|
2307
|
+
*/
|
1761
2308
|
getValue(controlId, guiRowId) {
|
1762
2309
|
if (isNullOrUndefined(guiRowId))
|
1763
2310
|
guiRowId = '0';
|
1764
2311
|
return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
|
1765
2312
|
}
|
2313
|
+
/**
|
2314
|
+
* Return the formatted value of a control
|
2315
|
+
* @param controlId Id of control
|
2316
|
+
* @param guiRowId Row Id, if applicable
|
2317
|
+
* @returns value of the control
|
2318
|
+
*/
|
1766
2319
|
getFormattedValue(controlName, val, rowId) {
|
1767
2320
|
return this.magic.GetFormattedValue(this.taskId, controlName, val, rowId);
|
1768
2321
|
}
|
2322
|
+
/**
|
2323
|
+
* Sets the value of a control
|
2324
|
+
* @param controlId Id of control
|
2325
|
+
* @param guiRowId Row Id, if applicable
|
2326
|
+
* @param value Value to set
|
2327
|
+
*/
|
1769
2328
|
setValue(controlId, guiRowId, value) {
|
1770
2329
|
return this.Records.list[guiRowId].setValue(controlId, value);
|
1771
2330
|
}
|
2331
|
+
/**
|
2332
|
+
* @ignore
|
2333
|
+
*/
|
1772
2334
|
executeInteractiveCommand(guiInteractiveCommand) {
|
1773
2335
|
GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
|
1774
2336
|
this.interactiveCommands.next(guiInteractiveCommand);
|
1775
2337
|
}
|
2338
|
+
/**
|
2339
|
+
* @ignore
|
2340
|
+
*/
|
1776
2341
|
handleSetProperty(command, isTableChild) {
|
1777
2342
|
let controlId = command.CtrlName;
|
1778
2343
|
let dvRowId = (command.line || 0);
|
@@ -1809,6 +2374,7 @@ class TaskMagicService {
|
|
1809
2374
|
let controlId = command.CtrlName;
|
1810
2375
|
let properties;
|
1811
2376
|
let isTableChild = this.isTableControl(controlId);
|
2377
|
+
// For non-input type controls on table.
|
1812
2378
|
if (command.obj !== null)
|
1813
2379
|
isTableChild = isTableChild || command.obj.IsTableChild;
|
1814
2380
|
guiRowId = this.getGuiRowId(dvRowId, isTableChild);
|
@@ -1871,8 +2437,10 @@ class TaskMagicService {
|
|
1871
2437
|
break;
|
1872
2438
|
case CommandType.PROP_SET_USER_PROPERTY:
|
1873
2439
|
properties = this.Records.list[guiRowId].getControlMetadata(controlId);
|
2440
|
+
// if the property has changed, set the property and raise the subject
|
1874
2441
|
if (properties.userProperties.get(command.Operation) !== command.obj1) {
|
1875
2442
|
properties.userProperties.set(command.Operation, command.obj1);
|
2443
|
+
// the property name is of format <controlName>~<propertyName>
|
1876
2444
|
this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
|
1877
2445
|
}
|
1878
2446
|
break;
|
@@ -1926,6 +2494,9 @@ class TaskMagicService {
|
|
1926
2494
|
break;
|
1927
2495
|
}
|
1928
2496
|
}
|
2497
|
+
/**
|
2498
|
+
custom validator
|
2499
|
+
*/
|
1929
2500
|
customValidator(rowid, id) {
|
1930
2501
|
return (control) => {
|
1931
2502
|
let controlMetadata;
|
@@ -1939,6 +2510,13 @@ class TaskMagicService {
|
|
1939
2510
|
return null;
|
1940
2511
|
};
|
1941
2512
|
}
|
2513
|
+
/**
|
2514
|
+
* COnvert a value from Magic format to native format
|
2515
|
+
* @param controlId Id of control
|
2516
|
+
* @param rowId Row Id, if applicable
|
2517
|
+
* @param val Value to convert
|
2518
|
+
* @returns Converted value
|
2519
|
+
*/
|
1942
2520
|
ConvertValToNative(controlId, rowId, val) {
|
1943
2521
|
let properties;
|
1944
2522
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
@@ -1990,6 +2568,13 @@ class TaskMagicService {
|
|
1990
2568
|
return val;
|
1991
2569
|
}
|
1992
2570
|
}
|
2571
|
+
/**
|
2572
|
+
* Convert a value from native to Magic format
|
2573
|
+
* @param controlId Id of control
|
2574
|
+
* @param rowId Row Id, if applicable
|
2575
|
+
* @param val Value to convert
|
2576
|
+
* @returns Converted value
|
2577
|
+
*/
|
1993
2578
|
ConvertValFromNative(controlId, rowId, val) {
|
1994
2579
|
let properties;
|
1995
2580
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
@@ -2032,12 +2617,22 @@ class TaskMagicService {
|
|
2032
2617
|
return val;
|
2033
2618
|
}
|
2034
2619
|
}
|
2620
|
+
/**
|
2621
|
+
* Handle resize and also fetch chunk of records if having an empty view.
|
2622
|
+
* @ignore
|
2623
|
+
* @param pageSize : PageSize
|
2624
|
+
* @param topGuiRowId : GuiRowId of first record in view.
|
2625
|
+
*/
|
2035
2626
|
resize(pageSize, topGuiRowId) {
|
2036
2627
|
let guiEvent = getGuiEventObj('resize', 'table', 0);
|
2037
2628
|
guiEvent.PageSize = pageSize;
|
2629
|
+
//As 'getRows' event also gets executed, set the guiEvent.Line parameter.
|
2038
2630
|
guiEvent.Line = topGuiRowId;
|
2039
2631
|
this.insertEvent(guiEvent);
|
2040
2632
|
}
|
2633
|
+
/**
|
2634
|
+
* Fetches data for new table rows when scrolling done
|
2635
|
+
*/
|
2041
2636
|
onScrollDown() {
|
2042
2637
|
if (!this.Records.includesLast) {
|
2043
2638
|
let guiEvent = getGuiEventObj('getRows', '', 0);
|
@@ -2045,15 +2640,29 @@ class TaskMagicService {
|
|
2045
2640
|
this.insertEvent(guiEvent);
|
2046
2641
|
}
|
2047
2642
|
}
|
2643
|
+
/**
|
2644
|
+
* Sets the new browser window title
|
2645
|
+
* @param newTitle New window title
|
2646
|
+
*/
|
2048
2647
|
setTitle(newTitle) {
|
2049
2648
|
this.mgTitleService.setTitle(newTitle);
|
2050
2649
|
}
|
2650
|
+
/**
|
2651
|
+
* @ignore
|
2652
|
+
*/
|
2051
2653
|
getGuiRowId(dvRowId, isTableControl) {
|
2052
2654
|
return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
|
2053
2655
|
}
|
2656
|
+
/**
|
2657
|
+
*
|
2658
|
+
* @ignore
|
2659
|
+
*/
|
2054
2660
|
getDvRowId(guiRowId) {
|
2055
2661
|
return (guiRowId - this.Records.recordsBeforeCurrentView);
|
2056
2662
|
}
|
2663
|
+
/**
|
2664
|
+
* Clean up the service when it is no longer needed
|
2665
|
+
*/
|
2057
2666
|
dispose() {
|
2058
2667
|
this.refreshDom.complete();
|
2059
2668
|
this.detectChanges.complete();
|
@@ -2063,6 +2672,14 @@ class TaskMagicService {
|
|
2063
2672
|
this.customPropertiesSubject.complete();
|
2064
2673
|
this.OnSelectedRowChanged.complete();
|
2065
2674
|
}
|
2675
|
+
///////////////////////////////
|
2676
|
+
//Events:
|
2677
|
+
/**
|
2678
|
+
* Handle the Combobox "change" event
|
2679
|
+
* @param event The event received from the UI
|
2680
|
+
* @param idx Id of the control raising the event
|
2681
|
+
* @param line Row Id, if applicable
|
2682
|
+
*/
|
2066
2683
|
onComboboxSelectionChanged(event, idx, line) {
|
2067
2684
|
let guiEvent = getGuiEventObj('selectionchanged', idx, line);
|
2068
2685
|
if (typeof (event) == 'number') {
|
@@ -2081,6 +2698,11 @@ class TaskMagicService {
|
|
2081
2698
|
}
|
2082
2699
|
this.insertEvent(guiEvent);
|
2083
2700
|
}
|
2701
|
+
/**
|
2702
|
+
* Handle the Listbox "change" event
|
2703
|
+
* @param event The event received from the UI
|
2704
|
+
* @param idx Id of the control raising the event
|
2705
|
+
*/
|
2084
2706
|
onListBoxSelectionChanged(event, idx) {
|
2085
2707
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
2086
2708
|
let selectedOptions;
|
@@ -2096,9 +2718,15 @@ class TaskMagicService {
|
|
2096
2718
|
else
|
2097
2719
|
indexes[i] = (selectedOptions[i]).value;
|
2098
2720
|
}
|
2099
|
-
guiEvent.Value = indexes;
|
2721
|
+
guiEvent.Value = indexes; // TODO: fix
|
2100
2722
|
this.insertEvent(guiEvent);
|
2101
2723
|
}
|
2724
|
+
/**
|
2725
|
+
* Handle the Checkbox "change" event
|
2726
|
+
* @param event The event received from the UI
|
2727
|
+
* @param idx Id of the control raising the event
|
2728
|
+
* @param rowId Row Id, if applicable
|
2729
|
+
*/
|
2102
2730
|
onCheckChanged(event, idx, rowId) {
|
2103
2731
|
if (typeof rowId === 'undefined')
|
2104
2732
|
rowId = 0;
|
@@ -2107,12 +2735,12 @@ class TaskMagicService {
|
|
2107
2735
|
guiEvent.Value = event;
|
2108
2736
|
}
|
2109
2737
|
else if (typeof (event) == 'string') {
|
2110
|
-
if (event == "unchecked") {
|
2738
|
+
if (event == "unchecked") { // @ts-ignore
|
2111
2739
|
guiEvent.Value = false;
|
2112
2740
|
}
|
2113
2741
|
else if (event == 'indeterminate')
|
2114
2742
|
guiEvent.Value = null;
|
2115
|
-
else if (event == 'checked') {
|
2743
|
+
else if (event == 'checked') { // @ts-ignore
|
2116
2744
|
guiEvent.Value = true;
|
2117
2745
|
}
|
2118
2746
|
}
|
@@ -2124,11 +2752,21 @@ class TaskMagicService {
|
|
2124
2752
|
}
|
2125
2753
|
this.insertEvent(guiEvent);
|
2126
2754
|
}
|
2755
|
+
/**
|
2756
|
+
* Handle tab selection change, caused by UI events
|
2757
|
+
* @param idx Id of the control raising the event
|
2758
|
+
* @param layer Id of selected tabpage
|
2759
|
+
*/
|
2127
2760
|
mgOnTabSelectionChanged(idx, layer) {
|
2128
2761
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
2129
2762
|
guiEvent.Value = layer.toString();
|
2130
2763
|
this.insertEvent(guiEvent);
|
2131
2764
|
}
|
2765
|
+
/**
|
2766
|
+
* Handle the Radio button "change" event
|
2767
|
+
* @param event The event received from the UI
|
2768
|
+
* @param idx Id of the control raising the event
|
2769
|
+
*/
|
2132
2770
|
mgOnRadioSelectionChanged(idx) {
|
2133
2771
|
let result = this.getFormControl('0', idx);
|
2134
2772
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
@@ -2138,16 +2776,34 @@ class TaskMagicService {
|
|
2138
2776
|
guiEvent.Value = result.value.toString();
|
2139
2777
|
this.insertEvent(guiEvent);
|
2140
2778
|
}
|
2779
|
+
/**
|
2780
|
+
* Inserts the "close" event to the magic WebClient event queue
|
2781
|
+
*/
|
2141
2782
|
close() {
|
2142
2783
|
this.insertEvent(getGuiEventObj('close', null, 0));
|
2143
2784
|
}
|
2785
|
+
///////////////////////////////
|
2786
|
+
/**
|
2787
|
+
* @ignore
|
2788
|
+
*/
|
2144
2789
|
IsStub() {
|
2145
2790
|
return this.magic.isStub;
|
2146
2791
|
}
|
2792
|
+
//////////////////////////////////////////////////////////////
|
2793
|
+
///Stub handling
|
2794
|
+
/**
|
2795
|
+
* @ignore
|
2796
|
+
*/
|
2147
2797
|
jsonData;
|
2798
|
+
/**
|
2799
|
+
* @ignore
|
2800
|
+
*/
|
2148
2801
|
saveData(data) {
|
2149
2802
|
this.magic.saveData(data);
|
2150
2803
|
}
|
2804
|
+
/**
|
2805
|
+
* @ignore
|
2806
|
+
*/
|
2151
2807
|
createData() {
|
2152
2808
|
let myData = {
|
2153
2809
|
records: this.Records,
|
@@ -2159,6 +2815,9 @@ class TaskMagicService {
|
|
2159
2815
|
console.log(text);
|
2160
2816
|
this.saveData(text);
|
2161
2817
|
}
|
2818
|
+
/**
|
2819
|
+
* @ignore
|
2820
|
+
*/
|
2162
2821
|
loadStubData(stubData) {
|
2163
2822
|
this.Records = stubData.records;
|
2164
2823
|
this.settemplate(stubData.template);
|
@@ -2166,9 +2825,15 @@ class TaskMagicService {
|
|
2166
2825
|
for (let i = 0; i < this.Records.list.length; i++)
|
2167
2826
|
this.buildTableRowControls(i);
|
2168
2827
|
}
|
2828
|
+
/**
|
2829
|
+
* @ignore
|
2830
|
+
*/
|
2169
2831
|
loadData() {
|
2170
2832
|
alert('Please, overwrite method loadData');
|
2171
2833
|
}
|
2834
|
+
/**
|
2835
|
+
* @ignore
|
2836
|
+
*/
|
2172
2837
|
setStubValue(guiRowId, fc, name) {
|
2173
2838
|
if (this.IsStub()) {
|
2174
2839
|
try {
|
@@ -2179,45 +2844,79 @@ class TaskMagicService {
|
|
2179
2844
|
}
|
2180
2845
|
}
|
2181
2846
|
}
|
2182
|
-
static ɵfac = function TaskMagicService_Factory(
|
2183
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
2847
|
+
/** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
2848
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
2184
2849
|
}
|
2185
2850
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskMagicService, [{
|
2186
2851
|
type: Injectable
|
2187
2852
|
}], () => [{ type: EngineMagicService }, { type: OverlayWindowService }], null); })();
|
2188
2853
|
|
2854
|
+
/**
|
2855
|
+
* Implements various table-related functionalities
|
2856
|
+
*/
|
2189
2857
|
class TableMagicService {
|
2190
2858
|
componentList;
|
2191
2859
|
task;
|
2192
2860
|
selectedItem;
|
2193
2861
|
chunkSize;
|
2862
|
+
/**
|
2863
|
+
*
|
2864
|
+
* @param componentList Component-mapping service
|
2865
|
+
* @param task Magic task service
|
2866
|
+
*/
|
2194
2867
|
constructor(componentList, task) {
|
2195
2868
|
this.componentList = componentList;
|
2196
2869
|
this.task = task;
|
2197
2870
|
}
|
2198
2871
|
shouldOpenFieldTextEditor = true;
|
2872
|
+
/**
|
2873
|
+
* Refreshes the DataSource
|
2874
|
+
*/
|
2199
2875
|
refreshDataSource() {
|
2200
2876
|
}
|
2877
|
+
/**
|
2878
|
+
* Returns the table page size
|
2879
|
+
* chunkSize as default value for non-paginated tables.
|
2880
|
+
*/
|
2201
2881
|
getPageSize() {
|
2202
2882
|
return this.chunkSize;
|
2203
2883
|
}
|
2204
2884
|
setChunkSize(size) {
|
2205
2885
|
this.chunkSize = size;
|
2206
2886
|
}
|
2887
|
+
/**
|
2888
|
+
* Returns max no of rows in the table.
|
2889
|
+
*/
|
2207
2890
|
getMaxRowsInTable() {
|
2208
2891
|
return this.task.Records.list.length;
|
2209
2892
|
}
|
2893
|
+
/**
|
2894
|
+
* Selects the specified row
|
2895
|
+
* @param rowId The row to select
|
2896
|
+
*/
|
2210
2897
|
selectRow(rowId) {
|
2211
2898
|
this.selectedItem = rowId;
|
2212
2899
|
}
|
2213
2900
|
getSelectedRow() {
|
2214
2901
|
return this.selectedItem;
|
2215
2902
|
}
|
2903
|
+
/**
|
2904
|
+
* Returns the selected row
|
2905
|
+
*/
|
2216
2906
|
selectedRow() {
|
2217
2907
|
return null;
|
2218
2908
|
}
|
2909
|
+
/**
|
2910
|
+
* Selects the specified page
|
2911
|
+
* @param pageId The page to select
|
2912
|
+
*/
|
2219
2913
|
selectPage(pageId) {
|
2220
2914
|
}
|
2915
|
+
/**
|
2916
|
+
* Returns whether a dialog should be opened for the HTML element
|
2917
|
+
* @param element The HTML element for which a dialog may be needed
|
2918
|
+
* @returns
|
2919
|
+
*/
|
2221
2920
|
OpenDialogForControl(element) {
|
2222
2921
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
2223
2922
|
element.tagName === "INPUT" ||
|
@@ -2225,17 +2924,34 @@ class TableMagicService {
|
|
2225
2924
|
return false;
|
2226
2925
|
return true;
|
2227
2926
|
}
|
2927
|
+
/**
|
2928
|
+
* Returns the dialog used to edit values
|
2929
|
+
*/
|
2228
2930
|
getDialog() {
|
2229
2931
|
return null;
|
2230
2932
|
}
|
2933
|
+
/**
|
2934
|
+
* Handles the table "scrolled" event
|
2935
|
+
*/
|
2231
2936
|
onScrollDown() {
|
2232
2937
|
this.task.onScrollDown();
|
2233
2938
|
}
|
2939
|
+
/**
|
2940
|
+
* To be overwitten in specific implelemtations
|
2941
|
+
*/
|
2234
2942
|
sortData(e) { }
|
2943
|
+
/**
|
2944
|
+
* To be overwitten in specific implelemtations
|
2945
|
+
*/
|
2235
2946
|
mgOnPaginateChange(e, changeSelectedRow) { }
|
2236
2947
|
mgOptionChanged(e) { }
|
2948
|
+
/**
|
2949
|
+
* Change the number of lines in a table
|
2950
|
+
* @param size New number of lines in table
|
2951
|
+
*/
|
2237
2952
|
updateTableSize(size) {
|
2238
|
-
if (size === 0)
|
2953
|
+
if (size === 0) // never remove row 0 for now
|
2954
|
+
{
|
2239
2955
|
size = 1;
|
2240
2956
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
2241
2957
|
}
|
@@ -2243,34 +2959,51 @@ class TableMagicService {
|
|
2243
2959
|
this.task.Records.updateSize(size);
|
2244
2960
|
this.task.setIncludesFirst(false);
|
2245
2961
|
}
|
2962
|
+
/**
|
2963
|
+
* @ignore
|
2964
|
+
*/
|
2246
2965
|
setTableTopIndex(value) {
|
2247
2966
|
if (!this.task.Records.includesFirst)
|
2248
2967
|
value++;
|
2249
2968
|
this.task.Records.setGuiTopIndex(value);
|
2250
2969
|
}
|
2970
|
+
/**
|
2971
|
+
* @ignore
|
2972
|
+
*/
|
2251
2973
|
getTableTopIndex() {
|
2252
2974
|
let topIndex = this.task.Records.getGuiTopIndex();
|
2253
2975
|
if (!this.task.Records.includesFirst)
|
2254
2976
|
topIndex--;
|
2255
2977
|
return topIndex;
|
2256
2978
|
}
|
2257
|
-
static ɵfac = function TableMagicService_Factory(
|
2258
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
2979
|
+
/** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
|
2980
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
2259
2981
|
}
|
2260
2982
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableMagicService, [{
|
2261
2983
|
type: Injectable
|
2262
2984
|
}], () => [{ type: ComponentListMagicService }, { type: TaskMagicService }], null); })();
|
2263
2985
|
|
2986
|
+
/**
|
2987
|
+
* Enables changing the browser title using Magic expression (SetTitle)
|
2988
|
+
*/
|
2264
2989
|
class TitleMagicService {
|
2265
2990
|
titleService;
|
2991
|
+
/**
|
2992
|
+
*
|
2993
|
+
* @param titleService Angular's title-changing class
|
2994
|
+
*/
|
2266
2995
|
constructor(titleService) {
|
2267
2996
|
this.titleService = titleService;
|
2268
2997
|
}
|
2998
|
+
/**
|
2999
|
+
* Set the new title of the window
|
3000
|
+
* @param newTitle New title of the window
|
3001
|
+
*/
|
2269
3002
|
setTitle(newTitle) {
|
2270
3003
|
this.titleService.setTitle(newTitle);
|
2271
3004
|
}
|
2272
|
-
static ɵfac = function TitleMagicService_Factory(
|
2273
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
3005
|
+
/** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
|
3006
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
2274
3007
|
}
|
2275
3008
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TitleMagicService, [{
|
2276
3009
|
type: Injectable
|
@@ -2294,6 +3027,7 @@ class MagicColorService {
|
|
2294
3027
|
}
|
2295
3028
|
colorsData;
|
2296
3029
|
fileNotFound = false;
|
3030
|
+
// public static FILE_NAME;
|
2297
3031
|
constructor(http, colorFile1 = 'clr_rnt.eng') {
|
2298
3032
|
this.http = http;
|
2299
3033
|
if (colorFile1)
|
@@ -2313,6 +3047,7 @@ class MagicColorService {
|
|
2313
3047
|
}
|
2314
3048
|
hexToRgba(hex, isTransperent) {
|
2315
3049
|
let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
|
3050
|
+
// convert it to format : aarrggbb
|
2316
3051
|
hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
|
2317
3052
|
return a + a + r + r + g + g + b + b;
|
2318
3053
|
});
|
@@ -2327,16 +3062,24 @@ class MagicColorService {
|
|
2327
3062
|
rgb.alpha = 0;
|
2328
3063
|
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
|
2329
3064
|
}
|
3065
|
+
/**
|
3066
|
+
* Returns the rgba value of specified color
|
3067
|
+
* @returns : value in format rgba(128,128,128,1)
|
3068
|
+
* @param : colorNumber -0 based index of color for which RGBA values are returned
|
3069
|
+
* @param: colorType : 1-MAGIC_FG_COLOR, 2-MAGIC_BG_COLOR
|
3070
|
+
*/
|
2330
3071
|
getColor(colorIndex, colorType) {
|
2331
3072
|
let isTransperent = false;
|
2332
3073
|
if (!this.colorsData && !this.fileNotFound)
|
2333
3074
|
this.getColorData();
|
2334
|
-
if (this.colorsData) {
|
3075
|
+
if (this.colorsData) { // color exists
|
2335
3076
|
if (this.colorsData[colorIndex - 1]) {
|
2336
3077
|
const grayHashCode = '00808080';
|
2337
3078
|
let hex = grayHashCode;
|
2338
|
-
let color = this.colorsData[colorIndex - 1].split(',');
|
3079
|
+
let color = this.colorsData[colorIndex - 1].split(','); // get the color details
|
2339
3080
|
let colorAtrributes = +color[3];
|
3081
|
+
// color[0] - name, color[1] - FG color, color[2] - BG color
|
3082
|
+
// color[3] - attr flags (1 - transperent, 2 - system FG, 4 - system bg)
|
2340
3083
|
switch (colorType) {
|
2341
3084
|
case MAGIC_FG_COLOR:
|
2342
3085
|
if (colorAtrributes != SYSTEM_FG && colorAtrributes != SYSTEM_FG_AND_SYSTEM_BG)
|
@@ -2360,8 +3103,8 @@ class MagicColorService {
|
|
2360
3103
|
}
|
2361
3104
|
return '';
|
2362
3105
|
}
|
2363
|
-
static ɵfac = function MagicColorService_Factory(
|
2364
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
3106
|
+
/** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(COLOR_FILE_NAME)); };
|
3107
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
2365
3108
|
}
|
2366
3109
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
2367
3110
|
type: Injectable,
|
@@ -2373,17 +3116,29 @@ class MagicColorService {
|
|
2373
3116
|
args: [COLOR_FILE_NAME]
|
2374
3117
|
}] }], null); })();
|
2375
3118
|
|
3119
|
+
/**
|
3120
|
+
* Provides the UI with values calculated by the Magic WebClient
|
3121
|
+
*/
|
2376
3122
|
class AccessorMagicService {
|
2377
3123
|
task;
|
2378
3124
|
magicColor;
|
2379
3125
|
Logger = null;
|
2380
3126
|
hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
|
2381
3127
|
hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
|
3128
|
+
/**
|
3129
|
+
* @ignore
|
3130
|
+
*/
|
2382
3131
|
constructor(task, magicColor) {
|
2383
3132
|
this.task = task;
|
2384
3133
|
this.magicColor = magicColor;
|
2385
3134
|
this.Logger = Logger.Instance;
|
2386
3135
|
}
|
3136
|
+
/**
|
3137
|
+
* Checks if the control is read-only
|
3138
|
+
* @param controlId Id of control
|
3139
|
+
* @returns Is the control not read-only
|
3140
|
+
*/
|
3141
|
+
// CheckReadOnly
|
2387
3142
|
checkIsReadOnly(controlId) {
|
2388
3143
|
let properties;
|
2389
3144
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
@@ -2392,34 +3147,91 @@ class AccessorMagicService {
|
|
2392
3147
|
else
|
2393
3148
|
return false;
|
2394
3149
|
}
|
3150
|
+
/**
|
3151
|
+
* Returns the text of the control
|
3152
|
+
* @param controlId Id of control
|
3153
|
+
* @param rowId Id of row, if applicable
|
3154
|
+
* @returns The text of the control
|
3155
|
+
*/
|
3156
|
+
// mgGetText
|
2395
3157
|
getText(controlId, rowId) {
|
2396
3158
|
return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
|
2397
3159
|
}
|
3160
|
+
/**
|
3161
|
+
* Gets the text of the tab page
|
3162
|
+
* @param controlId Id of control
|
3163
|
+
* @param layer Id of tabpage
|
3164
|
+
* @returns Text of tabpage
|
3165
|
+
*/
|
3166
|
+
// mgGetTabpageText
|
2398
3167
|
getTabpageText(controlId, layer) {
|
2399
3168
|
const items = this.task.getProperty(controlId, HtmlProperties.ItemsList);
|
2400
3169
|
if (typeof items !== "undefined")
|
2401
3170
|
return items[layer].displayValue;
|
2402
3171
|
return "";
|
2403
3172
|
}
|
3173
|
+
/**
|
3174
|
+
* Gets the image defined for the control
|
3175
|
+
* @param controlId Id of control
|
3176
|
+
* @param rowId Id of row, if applicable
|
3177
|
+
* @returns Image set on control
|
3178
|
+
*/
|
3179
|
+
// mgGetImage
|
2404
3180
|
getImage(controlId, rowId) {
|
2405
3181
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
2406
3182
|
return result;
|
2407
3183
|
}
|
3184
|
+
/**
|
3185
|
+
* Returns whether an image is set for this control
|
3186
|
+
* @param controlId Id of control
|
3187
|
+
* @param rowId Id of row, if applicable
|
3188
|
+
* @returns returns true if control has an image set on it
|
3189
|
+
*/
|
3190
|
+
// mgIsImageExists
|
2408
3191
|
isImageExists(controlId, rowId) {
|
2409
3192
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
2410
3193
|
return !isNullOrUndefined(result);
|
2411
3194
|
}
|
3195
|
+
/**
|
3196
|
+
* Gets the CSS classes set on the control
|
3197
|
+
* @param controlId Id of control
|
3198
|
+
* @param rowId Id of row, if applicable
|
3199
|
+
* @returns The classes for this control
|
3200
|
+
*/
|
3201
|
+
// mgGetClasses
|
2412
3202
|
getClasses(controlId, rowId) {
|
2413
3203
|
return this.task.getClasses(controlId, rowId);
|
2414
3204
|
}
|
3205
|
+
/**
|
3206
|
+
* Gets the CSS styles set on the control
|
3207
|
+
* @param controlId Id of control
|
3208
|
+
* @param styleName NAme of style requested
|
3209
|
+
* @param rowId Id of row, if applicable
|
3210
|
+
* @returns The style set on the control
|
3211
|
+
*/
|
3212
|
+
// mgGetStyle
|
2415
3213
|
getStyle(controlId, styleName, rowId) {
|
2416
3214
|
let style = this.task.getStyle(controlId, styleName, rowId);
|
2417
3215
|
return style;
|
2418
3216
|
}
|
3217
|
+
/**
|
3218
|
+
* Returns whether a control is visible or not
|
3219
|
+
* @param controlId Id of control
|
3220
|
+
* @param rowId Id of row, if applicable
|
3221
|
+
* @returns Is the control visible or hidden
|
3222
|
+
*/
|
3223
|
+
// mgGetVisible
|
2419
3224
|
getVisible(controlId, rowId) {
|
2420
3225
|
let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
|
2421
3226
|
return vis ? 'visible' : 'hidden';
|
2422
3227
|
}
|
3228
|
+
/**
|
3229
|
+
* Returns alpha mask of a control
|
3230
|
+
* @param controlId Id of control
|
3231
|
+
* @param rowId Id of row, if applicable
|
3232
|
+
* @returns alpha mask of the control
|
3233
|
+
*/
|
3234
|
+
// getAlphaMask
|
2423
3235
|
getAlphaMask(controlId, rowId) {
|
2424
3236
|
if (isNullOrUndefined(controlId))
|
2425
3237
|
return null;
|
@@ -2443,6 +3255,12 @@ class AccessorMagicService {
|
|
2443
3255
|
}
|
2444
3256
|
return (pic != null) ? valueStr.toString() : null;
|
2445
3257
|
}
|
3258
|
+
/**
|
3259
|
+
* Returns object representing numeric picture
|
3260
|
+
* @param picture string which is defined in magic
|
3261
|
+
* @returns object representing numeric picture
|
3262
|
+
*/
|
3263
|
+
// mgGetNumericPicture
|
2446
3264
|
getNumericPicture(picture) {
|
2447
3265
|
var obj = {};
|
2448
3266
|
if (isNullOrUndefined(picture))
|
@@ -2475,51 +3293,140 @@ class AccessorMagicService {
|
|
2475
3293
|
obj['wholes'] = pic.getWholes();
|
2476
3294
|
return obj;
|
2477
3295
|
}
|
3296
|
+
/**
|
3297
|
+
* Returns whether a control should have the "required" attribute set on it
|
3298
|
+
* @param controlId Id of control
|
3299
|
+
* @param rowId Id of row, if applicable
|
3300
|
+
* @returns
|
3301
|
+
*/
|
3302
|
+
// mgGetMustInput
|
2478
3303
|
getMustInput(controlId, rowId) {
|
2479
3304
|
let vis = this.getProperty(controlId, HtmlProperties.MustInput, rowId);
|
2480
3305
|
return vis ? 'true' : 'false';
|
2481
3306
|
}
|
3307
|
+
/**
|
3308
|
+
* Returns whether a control is disabled
|
3309
|
+
* @param controlId Id of control
|
3310
|
+
* @param rowId Id of row, if applicable
|
3311
|
+
* @returns
|
3312
|
+
*/
|
3313
|
+
// mgIsDisabled
|
2482
3314
|
isDisabled(controlId, rowId) {
|
2483
3315
|
let result = this.getProperty(controlId, HtmlProperties.Enabled, rowId);
|
2484
3316
|
return result === true ? null : true;
|
2485
3317
|
}
|
3318
|
+
/**
|
3319
|
+
* @ignore
|
3320
|
+
*/
|
3321
|
+
// getProperty (not changed)
|
2486
3322
|
getProperty(controlId, prop, rowId) {
|
2487
3323
|
return this.task.getProperty(controlId, prop, rowId);
|
2488
3324
|
}
|
3325
|
+
/**
|
3326
|
+
* Returns the title (tooltip) text of the control
|
3327
|
+
* @param controlId Id of control
|
3328
|
+
* @param rowId Id of row, if applicable
|
3329
|
+
* @returns
|
3330
|
+
*/
|
3331
|
+
// mgGetTitle
|
2489
3332
|
getTitle(controlId, rowId) {
|
2490
3333
|
return this.task.getProperty(controlId, HtmlProperties.Tooltip, rowId);
|
2491
3334
|
}
|
3335
|
+
/**
|
3336
|
+
* Returns the title (tooltip) text of the control
|
3337
|
+
* @param controlId Id of control
|
3338
|
+
* @param rowId Id of row, if applicable
|
3339
|
+
* @returns
|
3340
|
+
*/
|
3341
|
+
// mgGetTitle for zoom button
|
2492
3342
|
getZoomButtonTitle(controlId, rowId) {
|
2493
3343
|
return this.task.getProperty(controlId, HtmlProperties.ZoomButtonTooltip, rowId);
|
2494
3344
|
}
|
3345
|
+
/**
|
3346
|
+
* Gets the selection control's selected value
|
3347
|
+
* @param controlId Id of control
|
3348
|
+
* @param rowId Id of row, if applicable
|
3349
|
+
* @returns
|
3350
|
+
*/
|
3351
|
+
// getSelectedValue
|
2495
3352
|
getSelectedValue(controlId, rowId) {
|
2496
3353
|
return this.task.getProperty(controlId, HtmlProperties.SelectedValue, rowId);
|
2497
3354
|
}
|
3355
|
+
/**
|
3356
|
+
* Gets the place-holder text of the control
|
3357
|
+
* @param controlId Id of control
|
3358
|
+
* @param rowId Id of row, if applicable
|
3359
|
+
* @returns
|
3360
|
+
*/
|
3361
|
+
// mgGetPlaceholder
|
2498
3362
|
getPlaceholder(controlId, rowId) {
|
2499
3363
|
return this.task.getProperty(controlId, HtmlProperties.PlaceHolder, rowId);
|
2500
3364
|
}
|
3365
|
+
/**
|
3366
|
+
* Returns a type for input controls - should the control be a simple text or a password control
|
3367
|
+
* @param controlId Id of control
|
3368
|
+
* @param rowId Id of row, if applicable
|
3369
|
+
* @returns
|
3370
|
+
*/
|
3371
|
+
// mgGetType
|
2501
3372
|
getType(controlId, rowId) {
|
2502
3373
|
let result = this.task.getProperty(controlId, HtmlProperties.Password, rowId);
|
2503
3374
|
return result ? "password" : "text";
|
2504
3375
|
}
|
3376
|
+
/**
|
3377
|
+
* Returns the tab-index of the control
|
3378
|
+
* @param controlId Id of control
|
3379
|
+
* @param rowId Id of row, if applicable
|
3380
|
+
* @returns
|
3381
|
+
*/
|
3382
|
+
// mgGetTabIndex
|
2505
3383
|
getTabIndex(controlId, rowId) {
|
2506
3384
|
return this.task.getProperty(controlId, HtmlProperties.TabIndex, rowId);
|
2507
3385
|
}
|
3386
|
+
/**
|
3387
|
+
* Returns the value of the control
|
3388
|
+
* @param controlId Id of control
|
3389
|
+
* @param rowId Id of row, if applicable
|
3390
|
+
* @returns
|
3391
|
+
*/
|
3392
|
+
/// mgGetValue -->
|
2508
3393
|
getValue(controlId, rowId) {
|
2509
3394
|
let val = this.task.getValue(controlId, rowId);
|
2510
3395
|
return val;
|
2511
3396
|
}
|
3397
|
+
/**
|
3398
|
+
* Returns the formatted value of the control
|
3399
|
+
* @param controlId Id of control
|
3400
|
+
* @param rowId Id of row, if applicable
|
3401
|
+
* @returns
|
3402
|
+
*/
|
3403
|
+
/// mgGetValue -->
|
2512
3404
|
getFormattedValue(controlId, rowId) {
|
2513
3405
|
let val = this.task.getValue(controlId, rowId);
|
2514
3406
|
val = this.task.getFormattedValue(controlId, val, rowId);
|
2515
3407
|
return val;
|
2516
3408
|
}
|
3409
|
+
/**
|
3410
|
+
* Returns the Picture of the control
|
3411
|
+
* @param controlId Id of control
|
3412
|
+
* @param rowId Id of row, if applicable
|
3413
|
+
* @returns
|
3414
|
+
*/
|
3415
|
+
/// getPicture -->
|
2517
3416
|
getPicture(controlId, rowId) {
|
2518
3417
|
if (isNullOrUndefined(controlId))
|
2519
3418
|
return null;
|
2520
3419
|
let pic = this.task.GetControlPictureMask(controlId);
|
2521
3420
|
return (pic != null) ? pic.getFormat().toString() : null;
|
2522
3421
|
}
|
3422
|
+
/**
|
3423
|
+
* Returns the custom (user) properties of the control
|
3424
|
+
* @param controlId Id of control
|
3425
|
+
* @param propertyName Name of requested property
|
3426
|
+
* @param rowId Id of row, if applicable
|
3427
|
+
* @returns
|
3428
|
+
*/
|
3429
|
+
// mgGetCustomProperty
|
2523
3430
|
getCustomProperty(controlId, propertyNameOrRowID, rowId) {
|
2524
3431
|
if (controlId.indexOf('~') == -1)
|
2525
3432
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
@@ -2544,9 +3451,22 @@ class AccessorMagicService {
|
|
2544
3451
|
}
|
2545
3452
|
return userProperties;
|
2546
3453
|
}
|
3454
|
+
/**
|
3455
|
+
* Gets the values of the items of a selection control
|
3456
|
+
* @param id Id of control
|
3457
|
+
* @param rowId Id of row, if applicable
|
3458
|
+
* @returns
|
3459
|
+
*/
|
3460
|
+
// mgGetItemListValues
|
2547
3461
|
getItemListValues(id, rowId) {
|
2548
3462
|
return this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
2549
3463
|
}
|
3464
|
+
/**
|
3465
|
+
* Gets the filtered items list based on the current value of the control
|
3466
|
+
* @param controlId Id of control
|
3467
|
+
* @param rowId Id of row, if applicable
|
3468
|
+
* @returns
|
3469
|
+
*/
|
2550
3470
|
getFilteredList(controlId, rowId) {
|
2551
3471
|
if (isNullOrUndefined(rowId))
|
2552
3472
|
rowId = '0';
|
@@ -2559,6 +3479,12 @@ class AccessorMagicService {
|
|
2559
3479
|
else
|
2560
3480
|
return items;
|
2561
3481
|
}
|
3482
|
+
/**
|
3483
|
+
* Gets the display value of the item from items of a selection control
|
3484
|
+
* @param id Id of control
|
3485
|
+
* @param rowId Id of row, if applicable
|
3486
|
+
* @returns
|
3487
|
+
*/
|
2562
3488
|
getDisplayValue(id, rowId) {
|
2563
3489
|
let displayValue = "";
|
2564
3490
|
let o = this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
@@ -2567,6 +3493,12 @@ class AccessorMagicService {
|
|
2567
3493
|
displayValue = o[value].displayValue;
|
2568
3494
|
return displayValue;
|
2569
3495
|
}
|
3496
|
+
/**
|
3497
|
+
* Returns whether a tab page is selected or not
|
3498
|
+
* @param index of current option in iterarotr
|
3499
|
+
* @param control Id of list control
|
3500
|
+
* @returns
|
3501
|
+
*/ // isOptionSelected
|
2570
3502
|
isOptionSelected(index, controlId) {
|
2571
3503
|
let val = this.task.getValue(controlId, "0");
|
2572
3504
|
for (let item of val) {
|
@@ -2575,18 +3507,40 @@ class AccessorMagicService {
|
|
2575
3507
|
}
|
2576
3508
|
return false;
|
2577
3509
|
}
|
3510
|
+
/**
|
3511
|
+
* Returns whether a tab page is selected or not - used for the tab buttons
|
3512
|
+
* @param controlId Id of control
|
3513
|
+
* @param layer Id of the tab page
|
3514
|
+
* @returns
|
3515
|
+
*/ // mgIsTabPageSelected
|
2578
3516
|
isTabPageSelected(controlId, layer) {
|
2579
3517
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
2580
|
-
return val == (layer - 1);
|
2581
|
-
}
|
3518
|
+
return val == (layer - 1); // comparing string to number!
|
3519
|
+
}
|
3520
|
+
/**
|
3521
|
+
* Returns whether a tab page layer is selected or not - used for the div which represents the tab page
|
3522
|
+
* @param controlId Id of control
|
3523
|
+
* @param layer Id of the tab page
|
3524
|
+
* @returns
|
3525
|
+
*/ // mgIsTabLayerSelected
|
2582
3526
|
isTabPageLayerSelected(controlId, layer) {
|
2583
3527
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedLayer);
|
2584
|
-
return val == (layer - 1);
|
3528
|
+
return val == (layer - 1); // comparing string to number!
|
2585
3529
|
}
|
3530
|
+
/**
|
3531
|
+
* Returns the index of the selected tab page
|
3532
|
+
* @param controlId Id of control
|
3533
|
+
* @returns
|
3534
|
+
*/
|
2586
3535
|
getTabSelectedIndex(controlId) {
|
2587
3536
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
2588
|
-
return val;
|
3537
|
+
return val; // comparing string to number!
|
2589
3538
|
}
|
3539
|
+
// private methodes
|
3540
|
+
/**
|
3541
|
+
* @ignore
|
3542
|
+
*/
|
3543
|
+
// mgIfRowCreated
|
2590
3544
|
ifRowCreated(row) {
|
2591
3545
|
if (row == null)
|
2592
3546
|
return false;
|
@@ -2594,30 +3548,54 @@ class AccessorMagicService {
|
|
2594
3548
|
let result = this.getFormGroupByRow(rowId);
|
2595
3549
|
return !isNullOrUndefined(result);
|
2596
3550
|
}
|
3551
|
+
/**
|
3552
|
+
* @ignore
|
3553
|
+
*/
|
3554
|
+
// mgGetFormGroupByRow
|
2597
3555
|
getFormGroupByRow(id) {
|
2598
3556
|
return this.task.formGroups[id];
|
2599
3557
|
}
|
3558
|
+
/**
|
3559
|
+
* @ignore
|
3560
|
+
*/
|
3561
|
+
// isRowSelected (not changed)
|
2600
3562
|
isRowSelected(controlId, rowId) {
|
2601
3563
|
const selectedRow = this.task.getProperty(controlId, HtmlProperties.SelectedRow, "0");
|
2602
3564
|
return selectedRow == rowId;
|
2603
3565
|
}
|
3566
|
+
/**
|
3567
|
+
* Returns whether a row is in edit state
|
3568
|
+
* @param row
|
3569
|
+
*/
|
2604
3570
|
isRowInRowEditing(row) {
|
2605
3571
|
let guiRowId = '0';
|
2606
3572
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
2607
3573
|
return this.task.isRowInRowEditing(guiRowId);
|
2608
3574
|
}
|
3575
|
+
/**
|
3576
|
+
* Returns whether a row is in edit state, use this method while control outside table control
|
3577
|
+
* @param row
|
3578
|
+
*/
|
2609
3579
|
isCurrentInRowEditing() {
|
2610
3580
|
let row = this.task.tableService.getSelectedRow();
|
2611
3581
|
return this.task.isRowInRowEditing(row);
|
2612
3582
|
}
|
3583
|
+
/**
|
3584
|
+
* @ignore
|
3585
|
+
*/
|
3586
|
+
// GetGuiTopIndex
|
2613
3587
|
guiTopIndex() {
|
2614
3588
|
return this.task.tableService.getTableTopIndex();
|
2615
3589
|
}
|
3590
|
+
/**
|
3591
|
+
* @ignore
|
3592
|
+
*/
|
2616
3593
|
getErrMsg(id, rowId) {
|
2617
3594
|
let c = this.task.getFormControl(rowId, id);
|
2618
3595
|
if (c.hasError('required'))
|
2619
3596
|
return Events.GetMessageString(MsgInterface.RT_STR_FLD_MUST_UPDATED);
|
2620
3597
|
if (c.hasError('pattern')) {
|
3598
|
+
//To check whether the numeric field allowed only positive values or not.
|
2621
3599
|
if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
|
2622
3600
|
return Events.GetMessageString(MsgInterface.STR_ERR_NEGETIVE);
|
2623
3601
|
if (c.errors.pattern.requiredPattern.includes('.')) {
|
@@ -2663,6 +3641,12 @@ class AccessorMagicService {
|
|
2663
3641
|
messageString = StrUtil.replaceStringTokens(messageString, token, 1, decimalLimit.toString());
|
2664
3642
|
return messageString;
|
2665
3643
|
}
|
3644
|
+
/**
|
3645
|
+
* Sets a user-supplied value to the specified control
|
3646
|
+
* @param controlName
|
3647
|
+
* @param value
|
3648
|
+
* @param refreshDisplay
|
3649
|
+
*/
|
2666
3650
|
setValueToControl(controlName, value, refreshDisplay) {
|
2667
3651
|
if (typeof refreshDisplay === "undefined")
|
2668
3652
|
refreshDisplay = true;
|
@@ -2671,28 +3655,44 @@ class AccessorMagicService {
|
|
2671
3655
|
guiEvent.param = refreshDisplay;
|
2672
3656
|
this.task.insertEvent(guiEvent);
|
2673
3657
|
}
|
3658
|
+
/**
|
3659
|
+
* @ignore
|
3660
|
+
*/
|
2674
3661
|
isDataviewEmpty() {
|
2675
3662
|
return this.task.Records.isEmptyDataView;
|
2676
3663
|
}
|
3664
|
+
/**
|
3665
|
+
* simulates a click event on the specified control, for the Magic engine
|
3666
|
+
* @param controlName
|
3667
|
+
* @param rowId
|
3668
|
+
*/
|
2677
3669
|
simulateClick(controlName, rowId) {
|
2678
3670
|
if (typeof rowId === "undefined")
|
2679
3671
|
rowId = 0;
|
2680
3672
|
this.task.insertEvent(getGuiEventObj('click', controlName, rowId));
|
2681
3673
|
}
|
3674
|
+
/**
|
3675
|
+
* Return Boolean TRUE if user logged in Else it will return FALSE
|
3676
|
+
*/
|
2682
3677
|
isLoggedIn() {
|
2683
3678
|
return this.task.getIsLoggenIn();
|
2684
3679
|
}
|
3680
|
+
/**
|
3681
|
+
* Returns JS object containing the records with all table fields.
|
3682
|
+
*/
|
2685
3683
|
GetFormRecords() {
|
2686
3684
|
let rowId = 0;
|
2687
3685
|
let recArray;
|
2688
3686
|
if (!isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
2689
3687
|
let recList = this.task.Records.list;
|
2690
3688
|
let tableControls = new Array();
|
3689
|
+
//Generate list of table fields names
|
2691
3690
|
for (const key in this.task.template) {
|
2692
3691
|
if (this.task.template[key] == '1')
|
2693
3692
|
tableControls.push(key);
|
2694
3693
|
}
|
2695
3694
|
recArray = new Array();
|
3695
|
+
//Update the records as list of objects with values for table fields.
|
2696
3696
|
if (tableControls.length > 0) {
|
2697
3697
|
recList.forEach((ctrlMetaData) => {
|
2698
3698
|
if (this.task.Records.isRowCreated(rowId)) {
|
@@ -2708,31 +3708,54 @@ class AccessorMagicService {
|
|
2708
3708
|
}
|
2709
3709
|
return recArray;
|
2710
3710
|
}
|
3711
|
+
/**
|
3712
|
+
* SetCookie : set the cookie with specified name and value in browser
|
3713
|
+
* expires - expiration time
|
3714
|
+
* path - path which much exists in order so that cookie is sent as header
|
3715
|
+
* domain - specifies which hosts are allowed to receive the cookie
|
3716
|
+
* secure - specifies if cookie is secure ( works only with HTTPS)
|
3717
|
+
* sameSite - lets servers specify whether/when cookies are sent with cross-site requests
|
3718
|
+
*/
|
2711
3719
|
SetCookie(name, value, expires, path, domain, secure, sameSite) {
|
2712
3720
|
CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
2713
3721
|
}
|
3722
|
+
/**
|
3723
|
+
* GetCookie : get the cookie with specified name and value in browser
|
3724
|
+
*/
|
2714
3725
|
GetCookie(name) {
|
2715
3726
|
return CookieService.getCookie(name);
|
2716
3727
|
}
|
3728
|
+
/**
|
3729
|
+
* DeleteCookie : deletes the cookie
|
3730
|
+
*/
|
2717
3731
|
DeleteCookie(name) {
|
2718
3732
|
return CookieService.deleteCookie(name);
|
2719
3733
|
}
|
3734
|
+
/**
|
3735
|
+
* get RGBA color from color file
|
3736
|
+
*/
|
2720
3737
|
getColor(colorNumber, colorType) {
|
2721
3738
|
return this.magicColor.getColor(colorNumber, colorType);
|
2722
3739
|
}
|
2723
|
-
static ɵfac = function AccessorMagicService_Factory(
|
2724
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
3740
|
+
/** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MagicColorService)); };
|
3741
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
2725
3742
|
}
|
2726
3743
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessorMagicService, [{
|
2727
3744
|
type: Injectable
|
2728
3745
|
}], () => [{ type: TaskMagicService }, { type: MagicColorService }], null); })();
|
2729
3746
|
|
3747
|
+
/**
|
3748
|
+
* Central place for adding the Magic services
|
3749
|
+
*/
|
2730
3750
|
class MagicServices {
|
2731
3751
|
task;
|
2732
3752
|
subformService;
|
2733
3753
|
tableService;
|
2734
3754
|
titleService;
|
2735
3755
|
mgAccessorService;
|
3756
|
+
/**
|
3757
|
+
* @ignore
|
3758
|
+
*/
|
2736
3759
|
constructor(task, subformService, tableService, titleService, mgAccessorService) {
|
2737
3760
|
this.task = task;
|
2738
3761
|
this.subformService = subformService;
|
@@ -2744,41 +3767,85 @@ class MagicServices {
|
|
2744
3767
|
task.mgTitleService = titleService;
|
2745
3768
|
task.mgAccessorService = mgAccessorService;
|
2746
3769
|
}
|
2747
|
-
static ɵfac = function MagicServices_Factory(
|
2748
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
3770
|
+
/** @nocollapse */ static ɵfac = function MagicServices_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
|
3771
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
2749
3772
|
}
|
2750
3773
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicServices, [{
|
2751
3774
|
type: Injectable
|
2752
3775
|
}], () => [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }], null); })();
|
2753
3776
|
|
3777
|
+
/**
|
3778
|
+
* Base component representing a Magic task
|
3779
|
+
*/
|
2754
3780
|
class TaskBaseMagicComponent {
|
2755
3781
|
ref;
|
2756
3782
|
magicServices;
|
3783
|
+
/**
|
3784
|
+
* Id of task, used for initializing the task service
|
3785
|
+
*/
|
2757
3786
|
taskIdParam;
|
3787
|
+
/**
|
3788
|
+
* @ignore
|
3789
|
+
*/
|
2758
3790
|
taskDescription;
|
3791
|
+
/**
|
3792
|
+
* @ignore
|
3793
|
+
*/
|
2759
3794
|
magicProperties = MagicProperties;
|
3795
|
+
/**
|
3796
|
+
*
|
3797
|
+
* @param ref changes-detector object
|
3798
|
+
* @param magicServices Access point for all Magic services
|
3799
|
+
*/
|
2760
3800
|
constructor(ref, magicServices) {
|
2761
3801
|
this.ref = ref;
|
2762
3802
|
this.magicServices = magicServices;
|
2763
3803
|
}
|
3804
|
+
/**
|
3805
|
+
* Returns the Magic task service
|
3806
|
+
* @returns
|
3807
|
+
*/
|
2764
3808
|
get task() {
|
2765
3809
|
return this.magicServices.task;
|
2766
3810
|
}
|
3811
|
+
/**
|
3812
|
+
* Returns the Magic subform service
|
3813
|
+
* @returns
|
3814
|
+
*/
|
2767
3815
|
get mgSub() {
|
2768
3816
|
return this.magicServices.subformService;
|
2769
3817
|
}
|
3818
|
+
/**
|
3819
|
+
* Returns the Magic table service
|
3820
|
+
* @returns
|
3821
|
+
*/
|
2770
3822
|
get tableService() {
|
2771
3823
|
return this.magicServices.tableService;
|
2772
3824
|
}
|
3825
|
+
/**
|
3826
|
+
* Returns the Magic accessor service
|
3827
|
+
* @returns
|
3828
|
+
*/
|
2773
3829
|
get mg() {
|
2774
3830
|
return this.magicServices.mgAccessorService;
|
2775
3831
|
}
|
3832
|
+
/**
|
3833
|
+
* Returns the task Id
|
3834
|
+
* @returns
|
3835
|
+
*/
|
2776
3836
|
get taskId() {
|
2777
3837
|
return this.task.taskId;
|
2778
3838
|
}
|
3839
|
+
/**
|
3840
|
+
* Returns the FormGroup for screen-mode forms
|
3841
|
+
* @returns
|
3842
|
+
*/
|
2779
3843
|
get screenFormGroup() {
|
2780
3844
|
return this.task.ScreenModeControls;
|
2781
3845
|
}
|
3846
|
+
/**
|
3847
|
+
* Interface implementation
|
3848
|
+
*/
|
2782
3849
|
ngOnInit() {
|
2783
3850
|
this.task.detectChanges.pipe().subscribe(c => {
|
2784
3851
|
this.ref.detectChanges();
|
@@ -2786,24 +3853,61 @@ class TaskBaseMagicComponent {
|
|
2786
3853
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
2787
3854
|
this.createFormControlsAccessor(this.screenFormGroup);
|
2788
3855
|
this.setInputDateFormat();
|
3856
|
+
// subcribe to custom property changes
|
2789
3857
|
this.task.customPropertiesSubject.pipe().subscribe(property => {
|
2790
3858
|
this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
2791
3859
|
});
|
3860
|
+
// subcribe to records count changes
|
2792
3861
|
this.task.recordsCountChangeSubject.pipe().subscribe(value => {
|
2793
3862
|
this.RecordsCountChanged(value);
|
2794
3863
|
});
|
3864
|
+
// subcribe to mgLoad change
|
2795
3865
|
this.task.mgLoadSubject.pipe().subscribe(value => {
|
2796
3866
|
this.mgOnLoad();
|
2797
3867
|
});
|
2798
3868
|
}
|
3869
|
+
/**
|
3870
|
+
* @ignore
|
3871
|
+
*/
|
2799
3872
|
createFormControlsAccessor(formGroup) { }
|
3873
|
+
/**
|
3874
|
+
* @ignore
|
3875
|
+
*/
|
2800
3876
|
setInputDateFormat() { }
|
3877
|
+
/**
|
3878
|
+
* This method is called when the value of any custom property is updated in Magic
|
3879
|
+
* propertyName : name of property which is updated. The format is <controlname>~<propertyname>
|
3880
|
+
* rowId : row number of the updated property for controls in table control (0 for controls outside table)
|
3881
|
+
* value : updated value of the property
|
3882
|
+
* @returns : void
|
3883
|
+
* To use the method override it in your component and check the property name and write you code ..for eg
|
3884
|
+
* if(propertyName == 'controlname~propertyName') {// your code}
|
3885
|
+
* else { // your code}
|
3886
|
+
*/
|
2801
3887
|
PropertyChanged(propertyName, rowId, value) {
|
2802
|
-
|
3888
|
+
// intentionally left blank because the implementation should be in the derived class
|
3889
|
+
}
|
3890
|
+
/**
|
3891
|
+
* Records count change subject is subscribed to change in its value. This method will be called
|
3892
|
+
* as the value of records count is received at from server.
|
3893
|
+
* @returns : void
|
3894
|
+
* To use the method override it in your component.
|
3895
|
+
*/
|
2803
3896
|
RecordsCountChanged(recordsCount) {
|
2804
|
-
|
3897
|
+
// intentionally left blank because the implementation should be in the derived class
|
3898
|
+
}
|
3899
|
+
/**
|
3900
|
+
* This method will be called once engine informs UI about loading of first set of data is sent to client
|
3901
|
+
* and client has reached its first idle time.
|
3902
|
+
* @returns : void
|
3903
|
+
* To use the method override it in your component.
|
3904
|
+
*/
|
2805
3905
|
mgOnLoad() {
|
3906
|
+
// intentionally left blank because the implementation should be in the derived class
|
2806
3907
|
}
|
3908
|
+
/**
|
3909
|
+
* Interface implementation
|
3910
|
+
*/
|
2807
3911
|
ngAfterViewInit() {
|
2808
3912
|
this.mgSub.init();
|
2809
3913
|
}
|
@@ -2813,37 +3917,53 @@ class TaskBaseMagicComponent {
|
|
2813
3917
|
this.task.oldPageSize = this.tableService.getPageSize();
|
2814
3918
|
}
|
2815
3919
|
}
|
3920
|
+
/**
|
3921
|
+
* Interface implementation
|
3922
|
+
*/
|
2816
3923
|
ngOnDestroy() {
|
2817
3924
|
this.task.dispose();
|
2818
3925
|
}
|
2819
|
-
static ɵfac = function TaskBaseMagicComponent_Factory(
|
2820
|
-
static ɵ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 });
|
3926
|
+
/** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
|
3927
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, standalone: false, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
2821
3928
|
}
|
2822
3929
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
2823
3930
|
type: Component,
|
2824
3931
|
args: [{
|
2825
3932
|
selector: 'task-magic',
|
2826
3933
|
providers: [TaskMagicService, SubformMagicService, TableMagicService],
|
2827
|
-
template: ''
|
3934
|
+
template: '',
|
3935
|
+
standalone: false
|
2828
3936
|
}]
|
2829
3937
|
}], () => [{ type: i0.ChangeDetectorRef }, { type: MagicServices }], { taskIdParam: [{
|
2830
3938
|
type: Input
|
2831
3939
|
}], taskDescription: [{
|
2832
3940
|
type: Input
|
2833
3941
|
}] }); })();
|
2834
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src
|
3942
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber: 21 }); })();
|
2835
3943
|
|
3944
|
+
/**
|
3945
|
+
* @ignore
|
3946
|
+
*/
|
2836
3947
|
class RowMagicDirective {
|
2837
3948
|
_task;
|
2838
3949
|
element;
|
2839
3950
|
rowId;
|
3951
|
+
/**
|
3952
|
+
* The HTML element connected to this directive
|
3953
|
+
*/
|
2840
3954
|
htmlElement;
|
3955
|
+
/**
|
3956
|
+
* @ignore
|
3957
|
+
*/
|
2841
3958
|
rowChangedSubscriber = null;
|
2842
3959
|
constructor(_task, element) {
|
2843
3960
|
this._task = _task;
|
2844
3961
|
this.element = element;
|
2845
3962
|
this.htmlElement = this.element.nativeElement;
|
2846
3963
|
}
|
3964
|
+
/**
|
3965
|
+
* Initializes this object
|
3966
|
+
*/
|
2847
3967
|
ngOnInit() {
|
2848
3968
|
this.rowChangedSubscriber = this._task
|
2849
3969
|
.OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
|
@@ -2858,7 +3978,16 @@ class RowMagicDirective {
|
|
2858
3978
|
return (rect.top >= parentRect.top &&
|
2859
3979
|
rect.bottom <= parentRect.bottom);
|
2860
3980
|
}
|
3981
|
+
/**
|
3982
|
+
* Cleanup
|
3983
|
+
*/
|
2861
3984
|
ngOnDestroy() {
|
3985
|
+
// Don't know why, but when the table is loaded for the first time, we
|
3986
|
+
// get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
|
3987
|
+
// for number of rows in the page but here this.rowId is undefined.
|
3988
|
+
// Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
|
3989
|
+
// is null and hence crashes.
|
3990
|
+
// So, the condition to check nulity is added.
|
2862
3991
|
if (this.rowChangedSubscriber !== null) {
|
2863
3992
|
this.rowChangedSubscriber.unsubscribe();
|
2864
3993
|
}
|
@@ -2870,15 +3999,16 @@ class RowMagicDirective {
|
|
2870
3999
|
event.cancelBubble = true;
|
2871
4000
|
}
|
2872
4001
|
}
|
2873
|
-
static ɵfac = function RowMagicDirective_Factory(
|
2874
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4002
|
+
/** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
4003
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
2875
4004
|
i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
2876
|
-
} }, inputs: { rowId: [
|
4005
|
+
} }, inputs: { rowId: [0, "magicRow", "rowId"] }, standalone: false });
|
2877
4006
|
}
|
2878
4007
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RowMagicDirective, [{
|
2879
4008
|
type: Directive,
|
2880
4009
|
args: [{
|
2881
|
-
selector: '[magicRow]'
|
4010
|
+
selector: '[magicRow]',
|
4011
|
+
standalone: false
|
2882
4012
|
}]
|
2883
4013
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }], { rowId: [{
|
2884
4014
|
type: Input,
|
@@ -2888,6 +4018,9 @@ class RowMagicDirective {
|
|
2888
4018
|
args: ['click', ['$event']]
|
2889
4019
|
}] }); })();
|
2890
4020
|
|
4021
|
+
/**
|
4022
|
+
* Connects HTML elements to the Magic Web Client engine
|
4023
|
+
*/
|
2891
4024
|
class MagicDirective {
|
2892
4025
|
_task;
|
2893
4026
|
element;
|
@@ -2900,24 +4033,64 @@ class MagicDirective {
|
|
2900
4033
|
this.selector = "magic";
|
2901
4034
|
}
|
2902
4035
|
;
|
4036
|
+
/**
|
4037
|
+
* This flag is used when we only want to register to events, but do not want to execute commands sent from server
|
4038
|
+
*/
|
2903
4039
|
set eventsOnly(val) {
|
2904
4040
|
console.log("eventsOnly");
|
2905
4041
|
this.eventsOnlyVal = true;
|
2906
4042
|
}
|
2907
4043
|
;
|
4044
|
+
/**
|
4045
|
+
* pollTime: after which value will be sent to magic
|
4046
|
+
*/
|
2908
4047
|
pollTime = 200;
|
4048
|
+
/**
|
4049
|
+
* Row id of the control, for when it is on a table
|
4050
|
+
*/
|
2909
4051
|
rowId;
|
4052
|
+
/**
|
4053
|
+
*
|
4054
|
+
*/
|
4055
|
+
//@Input() events: any[] = [];
|
4056
|
+
/**
|
4057
|
+
* The HTML element connected to this directive
|
4058
|
+
*/
|
2910
4059
|
htmlElement;
|
4060
|
+
/**
|
4061
|
+
* Magic's component handling this control
|
4062
|
+
*/
|
2911
4063
|
component;
|
4064
|
+
/**
|
4065
|
+
* Collection of event handlers for this element
|
4066
|
+
*/
|
2912
4067
|
eventHandlers = {};
|
4068
|
+
/**
|
4069
|
+
* Id of this element
|
4070
|
+
*/
|
2913
4071
|
id;
|
4072
|
+
/**
|
4073
|
+
* @ignore
|
4074
|
+
*/
|
2914
4075
|
selector;
|
4076
|
+
/**
|
4077
|
+
* @ignore
|
4078
|
+
*/
|
2915
4079
|
subscribeRefreshDom;
|
2916
4080
|
focusUnlistener;
|
2917
4081
|
eventsOnlyVal = false;
|
2918
4082
|
static opened = false;
|
2919
4083
|
static noOfAutoCompleteBoxesOpened = 0;
|
2920
4084
|
subscribeInteractiveCommands;
|
4085
|
+
/**
|
4086
|
+
*
|
4087
|
+
* @param _task The task service
|
4088
|
+
* @param element The element for which the directive is applied
|
4089
|
+
* @param renderer Renderer for the element
|
4090
|
+
* @param vcRef
|
4091
|
+
* @param platform
|
4092
|
+
* @param magicRow
|
4093
|
+
*/
|
2921
4094
|
constructor(_task, element, renderer, vcRef, platform, magicRow) {
|
2922
4095
|
this._task = _task;
|
2923
4096
|
this.element = element;
|
@@ -2926,23 +4099,43 @@ class MagicDirective {
|
|
2926
4099
|
this.platform = platform;
|
2927
4100
|
this.magicRow = magicRow;
|
2928
4101
|
this.htmlElement = this.element.nativeElement;
|
4102
|
+
//let c = (<any>this.vcRef)._view;
|
4103
|
+
//while (!(c instanceof TaskBaseMagicComponent)) {
|
4104
|
+
// c = c.component;
|
4105
|
+
//}
|
4106
|
+
//this.component = c;
|
2929
4107
|
if (!(typeof magicRow === "undefined" || magicRow === null))
|
2930
4108
|
this.rowId = magicRow.rowId;
|
2931
4109
|
}
|
4110
|
+
/**
|
4111
|
+
* Get the task service
|
4112
|
+
* @returns
|
4113
|
+
*/
|
2932
4114
|
get task() {
|
2933
4115
|
return this._task;
|
2934
4116
|
}
|
4117
|
+
/**
|
4118
|
+
* Register to the events this element may need to handle
|
4119
|
+
*/
|
2935
4120
|
regEvents() {
|
4121
|
+
// Handle events for which event handler may be removed and restored
|
2936
4122
|
this.eventHandlers["focusin"] = this.OnFocus.bind(this);
|
2937
4123
|
Object.keys(this.eventHandlers).forEach((key) => {
|
2938
4124
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
2939
4125
|
});
|
2940
|
-
|
4126
|
+
// Handle events with anonymous event handlers
|
4127
|
+
let events = ["click", "mousedown", "dblclick"]; // ,'resize', 'load', 'unload'
|
2941
4128
|
events.forEach(event => {
|
2942
4129
|
this.renderer.listen(this.htmlElement, event, (e) => {
|
4130
|
+
// check if the event is fired from zoom button ( to identify the connected zoom button in engine)
|
2943
4131
|
let fromButton = false;
|
2944
4132
|
if (this.htmlElement instanceof HTMLButtonElement)
|
2945
4133
|
fromButton = true;
|
4134
|
+
/**
|
4135
|
+
* In the case of Safari or Chrome browser on IOS, when a button is clicked, the browser does not receive
|
4136
|
+
* focus event hence the zoom action is not executed. So in order to receive focus event, enabling it exclusively
|
4137
|
+
* in the case of Safari or Chrome browser on IOS and Safari browser on Mac.
|
4138
|
+
*/
|
2946
4139
|
if (fromButton && (this.platform.IOS || this.platform.SAFARI))
|
2947
4140
|
this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
|
2948
4141
|
this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
|
@@ -2958,10 +4151,13 @@ class MagicDirective {
|
|
2958
4151
|
this.task.insertEvent(guiEvent);
|
2959
4152
|
}
|
2960
4153
|
});
|
4154
|
+
// handle the input event
|
2961
4155
|
fromEvent(this.htmlElement, "input").pipe(map((event) => {
|
2962
4156
|
return event.target.value;
|
2963
|
-
}), debounceTime(this.pollTime)
|
4157
|
+
}), debounceTime(this.pollTime) // time after which value will be sent to magic
|
4158
|
+
).subscribe((x) => {
|
2964
4159
|
if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
|
4160
|
+
// Don't support character binding for date/time values
|
2965
4161
|
let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
|
2966
4162
|
if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
|
2967
4163
|
this.task.mgAccessorService.setValueToControl(this.id, x, true);
|
@@ -2987,16 +4183,25 @@ class MagicDirective {
|
|
2987
4183
|
(e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
|
2988
4184
|
if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
|
2989
4185
|
guiEvent.keyCode = e.keyCode;
|
4186
|
+
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
2990
4187
|
if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && (!MagicDirective.opened && MagicDirective.noOfAutoCompleteBoxesOpened < 1))
|
2991
4188
|
e.cancelBubble = true;
|
2992
4189
|
this.task.insertEvent(guiEvent);
|
2993
4190
|
}
|
2994
4191
|
});
|
2995
4192
|
}
|
4193
|
+
/**
|
4194
|
+
* Handle focus event
|
4195
|
+
*/
|
2996
4196
|
OnFocus() {
|
2997
4197
|
this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
|
2998
4198
|
event.cancelBubble = true;
|
2999
4199
|
}
|
4200
|
+
/**
|
4201
|
+
* Is the command's element the same as this directive's element
|
4202
|
+
* @param command
|
4203
|
+
* @returns true/false
|
4204
|
+
*/
|
3000
4205
|
IsSameElement(command) {
|
3001
4206
|
let line = command.line;
|
3002
4207
|
if (this.task.isTableControl(command.CtrlName))
|
@@ -3005,9 +4210,17 @@ class MagicDirective {
|
|
3005
4210
|
(line === +this.rowId ||
|
3006
4211
|
(line === 0 && isNullOrUndefined(this.rowId))));
|
3007
4212
|
}
|
4213
|
+
/**
|
4214
|
+
* Is the command's element the same as this directive's component
|
4215
|
+
* @param command
|
4216
|
+
* @returns true/false
|
4217
|
+
*/
|
3008
4218
|
IsSameComponent(command) {
|
3009
4219
|
return (command.controlName === this.id);
|
3010
4220
|
}
|
4221
|
+
/**
|
4222
|
+
* @ignore
|
4223
|
+
*/
|
3011
4224
|
regUpdatesUI() {
|
3012
4225
|
this.subscribeRefreshDom = this.task
|
3013
4226
|
.refreshDom.pipe(filter(c => this.IsSameElement(c)))
|
@@ -3029,10 +4242,17 @@ class MagicDirective {
|
|
3029
4242
|
this.handleInteractiveCommands(command);
|
3030
4243
|
});
|
3031
4244
|
}
|
4245
|
+
/**
|
4246
|
+
* Initializes this object
|
4247
|
+
*/
|
3032
4248
|
ngOnInit() {
|
3033
4249
|
this.regEvents();
|
3034
4250
|
this.regUpdatesUI();
|
3035
4251
|
}
|
4252
|
+
/**
|
4253
|
+
* Handles the commands received from the Magic WebClient engine
|
4254
|
+
* @param command
|
4255
|
+
*/
|
3036
4256
|
handleCommand(command) {
|
3037
4257
|
switch (command.CommandType) {
|
3038
4258
|
case CommandType.SET_PROPERTY:
|
@@ -3040,12 +4260,16 @@ class MagicDirective {
|
|
3040
4260
|
break;
|
3041
4261
|
case CommandType.SET_FOCUS:
|
3042
4262
|
this.focusUnlistener();
|
4263
|
+
// Do not set focus on connected zoom button
|
3043
4264
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
3044
4265
|
this.htmlElement.focus();
|
3045
4266
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
|
3046
4267
|
break;
|
3047
4268
|
}
|
3048
4269
|
}
|
4270
|
+
/**
|
4271
|
+
* handle the interactive commands like CallJS
|
4272
|
+
*/
|
3049
4273
|
handleInteractiveCommands(command) {
|
3050
4274
|
switch (command._commandType) {
|
3051
4275
|
case InteractiveCommandType.CALL_JS:
|
@@ -3055,18 +4279,24 @@ class MagicDirective {
|
|
3055
4279
|
let resultString = "";
|
3056
4280
|
try {
|
3057
4281
|
if (!isNullOrUndefined(magicComponent[methodName])) {
|
4282
|
+
// invoke the method on instance of magic componenet
|
3058
4283
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
3059
4284
|
}
|
3060
4285
|
else
|
3061
|
-
console.error("Instance method " + methodName + " does not exists");
|
4286
|
+
console.error("Instance method " + methodName + " does not exists"); // when method is not found
|
3062
4287
|
}
|
3063
4288
|
catch (e) {
|
4289
|
+
// any other exception
|
3064
4290
|
console.error(e.message);
|
3065
4291
|
}
|
3066
|
-
command.resultString = resultString;
|
4292
|
+
command.resultString = resultString; // update the return value
|
3067
4293
|
break;
|
3068
4294
|
}
|
3069
4295
|
}
|
4296
|
+
/**
|
4297
|
+
* Handle the Magic set-property command
|
4298
|
+
* @param command
|
4299
|
+
*/
|
3070
4300
|
handleSetProperty(command) {
|
3071
4301
|
switch (command.Operation) {
|
3072
4302
|
case HtmlProperties.ReadOnly:
|
@@ -3080,16 +4310,20 @@ class MagicDirective {
|
|
3080
4310
|
break;
|
3081
4311
|
}
|
3082
4312
|
}
|
4313
|
+
/**
|
4314
|
+
* Cleanup
|
4315
|
+
*/
|
3083
4316
|
ngOnDestroy() {
|
3084
4317
|
this.subscribeRefreshDom.unsubscribe();
|
3085
4318
|
}
|
3086
|
-
static ɵfac = function MagicDirective_Factory(
|
3087
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" } });
|
4319
|
+
/** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$1.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
4320
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" }, standalone: false });
|
3088
4321
|
}
|
3089
4322
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
|
3090
4323
|
type: Directive,
|
3091
4324
|
args: [{
|
3092
|
-
selector: "[magic]"
|
4325
|
+
selector: "[magic]",
|
4326
|
+
standalone: false
|
3093
4327
|
}]
|
3094
4328
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$1.Platform }, { type: RowMagicDirective, decorators: [{
|
3095
4329
|
type: Optional
|
@@ -3105,6 +4339,9 @@ class MagicDirective {
|
|
3105
4339
|
type: Input
|
3106
4340
|
}] }); })();
|
3107
4341
|
|
4342
|
+
/**
|
4343
|
+
* @ignore
|
4344
|
+
*/
|
3108
4345
|
class NoControlMagicDirective extends MagicDirective {
|
3109
4346
|
set magic(val) { this.id = val; this.selector = 'magicnc'; }
|
3110
4347
|
;
|
@@ -3138,10 +4375,12 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3138
4375
|
}
|
3139
4376
|
}
|
3140
4377
|
}
|
4378
|
+
// is the div a tab control
|
3141
4379
|
isTabControl() {
|
3142
4380
|
return this.htmlElement instanceof HTMLDivElement &&
|
3143
4381
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
3144
4382
|
}
|
4383
|
+
// is the div a radio buttons wrapper
|
3145
4384
|
isRadio() {
|
3146
4385
|
return this.htmlElement instanceof HTMLDivElement &&
|
3147
4386
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
@@ -3150,6 +4389,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3150
4389
|
super.handleCommand(command);
|
3151
4390
|
switch (command.CommandType) {
|
3152
4391
|
case CommandType.SET_CLASS:
|
4392
|
+
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
3153
4393
|
const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
3154
4394
|
if (controlMetadata.removedClass != '') {
|
3155
4395
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
@@ -3162,7 +4402,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3162
4402
|
this.htmlElement.innerText = command.value;
|
3163
4403
|
if (this.htmlElement instanceof HTMLSelectElement)
|
3164
4404
|
this.htmlElement.value = command.value;
|
3165
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
4405
|
+
if (this.htmlElement instanceof HTMLAnchorElement) //hyper-text button
|
3166
4406
|
this.htmlElement.text = command.value;
|
3167
4407
|
if (this.htmlElement instanceof HTMLInputElement) {
|
3168
4408
|
if (this.htmlElement.type === "checkbox") {
|
@@ -3186,6 +4426,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3186
4426
|
break;
|
3187
4427
|
}
|
3188
4428
|
}
|
4429
|
+
// handle set-property commands
|
3189
4430
|
handleSetProperty(command) {
|
3190
4431
|
super.handleSetProperty(command);
|
3191
4432
|
switch (command.Operation) {
|
@@ -3201,6 +4442,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3201
4442
|
break;
|
3202
4443
|
case HtmlProperties.ItemsList:
|
3203
4444
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
4445
|
+
// clear the list
|
3204
4446
|
var len = this.htmlElement.length;
|
3205
4447
|
for (var i = len - 1; i >= 0; i--) {
|
3206
4448
|
this.htmlElement.remove(i);
|
@@ -3242,7 +4484,8 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3242
4484
|
let child = tabControl.children[i];
|
3243
4485
|
const layer = child.getAttribute('layer') - 1;
|
3244
4486
|
if (child instanceof HTMLButtonElement) {
|
3245
|
-
|
4487
|
+
// set button style
|
4488
|
+
if (layer == command.obj1) { // compare int to string
|
3246
4489
|
child.classList.add('tab_button_active');
|
3247
4490
|
}
|
3248
4491
|
else {
|
@@ -3250,6 +4493,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3250
4493
|
}
|
3251
4494
|
}
|
3252
4495
|
else {
|
4496
|
+
// not a buton - hide unselected tabpages
|
3253
4497
|
let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
3254
4498
|
child.setAttribute('style', style);
|
3255
4499
|
}
|
@@ -3270,13 +4514,14 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3270
4514
|
break;
|
3271
4515
|
}
|
3272
4516
|
}
|
3273
|
-
static ɵfac = function NoControlMagicDirective_Factory(
|
3274
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [
|
4517
|
+
/** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$1.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
4518
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [0, "magicnc", "magic"] }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
|
3275
4519
|
}
|
3276
4520
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
|
3277
4521
|
type: Directive,
|
3278
4522
|
args: [{
|
3279
|
-
selector: '[magicnc]'
|
4523
|
+
selector: '[magicnc]',
|
4524
|
+
standalone: false
|
3280
4525
|
}]
|
3281
4526
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$1.Platform }, { type: RowMagicDirective, decorators: [{
|
3282
4527
|
type: Optional
|
@@ -3285,9 +4530,15 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3285
4530
|
args: ['magicnc']
|
3286
4531
|
}] }); })();
|
3287
4532
|
|
4533
|
+
/**
|
4534
|
+
* @ignore
|
4535
|
+
*/
|
3288
4536
|
class Constants {
|
3289
4537
|
static DATE_FMT = 'dd/MMM/yyyy';
|
3290
4538
|
}
|
4539
|
+
/**
|
4540
|
+
* @ignore
|
4541
|
+
*/
|
3291
4542
|
class DateMagicPipe extends DatePipe {
|
3292
4543
|
_task;
|
3293
4544
|
constructor(_task) {
|
@@ -3300,6 +4551,7 @@ class DateMagicPipe extends DatePipe {
|
|
3300
4551
|
let mgDateFormatter = new MgDateFormatter();
|
3301
4552
|
if (!isNullOrUndefined(value) && mask !== null) {
|
3302
4553
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
4554
|
+
// If control is label control of table, due to query mode, then save the format here.
|
3303
4555
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
3304
4556
|
if (this._task.mgInputDateFormat == null)
|
3305
4557
|
this._task.mgInputDateFormat = formatStr;
|
@@ -3312,13 +4564,14 @@ class DateMagicPipe extends DatePipe {
|
|
3312
4564
|
value = "";
|
3313
4565
|
return value;
|
3314
4566
|
}
|
3315
|
-
static ɵfac = function DateMagicPipe_Factory(
|
3316
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
4567
|
+
/** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
4568
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true, standalone: false });
|
3317
4569
|
}
|
3318
4570
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateMagicPipe, [{
|
3319
4571
|
type: Pipe,
|
3320
4572
|
args: [{
|
3321
|
-
name: 'magicDate'
|
4573
|
+
name: 'magicDate',
|
4574
|
+
standalone: false
|
3322
4575
|
}]
|
3323
4576
|
}], () => [{ type: TaskMagicService }], null); })();
|
3324
4577
|
class MgDateFormatter {
|
@@ -3380,14 +4633,20 @@ class MgDateFormatter {
|
|
3380
4633
|
return formatStr.ToString();
|
3381
4634
|
}
|
3382
4635
|
else
|
3383
|
-
return "dd-mm-yyyy";
|
4636
|
+
return "dd-mm-yyyy"; // return default format.
|
3384
4637
|
}
|
3385
4638
|
}
|
3386
4639
|
|
4640
|
+
/**
|
4641
|
+
* Perform Magic validation on input controls which hold alphanumeric strings
|
4642
|
+
*/
|
3387
4643
|
class MgformatMagicDirective {
|
3388
4644
|
magicDir;
|
3389
4645
|
_task;
|
3390
4646
|
datePasteFlag = false;
|
4647
|
+
/**
|
4648
|
+
* @ignore
|
4649
|
+
*/
|
3391
4650
|
constructor(magicDir, _task) {
|
3392
4651
|
this.magicDir = magicDir;
|
3393
4652
|
this._task = _task;
|
@@ -3395,16 +4654,30 @@ class MgformatMagicDirective {
|
|
3395
4654
|
ngAfterViewInit() {
|
3396
4655
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3397
4656
|
if (control != null && this._task.mgInputDateFormat == null) {
|
4657
|
+
// get the first date control's format.
|
3398
4658
|
let pic = this._task.GetControlPictureMask(this.magicDir.id);
|
3399
4659
|
if (pic.getAttr() == StorageAttribute.DATE) {
|
3400
4660
|
this.formatDate(pic);
|
3401
4661
|
}
|
3402
4662
|
}
|
3403
4663
|
}
|
4664
|
+
/**
|
4665
|
+
* @ignore
|
4666
|
+
*/
|
4667
|
+
/**
|
4668
|
+
* This can be used to set pattern
|
4669
|
+
* On input, verifies the input matches the required mask
|
4670
|
+
*/
|
3404
4671
|
onFocusEvent($event) {
|
3405
4672
|
this.calculatePattern();
|
3406
4673
|
}
|
3407
4674
|
onPaste(event) {
|
4675
|
+
/**
|
4676
|
+
* This flag is needed to skip execution of dateMasking() method when user paste date in input control.
|
4677
|
+
* This is only needed when "StorageAttribute" is DATE. But to check type of "StorageAttribute", we
|
4678
|
+
need to execute getControlMetadata() method. So, to reduce this execution overload we set
|
4679
|
+
"datePasteFlag" directly.
|
4680
|
+
*/
|
3408
4681
|
this.datePasteFlag = true;
|
3409
4682
|
}
|
3410
4683
|
onInputEvent(event) {
|
@@ -3416,6 +4689,8 @@ class MgformatMagicDirective {
|
|
3416
4689
|
}
|
3417
4690
|
this.calculatePattern();
|
3418
4691
|
}
|
4692
|
+
//This method inserts '/' as a separator while entering date in the textbox.
|
4693
|
+
//Example: 10/10/2023
|
3419
4694
|
dateMasking(event) {
|
3420
4695
|
const input = event.target;
|
3421
4696
|
let cursorPos = event.target.selectionStart;
|
@@ -3568,6 +4843,10 @@ class MgformatMagicDirective {
|
|
3568
4843
|
input.setSelectionRange(start, end);
|
3569
4844
|
}
|
3570
4845
|
}
|
4846
|
+
/**
|
4847
|
+
* @ignore
|
4848
|
+
*/
|
4849
|
+
// This can be used to implement uppercase/lower case
|
3571
4850
|
onChangeEvent(event) {
|
3572
4851
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3573
4852
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
@@ -3589,6 +4868,7 @@ class MgformatMagicDirective {
|
|
3589
4868
|
this.formatDateWithCentury(event.target.value, century, control);
|
3590
4869
|
}
|
3591
4870
|
}
|
4871
|
+
/** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
|
3592
4872
|
formatDateWithCentury(userInput, century, control) {
|
3593
4873
|
const dateFormat = this._task.mgInputDateFormat;
|
3594
4874
|
const separator = userInput.includes('/') ? '/' : "-";
|
@@ -3746,6 +5026,9 @@ class MgformatMagicDirective {
|
|
3746
5026
|
const year = Number(dateArray[0]);
|
3747
5027
|
return [day, month, year];
|
3748
5028
|
}
|
5029
|
+
/**
|
5030
|
+
* @ignore
|
5031
|
+
*/
|
3749
5032
|
calculatePattern() {
|
3750
5033
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3751
5034
|
if (control != null) {
|
@@ -3764,6 +5047,7 @@ class MgformatMagicDirective {
|
|
3764
5047
|
if (control.validator == null)
|
3765
5048
|
control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3766
5049
|
else {
|
5050
|
+
// re-set all validators again
|
3767
5051
|
if (pic.isFormatExp()) {
|
3768
5052
|
control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3769
5053
|
if (isUndefined(this.magicDir.rowId))
|
@@ -3773,6 +5057,7 @@ class MgformatMagicDirective {
|
|
3773
5057
|
else
|
3774
5058
|
control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
|
3775
5059
|
}
|
5060
|
+
// control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3776
5061
|
control.updateValueAndValidity();
|
3777
5062
|
}
|
3778
5063
|
}
|
@@ -3783,6 +5068,9 @@ class MgformatMagicDirective {
|
|
3783
5068
|
let mgDateFormatter = new MgDateFormatter();
|
3784
5069
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
3785
5070
|
}
|
5071
|
+
/**
|
5072
|
+
* @ignore
|
5073
|
+
*/
|
3786
5074
|
formatAlphaUnicode(control) {
|
3787
5075
|
let value = control.value;
|
3788
5076
|
if (value !== null && value.length > 0) {
|
@@ -3808,6 +5096,9 @@ class MgformatMagicDirective {
|
|
3808
5096
|
control.setValue(valueStr.ToString());
|
3809
5097
|
}
|
3810
5098
|
}
|
5099
|
+
/**
|
5100
|
+
* @ignore
|
5101
|
+
*/
|
3811
5102
|
formatBoolean(control) {
|
3812
5103
|
let value = control.value;
|
3813
5104
|
if (value !== null && value.length > 0) {
|
@@ -3820,6 +5111,12 @@ class MgformatMagicDirective {
|
|
3820
5111
|
}
|
3821
5112
|
}
|
3822
5113
|
}
|
5114
|
+
/**
|
5115
|
+
* @ignore
|
5116
|
+
*/
|
5117
|
+
/// <summary>
|
5118
|
+
/// generate pattern from fld's format
|
5119
|
+
/// </summary>
|
3823
5120
|
generatePattern(attribute, pic) {
|
3824
5121
|
let pattern = '';
|
3825
5122
|
switch (attribute) {
|
@@ -3833,6 +5130,12 @@ class MgformatMagicDirective {
|
|
3833
5130
|
}
|
3834
5131
|
return pattern;
|
3835
5132
|
}
|
5133
|
+
/**
|
5134
|
+
* @ignore
|
5135
|
+
*/
|
5136
|
+
/// <summary>
|
5137
|
+
/// generate pattern for Alpha
|
5138
|
+
/// </summary>
|
3836
5139
|
generatePatternForNumber(pic) {
|
3837
5140
|
let patternStr = new StringBuilder();
|
3838
5141
|
patternStr.Append('^');
|
@@ -3845,6 +5148,9 @@ class MgformatMagicDirective {
|
|
3845
5148
|
patternStr.Append('$');
|
3846
5149
|
return patternStr.ToString();
|
3847
5150
|
}
|
5151
|
+
/**
|
5152
|
+
* @ignore
|
5153
|
+
*/
|
3848
5154
|
isPatternGenerationNeeded(attr, pic) {
|
3849
5155
|
switch (attr) {
|
3850
5156
|
case StorageAttribute.NUMERIC:
|
@@ -3854,6 +5160,12 @@ class MgformatMagicDirective {
|
|
3854
5160
|
return (pic.getMaskChars() > 0) ? true : false;
|
3855
5161
|
}
|
3856
5162
|
}
|
5163
|
+
/**
|
5164
|
+
* @ignore
|
5165
|
+
*/
|
5166
|
+
/// <summary>
|
5167
|
+
/// generate pattern for Alpha
|
5168
|
+
/// </summary>
|
3857
5169
|
generatePatternForAlpha(pic) {
|
3858
5170
|
let cnt = 0;
|
3859
5171
|
let inputAllChars = false;
|
@@ -3862,6 +5174,7 @@ class MgformatMagicDirective {
|
|
3862
5174
|
let pattern = new StringBuilder();
|
3863
5175
|
pattern.Append('^');
|
3864
5176
|
for (let i = 0; i < mask.length;) {
|
5177
|
+
//start new subset , if mask[i] is one of these.
|
3865
5178
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
3866
5179
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
3867
5180
|
pattern.Append('(');
|
@@ -3907,9 +5220,13 @@ class MgformatMagicDirective {
|
|
3907
5220
|
pattern.Append('$');
|
3908
5221
|
return pattern.ToString();
|
3909
5222
|
}
|
5223
|
+
/**
|
5224
|
+
* @ignore
|
5225
|
+
*/
|
3910
5226
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
3911
5227
|
changeInPattern.value = false;
|
3912
5228
|
let patternCount = 0;
|
5229
|
+
// find max chars
|
3913
5230
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
3914
5231
|
patternCount++;
|
3915
5232
|
idx++;
|
@@ -3918,21 +5235,25 @@ class MgformatMagicDirective {
|
|
3918
5235
|
changeInPattern.value = true;
|
3919
5236
|
return patternCount;
|
3920
5237
|
}
|
5238
|
+
/**
|
5239
|
+
* @ignore
|
5240
|
+
*/
|
3921
5241
|
IsPatternMatches(mask, pattern) {
|
3922
5242
|
for (let i = 0; i < pattern.length; i++)
|
3923
5243
|
if (mask == pattern[i])
|
3924
5244
|
return true;
|
3925
5245
|
return false;
|
3926
5246
|
}
|
3927
|
-
static ɵfac = function MgformatMagicDirective_Factory(
|
3928
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5247
|
+
/** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
5248
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
3929
5249
|
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("paste", function MgformatMagicDirective_paste_HostBindingHandler($event) { return ctx.onPaste($event); })("input", function MgformatMagicDirective_input_HostBindingHandler($event) { return ctx.onInputEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); })("blur", function MgformatMagicDirective_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
3930
|
-
} } });
|
5250
|
+
} }, standalone: false });
|
3931
5251
|
}
|
3932
5252
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
3933
5253
|
type: Directive,
|
3934
5254
|
args: [{
|
3935
|
-
selector: '[mgFormat]'
|
5255
|
+
selector: '[mgFormat]',
|
5256
|
+
standalone: false
|
3936
5257
|
}]
|
3937
5258
|
}], () => [{ type: MagicDirective }, { type: TaskMagicService }], { onFocusEvent: [{
|
3938
5259
|
type: HostListener,
|
@@ -3951,6 +5272,9 @@ class MgformatMagicDirective {
|
|
3951
5272
|
args: ['blur', ['$event']]
|
3952
5273
|
}] }); })();
|
3953
5274
|
|
5275
|
+
/**
|
5276
|
+
* @ignore
|
5277
|
+
*/
|
3954
5278
|
class TimeMagicPipe extends DatePipe {
|
3955
5279
|
_task;
|
3956
5280
|
constructor(_task) {
|
@@ -3986,23 +5310,37 @@ class TimeMagicPipe extends DatePipe {
|
|
3986
5310
|
}
|
3987
5311
|
return value;
|
3988
5312
|
}
|
3989
|
-
static ɵfac = function TimeMagicPipe_Factory(
|
3990
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
5313
|
+
/** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
5314
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true, standalone: false });
|
3991
5315
|
}
|
3992
5316
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
3993
5317
|
type: Pipe,
|
3994
5318
|
args: [{
|
3995
|
-
name: 'magicTime'
|
5319
|
+
name: 'magicTime',
|
5320
|
+
standalone: false
|
3996
5321
|
}]
|
3997
5322
|
}], () => [{ type: TaskMagicService }], null); })();
|
3998
5323
|
|
5324
|
+
/**
|
5325
|
+
* Validates the field range.
|
5326
|
+
*/
|
3999
5327
|
class RangeValidatorMagicDirective {
|
4000
5328
|
_task;
|
4001
5329
|
vcRef;
|
5330
|
+
/**
|
5331
|
+
*
|
5332
|
+
* @param _task The task service
|
5333
|
+
* @param vcRef
|
5334
|
+
*/
|
4002
5335
|
constructor(_task, vcRef) {
|
4003
5336
|
this._task = _task;
|
4004
5337
|
this.vcRef = vcRef;
|
4005
5338
|
}
|
5339
|
+
/**
|
5340
|
+
* Validation method
|
5341
|
+
* @param c FormControl to validate
|
5342
|
+
* @returns If validation fails, return error message, else returns null
|
5343
|
+
*/
|
4006
5344
|
validate(c) {
|
4007
5345
|
let controlName;
|
4008
5346
|
controlName = this.getControlName(c);
|
@@ -4024,12 +5362,15 @@ class RangeValidatorMagicDirective {
|
|
4024
5362
|
};
|
4025
5363
|
}
|
4026
5364
|
}
|
5365
|
+
/**
|
5366
|
+
* @ignore
|
5367
|
+
*/
|
4027
5368
|
getControlName(c) {
|
4028
5369
|
const formGroup = c.parent.controls;
|
4029
5370
|
return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
|
4030
5371
|
}
|
4031
|
-
static ɵfac = function RangeValidatorMagicDirective_Factory(
|
4032
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
|
5372
|
+
/** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
5373
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], standalone: false, features: [i0.ɵɵProvidersFeature([
|
4033
5374
|
{
|
4034
5375
|
provide: NG_VALIDATORS,
|
4035
5376
|
useExisting: RangeValidatorMagicDirective,
|
@@ -4047,7 +5388,8 @@ class RangeValidatorMagicDirective {
|
|
4047
5388
|
useExisting: RangeValidatorMagicDirective,
|
4048
5389
|
multi: true,
|
4049
5390
|
}
|
4050
|
-
]
|
5391
|
+
],
|
5392
|
+
standalone: false
|
4051
5393
|
}]
|
4052
5394
|
}], () => [{ type: TaskMagicService }, { type: i0.ViewContainerRef }], null); })();
|
4053
5395
|
|
@@ -4057,26 +5399,48 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
|
|
4057
5399
|
const ctx_r0 = i0.ɵɵnextContext();
|
4058
5400
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
4059
5401
|
} }
|
5402
|
+
/**
|
5403
|
+
* Represents a Magic subform
|
5404
|
+
*/
|
4060
5405
|
class SubformMagicComponent {
|
4061
5406
|
vcRef;
|
4062
5407
|
mgSub;
|
5408
|
+
/**
|
5409
|
+
* @ignore
|
5410
|
+
*/
|
4063
5411
|
id;
|
5412
|
+
/**
|
5413
|
+
* @ignore
|
5414
|
+
*/
|
4064
5415
|
set magic(val) { this.id = val; }
|
4065
5416
|
;
|
5417
|
+
/**
|
5418
|
+
* @ignore
|
5419
|
+
*/
|
4066
5420
|
component = null;
|
5421
|
+
/**
|
5422
|
+
* @ignore
|
5423
|
+
*/
|
4067
5424
|
constructor(vcRef, mgSub) {
|
4068
5425
|
this.vcRef = vcRef;
|
4069
5426
|
this.mgSub = mgSub;
|
5427
|
+
// For angular 13 - find the component from _hostLView
|
4070
5428
|
this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
|
4071
5429
|
}
|
5430
|
+
/**
|
5431
|
+
* @ignore
|
5432
|
+
*/
|
4072
5433
|
get Component() {
|
4073
5434
|
return this.mgSub.mgGetComp(this.id);
|
4074
5435
|
}
|
5436
|
+
/**
|
5437
|
+
* @ignore
|
5438
|
+
*/
|
4075
5439
|
get Parameters() {
|
4076
5440
|
return this.mgSub.mgGetParameters(this.id);
|
4077
5441
|
}
|
4078
|
-
static ɵfac = function SubformMagicComponent_Factory(
|
4079
|
-
static ɵ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) { if (rf & 1) {
|
5442
|
+
/** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
|
5443
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, standalone: false, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
4080
5444
|
i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
4081
5445
|
} if (rf & 2) {
|
4082
5446
|
i0.ɵɵproperty("ngIf", ctx.Component);
|
@@ -4092,13 +5456,14 @@ class SubformMagicComponent {
|
|
4092
5456
|
[ndcDynamicComponent]="Component"
|
4093
5457
|
[ndcDynamicInputs]="Parameters">
|
4094
5458
|
</ndc-dynamic>
|
4095
|
-
|
5459
|
+
`,
|
5460
|
+
standalone: false
|
4096
5461
|
}]
|
4097
5462
|
}], () => [{ type: i0.ViewContainerRef }, { type: SubformMagicService }], { magic: [{
|
4098
5463
|
type: Input,
|
4099
5464
|
args: ['magic']
|
4100
5465
|
}] }); })();
|
4101
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src
|
5466
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber: 22 }); })();
|
4102
5467
|
|
4103
5468
|
const _c0$1 = ["customContent"];
|
4104
5469
|
const _c1 = ["*"];
|
@@ -4122,12 +5487,21 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
4122
5487
|
i0.ɵɵadvance(4);
|
4123
5488
|
i0.ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
|
4124
5489
|
} }
|
5490
|
+
/**
|
5491
|
+
* Represents a Magic subform
|
5492
|
+
*/
|
4125
5493
|
class ErrorMagicComponent {
|
4126
5494
|
_task;
|
4127
5495
|
mgService;
|
4128
5496
|
changeDetectorRef;
|
5497
|
+
/**
|
5498
|
+
* @ignore
|
5499
|
+
*/
|
4129
5500
|
id;
|
4130
5501
|
rowId;
|
5502
|
+
/**
|
5503
|
+
* @ignore
|
5504
|
+
*/
|
4131
5505
|
set magic(val) {
|
4132
5506
|
this.id = val;
|
4133
5507
|
}
|
@@ -4136,18 +5510,26 @@ class ErrorMagicComponent {
|
|
4136
5510
|
this.rowId = val;
|
4137
5511
|
}
|
4138
5512
|
;
|
5513
|
+
// if true - display standard magic error message, if false - customer has provides his own content and we'll use it
|
4139
5514
|
defaultDisplay = true;
|
4140
5515
|
set CustomContent(innerComponent) {
|
4141
5516
|
this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
|
4142
5517
|
this.changeDetectorRef.detectChanges();
|
4143
5518
|
}
|
4144
5519
|
;
|
5520
|
+
/**
|
5521
|
+
* @ignore
|
5522
|
+
*/
|
4145
5523
|
constructor(_task, mgService, changeDetectorRef) {
|
4146
5524
|
this._task = _task;
|
4147
5525
|
this.mgService = mgService;
|
4148
5526
|
this.changeDetectorRef = changeDetectorRef;
|
4149
5527
|
this.rowId = "0";
|
4150
5528
|
}
|
5529
|
+
/**
|
5530
|
+
* returns true if the html element has no children
|
5531
|
+
* @param element
|
5532
|
+
*/
|
4151
5533
|
isEmpty(element) {
|
4152
5534
|
const nodes = element.childNodes;
|
4153
5535
|
for (let i = 0; i < nodes.length; i++) {
|
@@ -4158,6 +5540,9 @@ class ErrorMagicComponent {
|
|
4158
5540
|
}
|
4159
5541
|
return true;
|
4160
5542
|
}
|
5543
|
+
/**
|
5544
|
+
* @ignore
|
5545
|
+
*/
|
4161
5546
|
HasErrors(id) {
|
4162
5547
|
if (!isUndefined(id)) {
|
4163
5548
|
let control = this._task.getFormControl(this.rowId, id);
|
@@ -4178,13 +5563,13 @@ class ErrorMagicComponent {
|
|
4178
5563
|
}
|
4179
5564
|
return false;
|
4180
5565
|
}
|
4181
|
-
static ɵfac = function ErrorMagicComponent_Factory(
|
4182
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
5566
|
+
/** @nocollapse */ static ɵfac = function ErrorMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
5567
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
4183
5568
|
i0.ɵɵviewQuery(_c0$1, 5);
|
4184
5569
|
} if (rf & 2) {
|
4185
5570
|
let _t;
|
4186
5571
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CustomContent = _t.first);
|
4187
|
-
} }, inputs: { magic: "magic", rowId1: [
|
5572
|
+
} }, inputs: { magic: "magic", rowId1: [0, "rowId", "rowId1"] }, standalone: false, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [["customContent", ""], [4, "ngIf"]], template: function ErrorMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
4188
5573
|
i0.ɵɵprojectionDef();
|
4189
5574
|
i0.ɵɵtemplate(0, ErrorMagicComponent_div_0_Template, 5, 1, "div", 1);
|
4190
5575
|
} if (rf & 2) {
|
@@ -4203,7 +5588,8 @@ class ErrorMagicComponent {
|
|
4203
5588
|
{{mgService.getErrMsg(id, rowId)}}
|
4204
5589
|
</span>
|
4205
5590
|
</div>
|
4206
|
-
|
5591
|
+
`,
|
5592
|
+
standalone: false
|
4207
5593
|
}]
|
4208
5594
|
}], () => [{ type: TaskMagicService }, { type: AccessorMagicService }, { type: i0.ChangeDetectorRef }], { magic: [{
|
4209
5595
|
type: Input,
|
@@ -4215,8 +5601,11 @@ class ErrorMagicComponent {
|
|
4215
5601
|
type: ViewChild,
|
4216
5602
|
args: ['customContent', { static: false }]
|
4217
5603
|
}] }); })();
|
4218
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src
|
5604
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 24 }); })();
|
4219
5605
|
|
5606
|
+
/**
|
5607
|
+
* Directive for checkboxes, to handle the 'change' event
|
5608
|
+
*/
|
4220
5609
|
class CheckboxMagicDirective {
|
4221
5610
|
magicDirective;
|
4222
5611
|
el;
|
@@ -4224,11 +5613,17 @@ class CheckboxMagicDirective {
|
|
4224
5613
|
threeState = false;
|
4225
5614
|
subscribeRefreshDom = null;
|
4226
5615
|
isIndeterminate = false;
|
5616
|
+
/**
|
5617
|
+
* @ignore
|
5618
|
+
*/
|
4227
5619
|
constructor(magicDirective, el, task) {
|
4228
5620
|
this.magicDirective = magicDirective;
|
4229
5621
|
this.el = el;
|
4230
5622
|
this.task = task;
|
4231
5623
|
}
|
5624
|
+
/**
|
5625
|
+
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
5626
|
+
*/
|
4232
5627
|
onChange($event) {
|
4233
5628
|
if (this.threeState) {
|
4234
5629
|
this.handleThreeState();
|
@@ -4283,16 +5678,20 @@ class CheckboxMagicDirective {
|
|
4283
5678
|
checkbox.indeterminate = false;
|
4284
5679
|
value = 'checked';
|
4285
5680
|
}
|
5681
|
+
// @ts-ignore
|
4286
5682
|
this.magicDirective.task.onCheckChanged(value, this.magicDirective.id, +this.magicDirective.rowId);
|
4287
5683
|
}
|
5684
|
+
/**
|
5685
|
+
* Cleanup
|
5686
|
+
*/
|
4288
5687
|
ngOnDestroy() {
|
4289
5688
|
if (this.subscribeRefreshDom !== null)
|
4290
5689
|
this.subscribeRefreshDom.unsubscribe();
|
4291
5690
|
}
|
4292
|
-
static ɵfac = function CheckboxMagicDirective_Factory(
|
4293
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5691
|
+
/** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
5692
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4294
5693
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4295
|
-
} }, inputs: { threeState: "threeState" } });
|
5694
|
+
} }, inputs: { threeState: "threeState" }, standalone: false });
|
4296
5695
|
}
|
4297
5696
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
4298
5697
|
type: Directive,
|
@@ -4300,6 +5699,7 @@ class CheckboxMagicDirective {
|
|
4300
5699
|
selector: `
|
4301
5700
|
input[type=checkbox][magic]:not([noFormControl])
|
4302
5701
|
`,
|
5702
|
+
standalone: false
|
4303
5703
|
}]
|
4304
5704
|
}], () => [{ type: MagicDirective }, { type: i0.ElementRef }, { type: TaskMagicService }], { threeState: [{
|
4305
5705
|
type: Input
|
@@ -4308,43 +5708,62 @@ class CheckboxMagicDirective {
|
|
4308
5708
|
args: ['change', ['$event']]
|
4309
5709
|
}] }); })();
|
4310
5710
|
|
5711
|
+
/**
|
5712
|
+
* Directive for comboboxes, to handle the 'change' event
|
5713
|
+
*/
|
4311
5714
|
class ComboboxMagicDirective {
|
4312
5715
|
magicDirective;
|
4313
5716
|
constructor(magicDirective) {
|
4314
5717
|
this.magicDirective = magicDirective;
|
5718
|
+
// subcribe to refreshDom. This is a special case for native select HTML control.
|
5719
|
+
// to refresh the selected property. Else by default, HTML element doesn't get refreshed as per
|
5720
|
+
// selected value and 1st element remains selected.
|
4315
5721
|
this.magicDirective.task.refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c))).subscribe(value => {
|
4316
5722
|
let command = value;
|
4317
5723
|
if (command.Operation === HtmlProperties.ItemsList)
|
4318
5724
|
this.onComboboxItemsListChanged();
|
4319
5725
|
});
|
4320
5726
|
}
|
5727
|
+
/**
|
5728
|
+
* Handles the Combobox 'change' event - pass it to the Magic engine
|
5729
|
+
*/
|
4321
5730
|
onChange($event) {
|
4322
5731
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
4323
5732
|
}
|
5733
|
+
/**
|
5734
|
+
* To refresh Combobox selection as per selected property.
|
5735
|
+
*/
|
4324
5736
|
onComboboxItemsListChanged() {
|
4325
5737
|
this.magicDirective.task.refreshView();
|
4326
5738
|
}
|
4327
|
-
static ɵfac = function ComboboxMagicDirective_Factory(
|
4328
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5739
|
+
/** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
5740
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4329
5741
|
i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4330
|
-
} } });
|
5742
|
+
} }, standalone: false });
|
4331
5743
|
}
|
4332
5744
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComboboxMagicDirective, [{
|
4333
5745
|
type: Directive,
|
4334
5746
|
args: [{
|
4335
5747
|
selector: `select[magic]:not([multiple])`,
|
5748
|
+
standalone: false
|
4336
5749
|
}]
|
4337
5750
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4338
5751
|
type: HostListener,
|
4339
5752
|
args: ['change', ['$event']]
|
4340
5753
|
}] }); })();
|
4341
5754
|
|
5755
|
+
/**
|
5756
|
+
* This service supports custom actions on magic exit
|
5757
|
+
*/
|
4342
5758
|
class ExitMagicService {
|
5759
|
+
/**
|
5760
|
+
* Override this method to implement custom logic on magic exit
|
5761
|
+
*/
|
4343
5762
|
exitMagic() {
|
4344
5763
|
console.log("Magic application terminated");
|
4345
5764
|
}
|
4346
|
-
static ɵfac = function ExitMagicService_Factory(
|
4347
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
5765
|
+
/** @nocollapse */ static ɵfac = function ExitMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ExitMagicService)(); };
|
5766
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
4348
5767
|
}
|
4349
5768
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ExitMagicService, [{
|
4350
5769
|
type: Injectable
|
@@ -4370,6 +5789,9 @@ function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
4370
5789
|
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
4371
5790
|
i0.ɵɵelement(0, "div", 9);
|
4372
5791
|
} }
|
5792
|
+
/**
|
5793
|
+
* Root Magic component
|
5794
|
+
*/
|
4373
5795
|
class MagicShellComponent {
|
4374
5796
|
engineMagicService;
|
4375
5797
|
componentList;
|
@@ -4381,13 +5803,28 @@ class MagicShellComponent {
|
|
4381
5803
|
route;
|
4382
5804
|
router;
|
4383
5805
|
exitMagicService;
|
5806
|
+
/**
|
5807
|
+
* Root component to be displayed in the window
|
5808
|
+
*/
|
4384
5809
|
RootComponent = null;
|
5810
|
+
/**
|
5811
|
+
* parameters for the Root Component
|
5812
|
+
*/
|
4385
5813
|
RootComponentParameters;
|
4386
5814
|
overlayWindowsContainerViewRef;
|
4387
5815
|
rootMagicElementRef;
|
4388
5816
|
SpinnerTemplate;
|
4389
5817
|
showSpinner;
|
4390
5818
|
magicEngineTerminated = false;
|
5819
|
+
/**
|
5820
|
+
*
|
5821
|
+
* @param magic Magic's service
|
5822
|
+
* @param componentList Magic component list
|
5823
|
+
* @param changeDetectorRef Changes detector
|
5824
|
+
* @param titleService Title setting service
|
5825
|
+
* @param httpClient The native httpClient instance
|
5826
|
+
* @param exitMagicService Magic exit service
|
5827
|
+
*/
|
4391
5828
|
constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, route, router, exitMagicService) {
|
4392
5829
|
this.engineMagicService = engineMagicService;
|
4393
5830
|
this.componentList = componentList;
|
@@ -4402,17 +5839,24 @@ class MagicShellComponent {
|
|
4402
5839
|
this.initialize();
|
4403
5840
|
this.setTitle();
|
4404
5841
|
}
|
5842
|
+
/**
|
5843
|
+
* Before-unload event listener
|
5844
|
+
* @param event
|
5845
|
+
*/
|
4405
5846
|
onBeforeUnload(event) {
|
4406
5847
|
if (this.engineMagicService.TransCacheExists()) {
|
5848
|
+
// Show the confirmation box before unloading the browser
|
4407
5849
|
event.returnValue = 'Are you sure?';
|
4408
5850
|
return 'Are you sure?';
|
4409
5851
|
}
|
4410
5852
|
else {
|
5853
|
+
// terminate the magic server context using fetch API with keep-alive
|
4411
5854
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
4412
5855
|
this.magicEngineTerminated = true;
|
4413
5856
|
}
|
4414
5857
|
}
|
4415
5858
|
onUnload(event) {
|
5859
|
+
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
4416
5860
|
if (!this.magicEngineTerminated)
|
4417
5861
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
4418
5862
|
}
|
@@ -4424,6 +5868,7 @@ class MagicShellComponent {
|
|
4424
5868
|
if (this.router.navigated) {
|
4425
5869
|
const queryParams = this.route.snapshot.queryParams;
|
4426
5870
|
const queryParamsMap = new Map();
|
5871
|
+
// Iterate over the queryParams object and populate the Map
|
4427
5872
|
for (const key in queryParams) {
|
4428
5873
|
if (queryParams.hasOwnProperty(key)) {
|
4429
5874
|
queryParamsMap.set(key, queryParams[key].toString());
|
@@ -4437,13 +5882,26 @@ class MagicShellComponent {
|
|
4437
5882
|
setViewContainerRef(vcRef) {
|
4438
5883
|
this.overlayWindowsContainerViewRef = vcRef;
|
4439
5884
|
}
|
5885
|
+
/**
|
5886
|
+
* Initialization of Magic mechanisms
|
5887
|
+
*/
|
4440
5888
|
initialize() {
|
4441
5889
|
this.registerUICommands();
|
4442
5890
|
}
|
5891
|
+
/**
|
5892
|
+
* Set the title
|
5893
|
+
*/
|
4443
5894
|
setTitle() {
|
4444
5895
|
const newTitle = this.componentList.title;
|
4445
5896
|
this.titleService.setTitle(newTitle);
|
4446
5897
|
}
|
5898
|
+
/**
|
5899
|
+
* Set the component according to requested form
|
5900
|
+
* @param formName Name of the form to open
|
5901
|
+
* @param taskId Id of opening task
|
5902
|
+
* @param taskDescription TODO
|
5903
|
+
* @param isModal whether modal window is being opened
|
5904
|
+
*/
|
4447
5905
|
setComponent(formName, taskId, taskDescription, isModal) {
|
4448
5906
|
this.pendingCommandsCollector.startCollecting();
|
4449
5907
|
if (isModal) {
|
@@ -4455,6 +5913,9 @@ class MagicShellComponent {
|
|
4455
5913
|
}
|
4456
5914
|
this.changeDetectorRef.detectChanges();
|
4457
5915
|
}
|
5916
|
+
/**
|
5917
|
+
* @ignore
|
5918
|
+
*/
|
4458
5919
|
registerUICommands() {
|
4459
5920
|
this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
|
4460
5921
|
.subscribe(command => {
|
@@ -4466,6 +5927,10 @@ class MagicShellComponent {
|
|
4466
5927
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
|
4467
5928
|
});
|
4468
5929
|
}
|
5930
|
+
/**
|
5931
|
+
* Execute commands received from the Magic WebClient engine
|
5932
|
+
* @param command
|
5933
|
+
*/
|
4469
5934
|
executeCommand(command) {
|
4470
5935
|
switch (command.CommandType) {
|
4471
5936
|
case CommandType.OPEN_FORM:
|
@@ -4480,7 +5945,7 @@ class MagicShellComponent {
|
|
4480
5945
|
this.RootComponentParameters = {};
|
4481
5946
|
this.changeDetectorRef.detectChanges();
|
4482
5947
|
}
|
4483
|
-
else {
|
5948
|
+
else { // Close modal window
|
4484
5949
|
this.overlayWindowService.close(command.str);
|
4485
5950
|
this.changeDetectorRef.detectChanges();
|
4486
5951
|
}
|
@@ -4503,15 +5968,17 @@ class MagicShellComponent {
|
|
4503
5968
|
break;
|
4504
5969
|
}
|
4505
5970
|
}
|
4506
|
-
static ɵfac = function MagicShellComponent_Factory(
|
4507
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
5971
|
+
/** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i1$2.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
|
5972
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
4508
5973
|
i0.ɵɵviewQuery(_c0, 7);
|
4509
5974
|
} if (rf & 2) {
|
4510
5975
|
let _t;
|
4511
5976
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
4512
5977
|
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
4513
5978
|
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);
|
4514
|
-
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([
|
5979
|
+
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, standalone: false, features: [i0.ɵɵProvidersFeature([
|
5980
|
+
// ExitMagicService
|
5981
|
+
])], decls: 8, vars: 2, consts: [["magicRoot", ""], ["overlayWindowsContainer", ""], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["class", "spinner-background", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
|
4515
5982
|
i0.ɵɵelementStart(0, "div", null, 0);
|
4516
5983
|
i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 3);
|
4517
5984
|
i0.ɵɵelement(3, "div", 4, 1);
|
@@ -4526,7 +5993,9 @@ class MagicShellComponent {
|
|
4526
5993
|
}
|
4527
5994
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
|
4528
5995
|
type: Component,
|
4529
|
-
args: [{ selector: 'magic-root', providers: [
|
5996
|
+
args: [{ selector: 'magic-root', providers: [
|
5997
|
+
// ExitMagicService
|
5998
|
+
], template: `
|
4530
5999
|
<div #magicRoot>
|
4531
6000
|
<ndc-dynamic
|
4532
6001
|
*ngIf = "RootComponent !== null"
|
@@ -4545,7 +6014,7 @@ class MagicShellComponent {
|
|
4545
6014
|
<ng-template #defaultSpinner>
|
4546
6015
|
<div class="mgSpinnerClass"></div>
|
4547
6016
|
</ng-template>
|
4548
|
-
`, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
6017
|
+
`, standalone: false, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
4549
6018
|
}], () => [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: ExitMagicService, decorators: [{
|
4550
6019
|
type: Optional
|
4551
6020
|
}] }], { rootMagicElementRef: [{
|
@@ -4560,18 +6029,24 @@ class MagicShellComponent {
|
|
4560
6029
|
type: HostListener,
|
4561
6030
|
args: ['window:unload', ['$event']]
|
4562
6031
|
}] }); })();
|
4563
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src
|
6032
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 86 }); })();
|
4564
6033
|
|
6034
|
+
/**
|
6035
|
+
* @ignore
|
6036
|
+
*/
|
4565
6037
|
const CHECKBOX_VALUE_ACCESSOR = {
|
4566
6038
|
provide: NG_VALUE_ACCESSOR,
|
4567
6039
|
useExisting: forwardRef(() => MagicCheckboxControlValueAccessor),
|
4568
6040
|
multi: true,
|
4569
6041
|
};
|
6042
|
+
/**
|
6043
|
+
* Value accessor for Checkbox without a FormControl
|
6044
|
+
*/
|
4570
6045
|
class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
4571
|
-
static ɵfac = (() => { let ɵMagicCheckboxControlValueAccessor_BaseFactory; return function MagicCheckboxControlValueAccessor_Factory(
|
4572
|
-
static ɵ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) { if (rf & 1) {
|
6046
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicCheckboxControlValueAccessor_BaseFactory; return function MagicCheckboxControlValueAccessor_Factory(__ngFactoryType__) { return (ɵMagicCheckboxControlValueAccessor_BaseFactory || (ɵMagicCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor)))(__ngFactoryType__ || MagicCheckboxControlValueAccessor); }; })();
|
6047
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ 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) { if (rf & 1) {
|
4573
6048
|
i0.ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
4574
|
-
} }, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
6049
|
+
} }, standalone: false, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
4575
6050
|
}
|
4576
6051
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
4577
6052
|
type: Directive,
|
@@ -4582,20 +6057,27 @@ class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
|
4582
6057
|
input[type=checkbox][magic]:not([ngModel])
|
4583
6058
|
`,
|
4584
6059
|
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
4585
|
-
providers: [CHECKBOX_VALUE_ACCESSOR]
|
6060
|
+
providers: [CHECKBOX_VALUE_ACCESSOR],
|
6061
|
+
standalone: false
|
4586
6062
|
}]
|
4587
6063
|
}], null, null); })();
|
4588
6064
|
|
6065
|
+
/**
|
6066
|
+
* @ignore
|
6067
|
+
*/
|
4589
6068
|
const MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
4590
6069
|
provide: NG_VALUE_ACCESSOR,
|
4591
6070
|
useExisting: forwardRef(() => MagicDefaultValueAccessor),
|
4592
6071
|
multi: true
|
4593
6072
|
};
|
6073
|
+
/**
|
6074
|
+
* @ignore
|
6075
|
+
*/
|
4594
6076
|
class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
4595
|
-
static ɵfac = (() => { let ɵMagicDefaultValueAccessor_BaseFactory; return function MagicDefaultValueAccessor_Factory(
|
4596
|
-
static ɵ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) { if (rf & 1) {
|
6077
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicDefaultValueAccessor_BaseFactory; return function MagicDefaultValueAccessor_Factory(__ngFactoryType__) { return (ɵMagicDefaultValueAccessor_BaseFactory || (ɵMagicDefaultValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor)))(__ngFactoryType__ || MagicDefaultValueAccessor); }; })();
|
6078
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ 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) { if (rf & 1) {
|
4597
6079
|
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); });
|
4598
|
-
} }, exportAs: ["magic"], features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
6080
|
+
} }, exportAs: ["magic"], standalone: false, features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
4599
6081
|
}
|
4600
6082
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
4601
6083
|
type: Directive,
|
@@ -4611,22 +6093,29 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
4611
6093
|
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
4612
6094
|
},
|
4613
6095
|
providers: [MAGIC_DEFAULT_VALUE_ACCESSOR],
|
4614
|
-
exportAs: 'magic'
|
6096
|
+
exportAs: 'magic',
|
6097
|
+
standalone: false
|
4615
6098
|
}]
|
4616
6099
|
}], null, null); })();
|
4617
6100
|
|
6101
|
+
/**
|
6102
|
+
* Directive for checkboxes which should not have a form control
|
6103
|
+
*/
|
4618
6104
|
class CheckboxNoFormControlMagicDirective {
|
4619
6105
|
magicDirective;
|
4620
6106
|
constructor(magicDirective) {
|
4621
6107
|
this.magicDirective = magicDirective;
|
4622
6108
|
}
|
6109
|
+
/**
|
6110
|
+
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
6111
|
+
*/
|
4623
6112
|
onChange($event) {
|
4624
6113
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
4625
6114
|
}
|
4626
|
-
static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(
|
4627
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
6115
|
+
/** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
6116
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4628
6117
|
i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4629
|
-
} } });
|
6118
|
+
} }, standalone: false });
|
4630
6119
|
}
|
4631
6120
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
4632
6121
|
type: Directive,
|
@@ -4634,30 +6123,38 @@ class CheckboxNoFormControlMagicDirective {
|
|
4634
6123
|
selector: `
|
4635
6124
|
input[type=checkbox][magic]:([noFormControl])
|
4636
6125
|
`,
|
6126
|
+
standalone: false
|
4637
6127
|
}]
|
4638
6128
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4639
6129
|
type: HostListener,
|
4640
6130
|
args: ['change', ['$event']]
|
4641
6131
|
}] }); })();
|
4642
6132
|
|
6133
|
+
/**
|
6134
|
+
* Directive for non-checkbox input controls which do not have a form control
|
6135
|
+
*/
|
4643
6136
|
class InputNoFormControlMagicDirective {
|
4644
6137
|
magicDirective;
|
4645
6138
|
constructor(magicDirective) {
|
4646
6139
|
this.magicDirective = magicDirective;
|
4647
6140
|
}
|
6141
|
+
/**
|
6142
|
+
* Handles the 'change' event - pass it to the Magic engine
|
6143
|
+
*/
|
4648
6144
|
onChange($event) {
|
4649
6145
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
4650
6146
|
}
|
4651
|
-
static ɵfac = function InputNoFormControlMagicDirective_Factory(
|
4652
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
6147
|
+
/** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
6148
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4653
6149
|
i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4654
|
-
} } });
|
6150
|
+
} }, standalone: false });
|
4655
6151
|
}
|
4656
6152
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
4657
6153
|
type: Directive,
|
4658
6154
|
args: [{
|
4659
6155
|
selector: `input[magic]:([noFormControl]):not([type=checkbox]),
|
4660
|
-
textarea[magic]:([noFormControl]):not([type=checkbox])
|
6156
|
+
textarea[magic]:([noFormControl]):not([type=checkbox])`,
|
6157
|
+
standalone: false
|
4661
6158
|
}]
|
4662
6159
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4663
6160
|
type: HostListener,
|
@@ -4669,6 +6166,14 @@ const DATE_VALUE_ACCESSOR = {
|
|
4669
6166
|
useExisting: forwardRef(() => DateValueAccessor),
|
4670
6167
|
multi: true
|
4671
6168
|
};
|
6169
|
+
/**
|
6170
|
+
* The accessor for writing a value and listening to changes on a date input element
|
6171
|
+
*
|
6172
|
+
* ### Example
|
6173
|
+
* `<input type="date" name="birthday" ngModel dateInput>`
|
6174
|
+
* OR
|
6175
|
+
* `<input type="date" formControlName="birthday" dateInput>`
|
6176
|
+
*/
|
4672
6177
|
class DateValueAccessor {
|
4673
6178
|
renderer;
|
4674
6179
|
elementRef;
|
@@ -4687,6 +6192,7 @@ class DateValueAccessor {
|
|
4687
6192
|
this.magicDir = magicDir;
|
4688
6193
|
this._task = _task;
|
4689
6194
|
}
|
6195
|
+
/** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
|
4690
6196
|
formatDateWithCentury(userInput, century, control) {
|
4691
6197
|
const separator = userInput.includes('/') ? '/' : "-";
|
4692
6198
|
let centuryVal = parseInt(century.toString().slice(0, 2));
|
@@ -4701,6 +6207,7 @@ class DateValueAccessor {
|
|
4701
6207
|
year;
|
4702
6208
|
control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
|
4703
6209
|
}
|
6210
|
+
/** Writes a new value to the element (model -> view) */
|
4704
6211
|
writeValue(value) {
|
4705
6212
|
if (!value) {
|
4706
6213
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
@@ -4708,27 +6215,31 @@ class DateValueAccessor {
|
|
4708
6215
|
}
|
4709
6216
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
4710
6217
|
}
|
6218
|
+
/** Registers a callback function, called when value changes (view -> model) */
|
4711
6219
|
registerOnChange(fn) {
|
4712
6220
|
this.onChange = v => fn(v instanceof Date
|
4713
6221
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
4714
6222
|
: v);
|
4715
6223
|
}
|
6224
|
+
/** Registers a callback function, called when the control is blurred */
|
4716
6225
|
registerOnTouched(fn) {
|
4717
6226
|
this.onTouched = fn;
|
4718
6227
|
}
|
6228
|
+
/** Enables or disables the element when the control status changes */
|
4719
6229
|
setDisabledState(isDisabled) {
|
4720
6230
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
4721
6231
|
}
|
4722
|
-
static ɵfac = function DateValueAccessor_Factory(
|
4723
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
6232
|
+
/** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
6233
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
4724
6234
|
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
4725
|
-
} }, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
6235
|
+
} }, standalone: false, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
4726
6236
|
}
|
4727
6237
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateValueAccessor, [{
|
4728
6238
|
type: Directive,
|
4729
6239
|
args: [{
|
4730
6240
|
selector: "[dateInput]",
|
4731
|
-
providers: [DATE_VALUE_ACCESSOR]
|
6241
|
+
providers: [DATE_VALUE_ACCESSOR],
|
6242
|
+
standalone: false
|
4732
6243
|
}]
|
4733
6244
|
}], () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: MagicDirective }, { type: TaskMagicService }], { onChange: [{
|
4734
6245
|
type: HostListener,
|
@@ -4741,6 +6252,9 @@ class DateValueAccessor {
|
|
4741
6252
|
args: ['blur', ['$event']]
|
4742
6253
|
}] }); })();
|
4743
6254
|
|
6255
|
+
/**
|
6256
|
+
* 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
|
6257
|
+
*/
|
4744
6258
|
class NonMagicControlDirective {
|
4745
6259
|
_task;
|
4746
6260
|
element;
|
@@ -4751,13 +6265,38 @@ class NonMagicControlDirective {
|
|
4751
6265
|
this.selector = 'NonMagicControl';
|
4752
6266
|
}
|
4753
6267
|
;
|
6268
|
+
/**
|
6269
|
+
* The HTML element connected to this directive
|
6270
|
+
*/
|
4754
6271
|
htmlElement;
|
6272
|
+
/**
|
6273
|
+
* Magic's component handling this control
|
6274
|
+
*/
|
4755
6275
|
component;
|
6276
|
+
/**
|
6277
|
+
* Collection of event handlers for this element
|
6278
|
+
*/
|
4756
6279
|
eventHandlers = {};
|
6280
|
+
/**
|
6281
|
+
* Id of this element
|
6282
|
+
*/
|
4757
6283
|
id;
|
6284
|
+
/**
|
6285
|
+
* @ignore
|
6286
|
+
*/
|
4758
6287
|
selector;
|
6288
|
+
/**
|
6289
|
+
* @ignore
|
6290
|
+
*/
|
4759
6291
|
subscribeRefreshDom;
|
4760
6292
|
eventsOnlyVal = false;
|
6293
|
+
/**
|
6294
|
+
*
|
6295
|
+
* @param _task The task service
|
6296
|
+
* @param element The element for which the directive is applied
|
6297
|
+
* @param renderer Renderer for the element
|
6298
|
+
* @param vcRef
|
6299
|
+
*/
|
4761
6300
|
constructor(_task, element, renderer, vcRef) {
|
4762
6301
|
this._task = _task;
|
4763
6302
|
this.element = element;
|
@@ -4765,29 +6304,44 @@ class NonMagicControlDirective {
|
|
4765
6304
|
this.vcRef = vcRef;
|
4766
6305
|
this.htmlElement = this.element.nativeElement;
|
4767
6306
|
}
|
6307
|
+
/**
|
6308
|
+
* Get the task service
|
6309
|
+
* @returns
|
6310
|
+
*/
|
4768
6311
|
get task() {
|
4769
6312
|
return this._task;
|
4770
6313
|
}
|
6314
|
+
/**
|
6315
|
+
* Register to the events this element may need to handle
|
6316
|
+
*/
|
4771
6317
|
regEvents() {
|
6318
|
+
// Handle events for which event handler may be removed and restored
|
4772
6319
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
4773
6320
|
Object.keys(this.eventHandlers).forEach((key) => {
|
4774
6321
|
this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
4775
6322
|
});
|
4776
6323
|
}
|
6324
|
+
/**
|
6325
|
+
* Handle focus event
|
6326
|
+
*/
|
4777
6327
|
OnFocus() {
|
4778
6328
|
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
|
4779
6329
|
event.cancelBubble = true;
|
4780
6330
|
}
|
6331
|
+
/**
|
6332
|
+
* Initialize this object
|
6333
|
+
*/
|
4781
6334
|
ngOnInit() {
|
4782
6335
|
this.regEvents();
|
4783
6336
|
}
|
4784
|
-
static ɵfac = function NonMagicControlDirective_Factory(
|
4785
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [
|
6337
|
+
/** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
6338
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [0, "NonMagicControl", "magic"] }, standalone: false });
|
4786
6339
|
}
|
4787
6340
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NonMagicControlDirective, [{
|
4788
6341
|
type: Directive,
|
4789
6342
|
args: [{
|
4790
|
-
selector: '[NonMagicControl]'
|
6343
|
+
selector: '[NonMagicControl]',
|
6344
|
+
standalone: false
|
4791
6345
|
}]
|
4792
6346
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }], { magic: [{
|
4793
6347
|
type: Input,
|
@@ -4815,16 +6369,20 @@ class Time24MagicPipe {
|
|
4815
6369
|
}
|
4816
6370
|
return value;
|
4817
6371
|
}
|
4818
|
-
static ɵfac = function Time24MagicPipe_Factory(
|
4819
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true });
|
6372
|
+
/** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
6373
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true, standalone: false });
|
4820
6374
|
}
|
4821
6375
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
|
4822
6376
|
type: Pipe,
|
4823
6377
|
args: [{
|
4824
|
-
name: 'magicTime24'
|
6378
|
+
name: 'magicTime24',
|
6379
|
+
standalone: false
|
4825
6380
|
}]
|
4826
6381
|
}], () => [{ type: TaskMagicService }], null); })();
|
4827
6382
|
|
6383
|
+
/**
|
6384
|
+
* @ignore
|
6385
|
+
*/
|
4828
6386
|
const decs = [
|
4829
6387
|
MagicDirective,
|
4830
6388
|
CheckboxMagicDirective,
|
@@ -4856,30 +6414,29 @@ const decs = [
|
|
4856
6414
|
MagicViewContainerRef,
|
4857
6415
|
Time24MagicPipe
|
4858
6416
|
];
|
6417
|
+
/**
|
6418
|
+
* @ignore
|
6419
|
+
*/
|
4859
6420
|
class MagicModule {
|
4860
|
-
static ɵfac = function MagicModule_Factory(
|
4861
|
-
static ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
|
4862
|
-
static ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [CommonModule,
|
6421
|
+
/** @nocollapse */ static ɵfac = function MagicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicModule)(); };
|
6422
|
+
/** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: MagicModule });
|
6423
|
+
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule,
|
4863
6424
|
FormsModule,
|
4864
6425
|
ReactiveFormsModule,
|
4865
6426
|
RouterModule,
|
4866
|
-
DynamicModule,
|
4867
|
-
HttpClientModule, MaskitoModule] });
|
6427
|
+
DynamicModule, MaskitoModule] });
|
4868
6428
|
}
|
4869
6429
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
|
4870
6430
|
type: NgModule,
|
4871
6431
|
args: [{
|
4872
6432
|
declarations: [...decs],
|
4873
6433
|
exports: [...decs, MaskitoModule],
|
4874
|
-
imports: [
|
4875
|
-
CommonModule,
|
6434
|
+
imports: [CommonModule,
|
4876
6435
|
FormsModule,
|
4877
6436
|
ReactiveFormsModule,
|
4878
6437
|
RouterModule,
|
4879
|
-
DynamicModule,
|
4880
|
-
|
4881
|
-
],
|
4882
|
-
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
|
6438
|
+
DynamicModule],
|
6439
|
+
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())]
|
4883
6440
|
}]
|
4884
6441
|
}], null, null); })();
|
4885
6442
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicModule, { declarations: [MagicDirective,
|
@@ -4914,8 +6471,7 @@ class MagicModule {
|
|
4914
6471
|
FormsModule,
|
4915
6472
|
ReactiveFormsModule,
|
4916
6473
|
RouterModule,
|
4917
|
-
DynamicModule,
|
4918
|
-
HttpClientModule], exports: [MagicDirective,
|
6474
|
+
DynamicModule], exports: [MagicDirective,
|
4919
6475
|
CheckboxMagicDirective,
|
4920
6476
|
CheckboxNoFormControlMagicDirective,
|
4921
6477
|
InputNoFormControlMagicDirective,
|
@@ -5030,15 +6586,15 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
5030
6586
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
5031
6587
|
if (displayFormat === 'input') {
|
5032
6588
|
if (this.mgdtfmt == null)
|
5033
|
-
this.mgdtfmt = 'M/d/yyyy';
|
6589
|
+
this.mgdtfmt = 'M/d/yyyy'; //default format
|
5034
6590
|
return formatDate(date, this.mgdtfmt, this.locale);
|
5035
6591
|
}
|
5036
6592
|
else {
|
5037
6593
|
return date.toDateString();
|
5038
6594
|
}
|
5039
6595
|
}
|
5040
|
-
static ɵfac = function MgDateAdapter_Factory(
|
5041
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
6596
|
+
/** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
|
6597
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
5042
6598
|
}
|
5043
6599
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
|
5044
6600
|
type: Injectable
|
@@ -5051,6 +6607,9 @@ const matDateProviders = [
|
|
5051
6607
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
5052
6608
|
{ provide: MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
5053
6609
|
];
|
6610
|
+
/**
|
6611
|
+
* Magic service providers
|
6612
|
+
*/
|
5054
6613
|
const basicMagicProviders = [
|
5055
6614
|
MagicServices,
|
5056
6615
|
TaskMagicService,
|
@@ -5064,7 +6623,16 @@ const magicProviders = [
|
|
5064
6623
|
TableMagicService
|
5065
6624
|
];
|
5066
6625
|
|
6626
|
+
/**
|
6627
|
+
* @ignore
|
6628
|
+
*/
|
6629
|
+
///////////////////////////////////////////////////////////
|
6630
|
+
// class to hold gui-related helper methods
|
6631
|
+
///////////////////////////////////////////////////////////
|
5067
6632
|
class utils {
|
6633
|
+
///////////////////////////////////////////////////////////
|
6634
|
+
// Calculate the distance between the control and the supplied x,y coordinates
|
6635
|
+
///////////////////////////////////////////////////////////
|
5068
6636
|
static getDistance(control, x, y) {
|
5069
6637
|
let left = control.clientLeft, top = control.clientTop;
|
5070
6638
|
let dx, dy;
|
@@ -5091,6 +6659,9 @@ class utils {
|
|
5091
6659
|
const ret = (dx * dx + dy * dy);
|
5092
6660
|
return ret;
|
5093
6661
|
}
|
6662
|
+
///////////////////////////////////////////////////////////
|
6663
|
+
//
|
6664
|
+
///////////////////////////////////////////////////////////
|
5094
6665
|
static getDimentions(el) {
|
5095
6666
|
let xPos = 0;
|
5096
6667
|
let yPos = 0;
|
@@ -5098,12 +6669,14 @@ class utils {
|
|
5098
6669
|
let height = el.height;
|
5099
6670
|
while (el) {
|
5100
6671
|
if (el.tagName == "BODY") {
|
6672
|
+
// deal with browser quirks with body/window/document and page scroll
|
5101
6673
|
let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
5102
6674
|
let yScroll = el.scrollTop || document.documentElement.scrollTop;
|
5103
6675
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
5104
6676
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
5105
6677
|
}
|
5106
6678
|
else {
|
6679
|
+
// for all other non-BODY elements
|
5107
6680
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
5108
6681
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
5109
6682
|
}
|
@@ -5118,11 +6691,22 @@ class utils {
|
|
5118
6691
|
}
|
5119
6692
|
}
|
5120
6693
|
|
6694
|
+
/**
|
6695
|
+
* @ignore
|
6696
|
+
*/
|
5121
6697
|
class ModalFormDefinition {
|
5122
6698
|
taskId = "";
|
5123
6699
|
comp = null;
|
5124
6700
|
parameters = {};
|
5125
6701
|
}
|
5126
6702
|
|
6703
|
+
/**
|
6704
|
+
* @file Automatically generated by barrelsby.
|
6705
|
+
*/
|
6706
|
+
|
6707
|
+
/**
|
6708
|
+
* Generated bundle index. Do not edit.
|
6709
|
+
*/
|
6710
|
+
|
5127
6711
|
export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, COLOR_FILE_NAME, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, Time24MagicPipe, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
5128
6712
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|