@magic-xpa/angular 4.800.0-dev480.16 → 4.800.0-dev480.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/magic-xpa-angular.umd.js +218 -1515
- package/bundles/magic-xpa-angular.umd.js.map +1 -1
- package/bundles/magic-xpa-angular.umd.min.js +2 -2
- package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/magic-xpa-angular.js +1 -4
- package/esm2015/src/controls.metadata.model.js +3 -36
- package/esm2015/src/interfaces/sub-form-definition.iterface.js +1 -1
- package/esm2015/src/magic.core.module.js +4 -14
- package/esm2015/src/services/ISubformMagicService.js +1 -1
- package/esm2015/src/services/OverlayWindowService.js +4 -29
- package/esm2015/src/services/StylesMapManager.js +1 -4
- package/esm2015/src/services/accessor.magic.service.js +39 -249
- package/esm2015/src/services/commands-collector.magic.service.js +4 -7
- package/esm2015/src/services/component-list.magic.service.js +1 -25
- package/esm2015/src/services/confirmation.components.magic.provider.js +4 -24
- package/esm2015/src/services/engine.magic.service.js +7 -10
- package/esm2015/src/services/exit.magic.service.js +4 -10
- package/esm2015/src/services/magic.providers.js +1 -4
- package/esm2015/src/services/magic.services.js +4 -10
- package/esm2015/src/services/mg-date-adapter.js +5 -5
- package/esm2015/src/services/overlay.conainer.magic.provider.js +4 -8
- package/esm2015/src/services/router-commands.magic.service.js +4 -10
- package/esm2015/src/services/subform.magic.service.js +25 -51
- package/esm2015/src/services/table.magic.service.js +5 -61
- package/esm2015/src/services/task.magics.service.js +13 -281
- package/esm2015/src/services/title.magic.service.js +4 -15
- package/esm2015/src/ui/GuiInteractiveExecutor.js +1 -6
- package/esm2015/src/ui/components/base-magic-alert.component.js +4 -14
- package/esm2015/src/ui/components/base-magic-confirm.component.js +4 -16
- package/esm2015/src/ui/components/magic-alert.component.js +5 -8
- package/esm2015/src/ui/components/magic-confirmation-box.component.js +5 -8
- package/esm2015/src/ui/directives/NonMagicControlDirective.js +4 -31
- package/esm2015/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/checkbox.magic.directive.js +4 -13
- package/esm2015/src/ui/directives/magic/combobox.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.js +4 -16
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/input.noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/nocontrol.magic.directive.js +6 -16
- package/esm2015/src/ui/directives/magic/row.magic.directive.js +4 -22
- package/esm2015/src/ui/directives/magic-focus.directive.js +4 -7
- package/esm2015/src/ui/directives/magic.directive.js +8 -81
- package/esm2015/src/ui/directives/magicViewContainerRef.directive.js +4 -8
- package/esm2015/src/ui/directives/mgformat.magic.directive.js +4 -57
- package/esm2015/src/ui/directives/range-validator.magic.directive.js +4 -20
- package/esm2015/src/ui/magic-confirmationBox.js +1 -25
- package/esm2015/src/ui/magic-modal/base-magic-overlay-container.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-modal-form.js +1 -4
- package/esm2015/src/ui/magic-modal/magic-modal-interface.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-overlay-container-wrapper.js +4 -21
- package/esm2015/src/ui/magic-modal/magic-overlay-container.js +4 -46
- package/esm2015/src/ui/magic-root.component.js +10 -53
- package/esm2015/src/ui/mgerror.magic.component.js +4 -21
- package/esm2015/src/ui/pipes/date.magic.pipe.js +5 -12
- package/esm2015/src/ui/pipes/time.magic.pipe.js +4 -7
- package/esm2015/src/ui/router-container.magic.component.js +4 -32
- package/esm2015/src/ui/subform.magic.component.js +4 -23
- package/esm2015/src/ui/task-base.magic.component.js +4 -74
- package/esm2015/src/ui/utils.js +1 -20
- package/fesm2015/magic-xpa-angular.js +218 -1519
- package/fesm2015/magic-xpa-angular.js.map +1 -1
- package/magic-xpa-angular.d.ts +0 -3
- package/package.json +3 -3
- package/src/controls.metadata.model.d.ts +0 -16
- package/src/interfaces/sub-form-definition.iterface.d.ts +0 -6
- package/src/magic.core.module.d.ts +0 -3
- package/src/services/OverlayWindowService.d.ts +0 -19
- package/src/services/StylesMapManager.d.ts +0 -3
- package/src/services/accessor.magic.service.d.ts +15 -208
- package/src/services/commands-collector.magic.service.d.ts +0 -3
- package/src/services/component-list.magic.service.d.ts +0 -27
- package/src/services/confirmation.components.magic.provider.d.ts +0 -16
- package/src/services/engine.magic.service.d.ts +1 -3
- package/src/services/exit.magic.service.d.ts +0 -6
- package/src/services/magic.providers.d.ts +0 -3
- package/src/services/magic.services.d.ts +0 -6
- package/src/services/router-commands.magic.service.d.ts +0 -6
- package/src/services/subform.magic.service.d.ts +5 -30
- package/src/services/table.magic.service.d.ts +0 -55
- package/src/services/task.magics.service.d.ts +1 -294
- package/src/services/title.magic.service.d.ts +0 -11
- package/src/ui/GuiInteractiveExecutor.d.ts +0 -3
- package/src/ui/components/base-magic-alert.component.d.ts +0 -16
- package/src/ui/components/base-magic-confirm.component.d.ts +0 -18
- package/src/ui/components/magic-alert.component.d.ts +0 -3
- package/src/ui/components/magic-confirmation-box.component.d.ts +0 -3
- package/src/ui/directives/NonMagicControlDirective.d.ts +0 -41
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +0 -9
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +0 -12
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +0 -3
- package/src/ui/directives/magic/row.magic.directive.d.ts +0 -15
- package/src/ui/directives/magic-focus.directive.d.ts +0 -3
- package/src/ui/directives/magic.directive.d.ts +0 -78
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +0 -3
- package/src/ui/directives/mgformat.magic.directive.d.ts +0 -40
- package/src/ui/directives/range-validator.magic.directive.d.ts +0 -16
- package/src/ui/magic-confirmationBox.d.ts +0 -19
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +0 -9
- package/src/ui/magic-modal/magic-modal-form.d.ts +0 -3
- package/src/ui/magic-modal/magic-modal-interface.d.ts +0 -27
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +0 -20
- package/src/ui/magic-modal/magic-overlay-container.d.ts +0 -51
- package/src/ui/magic-root.component.d.ts +0 -42
- package/src/ui/mgerror.magic.component.d.ts +0 -19
- package/src/ui/pipes/date.magic.pipe.d.ts +0 -6
- package/src/ui/pipes/time.magic.pipe.d.ts +0 -3
- package/src/ui/router-container.magic.component.d.ts +0 -19
- package/src/ui/subform.magic.component.d.ts +0 -21
- package/src/ui/task-base.magic.component.d.ts +0 -72
- package/src/ui/utils.d.ts +0 -3
|
@@ -6,7 +6,7 @@ import { FormGroup, FormControl, Validators, NG_VALIDATORS, NG_VALUE_ACCESSOR, C
|
|
|
6
6
|
import { DynamicComponent, DynamicIoDirective, DynamicModule } from 'ng-dynamic-component';
|
|
7
7
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
|
8
8
|
import { Subject } from 'rxjs';
|
|
9
|
-
import { MagicBridge, getGuiEventObj } from '@magic-xpa/engine';
|
|
9
|
+
import { MagicBridge, getGuiEventObj, CookieService } from '@magic-xpa/engine';
|
|
10
10
|
import { InteractiveCommandType, OverlayType, Styles, HtmlProperties, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
|
|
11
11
|
import { MagicProperties, StorageAttribute, Logger, BindingLevel, StorageAttributeType, StrUtil, PICInterface } from '@magic-xpa/utils';
|
|
12
12
|
import { filter, map, debounceTime } from 'rxjs/operators';
|
|
@@ -17,20 +17,15 @@ import { HttpClient, HttpClientModule } from '@angular/common/http';
|
|
|
17
17
|
import { NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
|
18
18
|
import { Platform } from '@angular/cdk/platform';
|
|
19
19
|
|
|
20
|
-
/**
|
|
21
|
-
* @ignore
|
|
22
|
-
*/
|
|
23
20
|
class ControlMetadata {
|
|
24
21
|
constructor() {
|
|
25
22
|
this.properties = new Map();
|
|
26
23
|
this.classesMap = new Map();
|
|
27
24
|
this.stylesMap = new Map();
|
|
28
|
-
// user properties
|
|
29
25
|
this.userProperties = new Map();
|
|
30
26
|
this.customValidators = new Map();
|
|
31
27
|
}
|
|
32
28
|
setClass(key, value) {
|
|
33
|
-
// for no-control - hold the name of the class to be removed later
|
|
34
29
|
if (this.classesMap.has(key)) {
|
|
35
30
|
this.removedClass = this.classesMap.get(key);
|
|
36
31
|
}
|
|
@@ -45,14 +40,9 @@ class ControlMetadata {
|
|
|
45
40
|
this.stylesMap.set(key, value);
|
|
46
41
|
}
|
|
47
42
|
}
|
|
48
|
-
/**
|
|
49
|
-
* @ignore
|
|
50
|
-
*/
|
|
51
43
|
class ControlsMetadata {
|
|
52
44
|
constructor() {
|
|
53
|
-
//values of control
|
|
54
45
|
this.values = new Map();
|
|
55
|
-
// dictionary of controls with there properties
|
|
56
46
|
this.ControlsProperties = new Map();
|
|
57
47
|
this.isCreated = false;
|
|
58
48
|
this.isEditing = false;
|
|
@@ -66,8 +56,6 @@ class ControlsMetadata {
|
|
|
66
56
|
return this.ControlsProperties.get(controlId);
|
|
67
57
|
}
|
|
68
58
|
update(obj) {
|
|
69
|
-
//should we keep the values here ?
|
|
70
|
-
//this.values = obj.ControlsValues;
|
|
71
59
|
let props = obj.ControlsMetaData;
|
|
72
60
|
for (let controlName in props) {
|
|
73
61
|
if (!this.ControlsProperties.has(controlName))
|
|
@@ -96,16 +84,13 @@ class ControlsMetadata {
|
|
|
96
84
|
return this.values.get(controlName);
|
|
97
85
|
}
|
|
98
86
|
}
|
|
99
|
-
/**
|
|
100
|
-
* @ignore
|
|
101
|
-
*/
|
|
102
87
|
class Records {
|
|
103
88
|
constructor() {
|
|
104
89
|
this.data = new Map();
|
|
105
|
-
this.list = [];
|
|
90
|
+
this.list = [];
|
|
106
91
|
this.recordsBeforeCurrentView = 0;
|
|
107
92
|
this.isEmptyDataView = false;
|
|
108
|
-
this.sizeUpdated = false;
|
|
93
|
+
this.sizeUpdated = false;
|
|
109
94
|
}
|
|
110
95
|
getRow(dvRowId) {
|
|
111
96
|
return this.list[dvRowId + this.recordsBeforeCurrentView];
|
|
@@ -129,24 +114,14 @@ class Records {
|
|
|
129
114
|
}
|
|
130
115
|
return false;
|
|
131
116
|
}
|
|
132
|
-
/*
|
|
133
|
-
* for row editing
|
|
134
|
-
* */
|
|
135
117
|
startRowEditing(guiRowId) {
|
|
136
118
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
|
137
119
|
this.data.get(guiRowId).isEditing = true;
|
|
138
120
|
}
|
|
139
|
-
/*
|
|
140
|
-
* stop row editing on row Id
|
|
141
|
-
* */
|
|
142
121
|
stopRowEditing(guiRowId) {
|
|
143
122
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
|
144
123
|
this.data.get(guiRowId).isEditing = false;
|
|
145
124
|
}
|
|
146
|
-
/*
|
|
147
|
-
* return if row is in editing
|
|
148
|
-
* Called by the HTML code, so parameter is a string, not a numebr
|
|
149
|
-
* */
|
|
150
125
|
isRowInRowEditing(guiRowId) {
|
|
151
126
|
if (+guiRowId < this.list.length) {
|
|
152
127
|
if (!this.data.has(+guiRowId) || isNullOrUndefined(this.data.get(+guiRowId)))
|
|
@@ -175,7 +150,6 @@ class Records {
|
|
|
175
150
|
updateSize(len) {
|
|
176
151
|
if (this.list.length != len) {
|
|
177
152
|
if (len < this.list.length) {
|
|
178
|
-
//remove rows
|
|
179
153
|
for (let i = len; i < this.list.length; i++) {
|
|
180
154
|
this.data.delete(i);
|
|
181
155
|
}
|
|
@@ -184,10 +158,6 @@ class Records {
|
|
|
184
158
|
this.sizeUpdated = true;
|
|
185
159
|
}
|
|
186
160
|
}
|
|
187
|
-
/**
|
|
188
|
-
* crears data for the first record
|
|
189
|
-
* @param template
|
|
190
|
-
*/
|
|
191
161
|
clearFirstTableRecord(template) {
|
|
192
162
|
if (this.list.length >= 1) {
|
|
193
163
|
for (const key in template) {
|
|
@@ -218,9 +188,6 @@ class Records {
|
|
|
218
188
|
return this.guiTopIndex;
|
|
219
189
|
}
|
|
220
190
|
}
|
|
221
|
-
/**
|
|
222
|
-
* @ignore
|
|
223
|
-
*/
|
|
224
191
|
var HtmlClasses;
|
|
225
192
|
(function (HtmlClasses) {
|
|
226
193
|
HtmlClasses["Color"] = "color";
|
|
@@ -229,16 +196,11 @@ var HtmlClasses;
|
|
|
229
196
|
HtmlClasses["HintColor"] = "hintcolor";
|
|
230
197
|
})(HtmlClasses || (HtmlClasses = {}));
|
|
231
198
|
|
|
232
|
-
/**
|
|
233
|
-
* @ignore
|
|
234
|
-
*/
|
|
235
199
|
class EngineMagicService {
|
|
236
200
|
constructor() {
|
|
237
201
|
this.magicBridge = MagicBridge;
|
|
238
202
|
this.isStub = false;
|
|
239
|
-
// true when user is logged in magic
|
|
240
203
|
this.isLoggedIn = false;
|
|
241
|
-
//TODO - unregister
|
|
242
204
|
this.refreshDom = new Subject();
|
|
243
205
|
this.interactiveCommands = new Subject();
|
|
244
206
|
}
|
|
@@ -281,6 +243,9 @@ class EngineMagicService {
|
|
|
281
243
|
GetControlPictureMask(taskId, controlName) {
|
|
282
244
|
return this.magicBridge.GetControlPictureMask(taskId, controlName);
|
|
283
245
|
}
|
|
246
|
+
GetFormattedValue(taskId, controlName, value) {
|
|
247
|
+
return this.magicBridge.GetFormattedValue(taskId, controlName, value);
|
|
248
|
+
}
|
|
284
249
|
ValidateControlValue(taskId, controlName, value) {
|
|
285
250
|
return this.magicBridge.ValidateControlValue(taskId, controlName, value);
|
|
286
251
|
}
|
|
@@ -288,7 +253,6 @@ class EngineMagicService {
|
|
|
288
253
|
return this.magicBridge.GetFldRanges(taskId, controlName);
|
|
289
254
|
}
|
|
290
255
|
saveData(data) {
|
|
291
|
-
//this.magicBridge.saveData(data);
|
|
292
256
|
}
|
|
293
257
|
getIsLoggedIn() {
|
|
294
258
|
return this.isLoggedIn;
|
|
@@ -303,24 +267,15 @@ class EngineMagicService {
|
|
|
303
267
|
this.magicBridge.TerminateContextUsingFetchAPI();
|
|
304
268
|
}
|
|
305
269
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
270
|
+
EngineMagicService.ɵfac = function EngineMagicService_Factory(t) { return new (t || EngineMagicService)(); };
|
|
271
|
+
EngineMagicService.ɵprov = ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac });
|
|
272
|
+
(function () { ɵsetClassMetadata(EngineMagicService, [{
|
|
309
273
|
type: Injectable
|
|
310
274
|
}], null, null); })();
|
|
311
275
|
|
|
312
|
-
/**
|
|
313
|
-
* Manages the list of components in a project, and the project title
|
|
314
|
-
*/
|
|
315
276
|
class ComponentListMagicService {
|
|
316
277
|
constructor() {
|
|
317
|
-
/**
|
|
318
|
-
* Map of project components
|
|
319
|
-
*/
|
|
320
278
|
this.components = new Map();
|
|
321
|
-
/**
|
|
322
|
-
* Map of project dialogs
|
|
323
|
-
*/
|
|
324
279
|
this.dialogs = new Map();
|
|
325
280
|
this.lazyLoadModulesMap = null;
|
|
326
281
|
}
|
|
@@ -334,11 +289,6 @@ class ComponentListMagicService {
|
|
|
334
289
|
data = this.components.get(name);
|
|
335
290
|
return data;
|
|
336
291
|
}
|
|
337
|
-
/**
|
|
338
|
-
* Return a component according to name
|
|
339
|
-
* @param name Name of requested component
|
|
340
|
-
* @returns The requested component
|
|
341
|
-
*/
|
|
342
292
|
getComponent(name, mustHaveData = true) {
|
|
343
293
|
let data = this.getData(name, mustHaveData);
|
|
344
294
|
return data ? data.component : null;
|
|
@@ -349,29 +299,16 @@ class ComponentListMagicService {
|
|
|
349
299
|
this.components.set(key, data);
|
|
350
300
|
}
|
|
351
301
|
}
|
|
352
|
-
/**
|
|
353
|
-
* Return a component according to name
|
|
354
|
-
* @param name Name of requested component
|
|
355
|
-
* @returns The requested component
|
|
356
|
-
*/
|
|
357
302
|
getModuleRef(name) {
|
|
358
303
|
let data = this.getData(name, false);
|
|
359
304
|
return data ? data.moduleRef : null;
|
|
360
305
|
;
|
|
361
306
|
}
|
|
362
|
-
/**
|
|
363
|
-
* Return the lazy load module details of the specified component
|
|
364
|
-
* @param name: Name of requested component
|
|
365
|
-
* @returns: lazy load module details
|
|
366
|
-
*/
|
|
367
307
|
getLazyLoadModuleData(name) {
|
|
368
308
|
return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
|
|
369
309
|
}
|
|
370
310
|
}
|
|
371
311
|
|
|
372
|
-
/**
|
|
373
|
-
* @ignore
|
|
374
|
-
*/
|
|
375
312
|
class StylesMapManager {
|
|
376
313
|
static magicValueGetStyle(styleName, magicValue) {
|
|
377
314
|
let style = "";
|
|
@@ -398,12 +335,8 @@ StylesMapManager.MagicPropertyToHtmlAttributeMap = new Map([
|
|
|
398
335
|
[MagicProperties.Wallpaper, "background-image"]
|
|
399
336
|
]);
|
|
400
337
|
|
|
401
|
-
/**
|
|
402
|
-
* @ignore
|
|
403
|
-
*/
|
|
404
338
|
class GuiInteractiveExecutor {
|
|
405
339
|
Run() {
|
|
406
|
-
// Sets the currentContextID
|
|
407
340
|
try {
|
|
408
341
|
switch (this.command._commandType) {
|
|
409
342
|
case InteractiveCommandType.GET_VALUE:
|
|
@@ -434,7 +367,6 @@ class GuiInteractiveExecutor {
|
|
|
434
367
|
}
|
|
435
368
|
catch (ex) {
|
|
436
369
|
throw ex;
|
|
437
|
-
//want to see all the exceptions for now
|
|
438
370
|
}
|
|
439
371
|
}
|
|
440
372
|
static executeInteractiveCommand(task, guiIntactiveCommand, overlayService) {
|
|
@@ -511,21 +443,17 @@ BaseMagicOverlayContainer = __decorate([
|
|
|
511
443
|
Output()
|
|
512
444
|
], BaseMagicOverlayContainer);
|
|
513
445
|
|
|
514
|
-
/**
|
|
515
|
-
* Directive for setting ViewContainerRef on element
|
|
516
|
-
*/
|
|
517
446
|
class MagicViewContainerRef {
|
|
518
447
|
constructor(vcRef, resolver) {
|
|
519
448
|
this.vcRef = vcRef;
|
|
520
449
|
this.resolver = resolver;
|
|
521
|
-
// For angular 10 - find the component from the views
|
|
522
450
|
let comp = (this.vcRef._hostView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
|
|
523
451
|
comp.setViewContainerRef(vcRef);
|
|
524
452
|
}
|
|
525
453
|
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
454
|
+
MagicViewContainerRef.ɵfac = function MagicViewContainerRef_Factory(t) { return new (t || MagicViewContainerRef)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentFactoryResolver)); };
|
|
455
|
+
MagicViewContainerRef.ɵdir = ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
|
|
456
|
+
(function () { ɵsetClassMetadata(MagicViewContainerRef, [{
|
|
529
457
|
type: Directive,
|
|
530
458
|
args: [{
|
|
531
459
|
selector: '[magicViewContainerRef]',
|
|
@@ -555,36 +483,16 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
555
483
|
ɵɵadvance(2);
|
|
556
484
|
ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
|
557
485
|
} }
|
|
558
|
-
/**
|
|
559
|
-
* Creates a modal window for Magic modal window components
|
|
560
|
-
*/
|
|
561
486
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
562
|
-
/**
|
|
563
|
-
*
|
|
564
|
-
* @param injector
|
|
565
|
-
* @param componentFactoryResolver
|
|
566
|
-
*/
|
|
567
487
|
constructor(injector, componentFactoryResolver) {
|
|
568
488
|
super();
|
|
569
489
|
this.injector = injector;
|
|
570
490
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
571
|
-
/**
|
|
572
|
-
*
|
|
573
|
-
*/
|
|
574
491
|
this.ModalComp = null;
|
|
575
|
-
/**
|
|
576
|
-
*
|
|
577
|
-
*/
|
|
578
492
|
this.ModalCompParameters = {};
|
|
579
493
|
this.onClose = new EventEmitter();
|
|
580
|
-
/**
|
|
581
|
-
*
|
|
582
|
-
*/
|
|
583
494
|
this.componentRef = null;
|
|
584
495
|
}
|
|
585
|
-
/**
|
|
586
|
-
*
|
|
587
|
-
*/
|
|
588
496
|
ngOnInit() {
|
|
589
497
|
const factory = this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);
|
|
590
498
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(factory);
|
|
@@ -593,10 +501,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
593
501
|
setViewContainerRef(vcRef) {
|
|
594
502
|
this.modalbodyViewContainerRef = vcRef;
|
|
595
503
|
}
|
|
596
|
-
/**
|
|
597
|
-
* Returns the form name
|
|
598
|
-
* @returns
|
|
599
|
-
*/
|
|
600
504
|
getText() {
|
|
601
505
|
if (this.componentRef !== null) {
|
|
602
506
|
let comp = this.componentRef.instance;
|
|
@@ -605,10 +509,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
605
509
|
else
|
|
606
510
|
return "";
|
|
607
511
|
}
|
|
608
|
-
/**
|
|
609
|
-
* Returns CSS styles for the window
|
|
610
|
-
* @returns
|
|
611
|
-
*/
|
|
612
512
|
getStyle() {
|
|
613
513
|
let styles = {};
|
|
614
514
|
if (this.componentRef != undefined) {
|
|
@@ -625,10 +525,6 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
625
525
|
}
|
|
626
526
|
return styles;
|
|
627
527
|
}
|
|
628
|
-
/**
|
|
629
|
-
* Returns the CSS styles for the client area
|
|
630
|
-
* @returns
|
|
631
|
-
*/
|
|
632
528
|
getClientAreaStyles() {
|
|
633
529
|
let styles = {};
|
|
634
530
|
if (this.componentRef != undefined) {
|
|
@@ -644,33 +540,23 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
644
540
|
}
|
|
645
541
|
return styles;
|
|
646
542
|
}
|
|
647
|
-
/**
|
|
648
|
-
* Should the title bar be displayed
|
|
649
|
-
* @returns
|
|
650
|
-
*/
|
|
651
543
|
getShowTitleBar() {
|
|
652
544
|
if (this.componentRef != undefined) {
|
|
653
545
|
let comp = this.componentRef.instance;
|
|
654
546
|
return comp.ShowTitleBar();
|
|
655
547
|
}
|
|
656
548
|
}
|
|
657
|
-
/**
|
|
658
|
-
*
|
|
659
|
-
*/
|
|
660
549
|
OnClose() {
|
|
661
550
|
this.onClose.emit();
|
|
662
551
|
}
|
|
663
|
-
/**
|
|
664
|
-
* Handles click in the background window
|
|
665
|
-
*/
|
|
666
552
|
OnBackgroundClick() {
|
|
667
553
|
let comp = this.componentRef.instance;
|
|
668
554
|
if (comp.ShouldCloseOnBackgroundClick())
|
|
669
555
|
this.OnClose();
|
|
670
556
|
}
|
|
671
557
|
}
|
|
672
|
-
|
|
673
|
-
|
|
558
|
+
MagicOverlayContainer.ɵfac = function MagicOverlayContainer_Factory(t) { return new (t || MagicOverlayContainer)(ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver)); };
|
|
559
|
+
MagicOverlayContainer.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
|
674
560
|
ɵɵviewQuery(_c0, true);
|
|
675
561
|
ɵɵviewQuery(_c1, true);
|
|
676
562
|
} if (rf & 2) {
|
|
@@ -700,7 +586,7 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
700
586
|
ɵɵadvance(1);
|
|
701
587
|
ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
|
702
588
|
} }, directives: [NgIf, NgStyle, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{background-color:#fff}.modal-background[_ngcontent-%COMP%], .modal-foreground[_ngcontent-%COMP%]{bottom:0;left:0;position:fixed;right:0;top:0}.modal-background[_ngcontent-%COMP%]{background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"] });
|
|
703
|
-
|
|
589
|
+
(function () { ɵsetClassMetadata(MagicOverlayContainer, [{
|
|
704
590
|
type: Component,
|
|
705
591
|
args: [{
|
|
706
592
|
selector: 'app-magic-overlay-container',
|
|
@@ -737,44 +623,28 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
|
737
623
|
type: Output
|
|
738
624
|
}] }); })();
|
|
739
625
|
|
|
740
|
-
/**
|
|
741
|
-
* Service managing overlay windows
|
|
742
|
-
* This is Magic's default provider
|
|
743
|
-
*/
|
|
744
626
|
class OverlayContainerMagicProvider {
|
|
745
627
|
getComponent() {
|
|
746
628
|
return MagicOverlayContainer;
|
|
747
629
|
}
|
|
748
630
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
631
|
+
OverlayContainerMagicProvider.ɵfac = function OverlayContainerMagicProvider_Factory(t) { return new (t || OverlayContainerMagicProvider)(); };
|
|
632
|
+
OverlayContainerMagicProvider.ɵprov = ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
|
633
|
+
(function () { ɵsetClassMetadata(OverlayContainerMagicProvider, [{
|
|
752
634
|
type: Injectable
|
|
753
635
|
}], null, null); })();
|
|
754
636
|
|
|
755
|
-
/**
|
|
756
|
-
* This is a base class for the magic confirm components
|
|
757
|
-
*/
|
|
758
637
|
class BaseMagicConfirmComponent {
|
|
759
638
|
constructor() {
|
|
760
|
-
/**
|
|
761
|
-
* onClose Event - to be raised when the component is closed
|
|
762
|
-
* should pass true when OK is pressed and false when cancel is pressed
|
|
763
|
-
*/
|
|
764
639
|
this.onClose = new EventEmitter();
|
|
765
640
|
}
|
|
766
|
-
/**
|
|
767
|
-
* raises close Event
|
|
768
|
-
* @param result true when OK is pressed and false when cancel is pressed
|
|
769
|
-
*
|
|
770
|
-
*/
|
|
771
641
|
OnClose(result) {
|
|
772
642
|
this.onClose.emit(result);
|
|
773
643
|
}
|
|
774
644
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
645
|
+
BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
|
|
646
|
+
BaseMagicConfirmComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, styles: [""] });
|
|
647
|
+
(function () { ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
|
778
648
|
type: Component,
|
|
779
649
|
args: [{
|
|
780
650
|
selector: 'mg-base-alert',
|
|
@@ -789,27 +659,17 @@ class BaseMagicConfirmComponent {
|
|
|
789
659
|
type: Output
|
|
790
660
|
}] }); })();
|
|
791
661
|
|
|
792
|
-
/**
|
|
793
|
-
* This is a base class for the magic alert components
|
|
794
|
-
*/
|
|
795
662
|
class BaseMagicAlertComponent {
|
|
796
663
|
constructor() {
|
|
797
|
-
/**
|
|
798
|
-
* onClose Event - to be raised when the component is closed
|
|
799
|
-
|
|
800
|
-
*/
|
|
801
664
|
this.onClose = new EventEmitter();
|
|
802
665
|
}
|
|
803
|
-
/**
|
|
804
|
-
* close magic alert
|
|
805
|
-
*/
|
|
806
666
|
OnClose() {
|
|
807
667
|
this.onClose.emit();
|
|
808
668
|
}
|
|
809
669
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
670
|
+
BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
|
|
671
|
+
BaseMagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, styles: [""] });
|
|
672
|
+
(function () { ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
|
813
673
|
type: Component,
|
|
814
674
|
args: [{
|
|
815
675
|
selector: 'mg-base-alert',
|
|
@@ -824,9 +684,6 @@ class BaseMagicAlertComponent {
|
|
|
824
684
|
type: Output
|
|
825
685
|
}] }); })();
|
|
826
686
|
|
|
827
|
-
/**
|
|
828
|
-
* Directive for setting focus on element
|
|
829
|
-
*/
|
|
830
687
|
class MagicFocusDirective {
|
|
831
688
|
constructor(hostElement) {
|
|
832
689
|
this.hostElement = hostElement;
|
|
@@ -835,9 +692,9 @@ class MagicFocusDirective {
|
|
|
835
692
|
this.hostElement.nativeElement.focus();
|
|
836
693
|
}
|
|
837
694
|
}
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
695
|
+
MagicFocusDirective.ɵfac = function MagicFocusDirective_Factory(t) { return new (t || MagicFocusDirective)(ɵɵdirectiveInject(ElementRef)); };
|
|
696
|
+
MagicFocusDirective.ɵdir = ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
|
|
697
|
+
(function () { ɵsetClassMetadata(MagicFocusDirective, [{
|
|
841
698
|
type: Directive,
|
|
842
699
|
args: [{
|
|
843
700
|
selector: '[magicFocus]'
|
|
@@ -846,29 +703,16 @@ class MagicFocusDirective {
|
|
|
846
703
|
|
|
847
704
|
const _c0$1 = ["overlayContainerWrapper"];
|
|
848
705
|
class MagicOverlayContainerWrapper {
|
|
849
|
-
/**
|
|
850
|
-
*
|
|
851
|
-
* @param componentFactoryResolver
|
|
852
|
-
*/
|
|
853
706
|
constructor(componentListMagicService, loader, injector, componentFactoryResolver, changeDetectorRef) {
|
|
854
707
|
this.componentListMagicService = componentListMagicService;
|
|
855
708
|
this.loader = loader;
|
|
856
709
|
this.injector = injector;
|
|
857
710
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
858
711
|
this.changeDetectorRef = changeDetectorRef;
|
|
859
|
-
/**
|
|
860
|
-
*
|
|
861
|
-
*/
|
|
862
712
|
this.Component = null;
|
|
863
|
-
/**
|
|
864
|
-
*
|
|
865
|
-
*/
|
|
866
713
|
this.Parameters = {};
|
|
867
714
|
this.onClose = new EventEmitter();
|
|
868
715
|
}
|
|
869
|
-
/**
|
|
870
|
-
*
|
|
871
|
-
*/
|
|
872
716
|
ngOnInit() {
|
|
873
717
|
let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
|
874
718
|
if (moduleRef == null) {
|
|
@@ -918,17 +762,13 @@ class MagicOverlayContainerWrapper {
|
|
|
918
762
|
this.changeDetectorRef.detectChanges();
|
|
919
763
|
}
|
|
920
764
|
}
|
|
921
|
-
/**
|
|
922
|
-
* @ignore
|
|
923
|
-
* contais data of allowed base components to use
|
|
924
|
-
*/
|
|
925
765
|
MagicOverlayContainerWrapper.allowedBaseComps = new Map([
|
|
926
766
|
[OverlayType.Overlay, { comp: BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
|
|
927
767
|
[OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
|
928
768
|
[OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
|
929
769
|
]);
|
|
930
|
-
|
|
931
|
-
|
|
770
|
+
MagicOverlayContainerWrapper.ɵfac = function MagicOverlayContainerWrapper_Factory(t) { return new (t || MagicOverlayContainerWrapper)(ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(NgModuleFactoryLoader), ɵɵdirectiveInject(Injector), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ChangeDetectorRef)); };
|
|
771
|
+
MagicOverlayContainerWrapper.ɵcmp = ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
|
932
772
|
ɵɵstaticViewQuery(_c0$1, true);
|
|
933
773
|
} if (rf & 2) {
|
|
934
774
|
var _t;
|
|
@@ -942,7 +782,7 @@ MagicOverlayContainerWrapper.allowedBaseComps = new Map([
|
|
|
942
782
|
ɵɵelement(6, "div", 5);
|
|
943
783
|
ɵɵelementEnd();
|
|
944
784
|
} }, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }"] });
|
|
945
|
-
|
|
785
|
+
(function () { ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
|
|
946
786
|
type: Component,
|
|
947
787
|
args: [{
|
|
948
788
|
selector: 'app-magic-overlay-container-wrapper',
|
|
@@ -981,13 +821,10 @@ MagicOverlayContainerWrapper.allowedBaseComps = new Map([
|
|
|
981
821
|
args: ['overlayContainerWrapper', { static: true }]
|
|
982
822
|
}] }); })();
|
|
983
823
|
|
|
984
|
-
/***
|
|
985
|
-
* This is sample component for the alert message
|
|
986
|
-
*/
|
|
987
824
|
class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
988
825
|
}
|
|
989
|
-
|
|
990
|
-
|
|
826
|
+
MagicAlertComponent.ɵfac = function MagicAlertComponent_Factory(t) { return ɵMagicAlertComponent_BaseFactory(t || MagicAlertComponent); };
|
|
827
|
+
MagicAlertComponent.ɵcmp = ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
|
991
828
|
ɵɵelementStart(0, "div");
|
|
992
829
|
ɵɵelementStart(1, "div", 0);
|
|
993
830
|
ɵɵelementStart(2, "h2");
|
|
@@ -1008,8 +845,8 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
|
1008
845
|
ɵɵadvance(2);
|
|
1009
846
|
ɵɵtextInterpolate1("", ctx.message, " ");
|
|
1010
847
|
} }, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }"] });
|
|
1011
|
-
const ɵMagicAlertComponent_BaseFactory =
|
|
1012
|
-
|
|
848
|
+
const ɵMagicAlertComponent_BaseFactory = ɵɵgetInheritedFactory(MagicAlertComponent);
|
|
849
|
+
(function () { ɵsetClassMetadata(MagicAlertComponent, [{
|
|
1013
850
|
type: Component,
|
|
1014
851
|
args: [{
|
|
1015
852
|
selector: 'sample-magic-alert-component',
|
|
@@ -1053,13 +890,10 @@ const ɵMagicAlertComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFactory(
|
|
|
1053
890
|
}]
|
|
1054
891
|
}], null, null); })();
|
|
1055
892
|
|
|
1056
|
-
/***
|
|
1057
|
-
* This is sample component for the confirmation box
|
|
1058
|
-
*/
|
|
1059
893
|
class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
1060
894
|
}
|
|
1061
|
-
|
|
1062
|
-
|
|
895
|
+
MagicConfirmationBoxComponent.ɵfac = function MagicConfirmationBoxComponent_Factory(t) { return ɵMagicConfirmationBoxComponent_BaseFactory(t || MagicConfirmationBoxComponent); };
|
|
896
|
+
MagicConfirmationBoxComponent.ɵcmp = ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [ɵɵ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) {
|
|
1063
897
|
ɵɵelementStart(0, "div");
|
|
1064
898
|
ɵɵelementStart(1, "div", 0);
|
|
1065
899
|
ɵɵelementStart(2, "h2");
|
|
@@ -1084,8 +918,8 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
|
1084
918
|
ɵɵadvance(1);
|
|
1085
919
|
ɵɵtextInterpolate1(" ", ctx.message, " ");
|
|
1086
920
|
} }, styles: [".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel[_ngcontent-%COMP%] {\n background-color: #C1C1C1;\n }"] });
|
|
1087
|
-
const ɵMagicConfirmationBoxComponent_BaseFactory =
|
|
1088
|
-
|
|
921
|
+
const ɵMagicConfirmationBoxComponent_BaseFactory = ɵɵgetInheritedFactory(MagicConfirmationBoxComponent);
|
|
922
|
+
(function () { ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
|
|
1089
923
|
type: Component,
|
|
1090
924
|
args: [{
|
|
1091
925
|
selector: 'sample-magic-confirmation-box',
|
|
@@ -1136,52 +970,25 @@ const ɵMagicConfirmationBoxComponent_BaseFactory = /*@__PURE__*/ ɵɵgetInherit
|
|
|
1136
970
|
}]
|
|
1137
971
|
}], null, null); })();
|
|
1138
972
|
|
|
1139
|
-
/**
|
|
1140
|
-
* Service managing overlay windows
|
|
1141
|
-
* This is Magic's default provider
|
|
1142
|
-
*/
|
|
1143
|
-
/**
|
|
1144
|
-
* Service managing alert and confirmation windows
|
|
1145
|
-
* This is Magic's default provider
|
|
1146
|
-
*/
|
|
1147
973
|
class ConfirmationComponentsMagicProvider {
|
|
1148
|
-
/**
|
|
1149
|
-
* Return true when use default javascript alert and confirmation or return false to provide custom components
|
|
1150
|
-
* @returns true is we want to use default javascript alert and confirmation
|
|
1151
|
-
*/
|
|
1152
974
|
showDefaultConfirmations() {
|
|
1153
975
|
return true;
|
|
1154
976
|
}
|
|
1155
|
-
/**
|
|
1156
|
-
* Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
|
|
1157
|
-
* @returns component that will replace javascript Alert
|
|
1158
|
-
*/
|
|
1159
977
|
getAlertComponent() {
|
|
1160
978
|
return MagicAlertComponent;
|
|
1161
979
|
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
|
|
1164
|
-
* @returns component that will replace javascript confirmation box
|
|
1165
|
-
*/
|
|
1166
980
|
getConfirmtionComponent() {
|
|
1167
981
|
return MagicConfirmationBoxComponent;
|
|
1168
982
|
}
|
|
1169
983
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
984
|
+
ConfirmationComponentsMagicProvider.ɵfac = function ConfirmationComponentsMagicProvider_Factory(t) { return new (t || ConfirmationComponentsMagicProvider)(); };
|
|
985
|
+
ConfirmationComponentsMagicProvider.ɵprov = ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
|
986
|
+
(function () { ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
|
|
1173
987
|
type: Injectable
|
|
1174
988
|
}], null, null); })();
|
|
1175
989
|
|
|
1176
|
-
/**
|
|
1177
|
-
* Displays a message-box
|
|
1178
|
-
*/
|
|
1179
990
|
class confirmationBox {
|
|
1180
|
-
/**
|
|
1181
|
-
* @ignore
|
|
1182
|
-
*/
|
|
1183
991
|
static isConfirmBox(style) {
|
|
1184
|
-
// button format mask is in first nibble from right
|
|
1185
992
|
let buttonMode = style & 0x0F;
|
|
1186
993
|
var isConfirm = (buttonMode === Styles.MSGBOX_BUTTON_OK_CANCEL) ||
|
|
1187
994
|
(buttonMode === Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
|
|
@@ -1190,14 +997,7 @@ class confirmationBox {
|
|
|
1190
997
|
(buttonMode === Styles.MSGBOX_BUTTON_RETRY_CANCEL);
|
|
1191
998
|
return (isConfirm);
|
|
1192
999
|
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Converts the result from the HTML window to the expected result type
|
|
1195
|
-
* @param style Result received from HTML window
|
|
1196
|
-
* @param okWasPressed Was the "OK" pressed
|
|
1197
|
-
* @returns MessageBox result type
|
|
1198
|
-
*/
|
|
1199
1000
|
static convertToExcpectedResultBox(style, okWasPressed) {
|
|
1200
|
-
// button format mask is in first nibble from right
|
|
1201
1001
|
let buttonMode = style & 0x0F;
|
|
1202
1002
|
let retValue = Styles.MSGBOX_RESULT_OK;
|
|
1203
1003
|
if (buttonMode === Styles.MSGBOX_BUTTON_OK)
|
|
@@ -1214,19 +1014,10 @@ class confirmationBox {
|
|
|
1214
1014
|
retValue = okWasPressed ? Styles.MSGBOX_RESULT_RETRY : Styles.MSGBOX_RESULT_CANCEL;
|
|
1215
1015
|
return retValue;
|
|
1216
1016
|
}
|
|
1217
|
-
/**
|
|
1218
|
-
* Show a message box as an HTML window
|
|
1219
|
-
* @param title Title of the message box
|
|
1220
|
-
* @param message Message that will be display in the message box
|
|
1221
|
-
* @param style Style that include buttons \ Icons
|
|
1222
|
-
* @returns MessageBox result
|
|
1223
|
-
*/
|
|
1224
1017
|
static showConfirmationBox(title, message, style) {
|
|
1225
1018
|
let okWasPressed = false;
|
|
1226
1019
|
let retValue = Styles.MSGBOX_RESULT_OK;
|
|
1227
|
-
// check if it is confirmation box
|
|
1228
1020
|
let isConfirm = this.isConfirmBox(style);
|
|
1229
|
-
// the title will be added to the string and we will add new line after the title
|
|
1230
1021
|
let titleAndString = title + '\n' + '\n' + message;
|
|
1231
1022
|
if (isConfirm)
|
|
1232
1023
|
okWasPressed = confirm(titleAndString);
|
|
@@ -1234,14 +1025,10 @@ class confirmationBox {
|
|
|
1234
1025
|
alert(titleAndString);
|
|
1235
1026
|
okWasPressed = true;
|
|
1236
1027
|
}
|
|
1237
|
-
// return the result from the user
|
|
1238
1028
|
return okWasPressed;
|
|
1239
1029
|
}
|
|
1240
1030
|
}
|
|
1241
1031
|
|
|
1242
|
-
/**
|
|
1243
|
-
* Service managing overlay windows
|
|
1244
|
-
*/
|
|
1245
1032
|
class OverlayWindowService {
|
|
1246
1033
|
constructor(componentFactoryResolver, componentList, engineMagicService, overlayContainerMagicProvider, confirmationComponentsMagicProvider) {
|
|
1247
1034
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
@@ -1256,7 +1043,6 @@ class OverlayWindowService {
|
|
|
1256
1043
|
this.overlayWindowFocusManager = new OverlayWindowFocusManager(rootMagicElement);
|
|
1257
1044
|
}
|
|
1258
1045
|
open(formName, taskId, taskDescription) {
|
|
1259
|
-
// for overlay which are lazy loaded don't find data in component-list
|
|
1260
1046
|
let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
|
|
1261
1047
|
let parameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
|
1262
1048
|
let componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), OverlayType.Overlay);
|
|
@@ -1267,27 +1053,18 @@ class OverlayWindowService {
|
|
|
1267
1053
|
});
|
|
1268
1054
|
}
|
|
1269
1055
|
close(commandStr) {
|
|
1270
|
-
// Close the overlay by removing the overlay window from its container
|
|
1271
1056
|
this.overlayWindowsContainerViewRef.remove();
|
|
1272
1057
|
this.overlayWindowFocusManager.popDialog();
|
|
1273
1058
|
let guiEvent1 = getGuiEventObj("dispose", null, 0);
|
|
1274
1059
|
guiEvent1.TaskID = commandStr;
|
|
1275
1060
|
this.engineMagicService.insertEvent(guiEvent1);
|
|
1276
1061
|
}
|
|
1277
|
-
/**
|
|
1278
|
-
* Open Confirmation box
|
|
1279
|
-
* @param title title of the box
|
|
1280
|
-
* @param msg message
|
|
1281
|
-
* @param style Magic style
|
|
1282
|
-
*/
|
|
1283
1062
|
openConfirmationBox(title, msg, style) {
|
|
1284
|
-
//show default confirmations
|
|
1285
1063
|
if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
|
|
1286
1064
|
let res = confirmationBox.showConfirmationBox(title, msg, style);
|
|
1287
1065
|
this.finishConfirmation(style, res);
|
|
1288
1066
|
}
|
|
1289
1067
|
else {
|
|
1290
|
-
//show custom confirmations
|
|
1291
1068
|
let comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
|
|
1292
1069
|
let overlayType = confirmationBox.isConfirmBox(style) ? OverlayType.ConfirmationBox : OverlayType.Alert;
|
|
1293
1070
|
let componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
|
|
@@ -1298,21 +1075,11 @@ class OverlayWindowService {
|
|
|
1298
1075
|
});
|
|
1299
1076
|
}
|
|
1300
1077
|
}
|
|
1301
|
-
/**
|
|
1302
|
-
* This method is called on close of the confirmation
|
|
1303
|
-
* @param style Magic style
|
|
1304
|
-
* @param result
|
|
1305
|
-
*/
|
|
1306
1078
|
finishConfirmation(style, result) {
|
|
1307
1079
|
let guiEvent = getGuiEventObj("confirmationClosed", null, 0);
|
|
1308
1080
|
guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
|
|
1309
1081
|
this.engineMagicService.insertEvent(guiEvent);
|
|
1310
1082
|
}
|
|
1311
|
-
/**
|
|
1312
|
-
* creates a modal component. Can be used for overlay, message box or confirmation box
|
|
1313
|
-
* @param parameters component's parameters
|
|
1314
|
-
* @param component components to create
|
|
1315
|
-
*/
|
|
1316
1083
|
createModalComponent(parameters, component, overlayType) {
|
|
1317
1084
|
let componentRef;
|
|
1318
1085
|
let magicModalContainerParameters = {
|
|
@@ -1320,20 +1087,18 @@ class OverlayWindowService {
|
|
|
1320
1087
|
Parameters: parameters,
|
|
1321
1088
|
OverlayTypeParam: overlayType
|
|
1322
1089
|
};
|
|
1323
|
-
// Create the UI component of modal window
|
|
1324
1090
|
const factory = this.componentFactoryResolver.resolveComponentFactory(MagicOverlayContainerWrapper);
|
|
1325
1091
|
let viewCRef = this.overlayWindowsContainerViewRef;
|
|
1326
1092
|
componentRef = viewCRef.createComponent(factory);
|
|
1327
|
-
// Set the data to newly created component
|
|
1328
1093
|
Object.assign(componentRef.instance, magicModalContainerParameters);
|
|
1329
1094
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
|
1330
1095
|
componentRef.instance.DetectChanges();
|
|
1331
1096
|
return componentRef;
|
|
1332
1097
|
}
|
|
1333
1098
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1099
|
+
OverlayWindowService.ɵfac = function OverlayWindowService_Factory(t) { return new (t || OverlayWindowService)(ɵɵinject(ComponentFactoryResolver), ɵɵinject(ComponentListMagicService), ɵɵinject(EngineMagicService), ɵɵinject(OverlayContainerMagicProvider), ɵɵinject(ConfirmationComponentsMagicProvider)); };
|
|
1100
|
+
OverlayWindowService.ɵprov = ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac });
|
|
1101
|
+
(function () { ɵsetClassMetadata(OverlayWindowService, [{
|
|
1337
1102
|
type: Injectable
|
|
1338
1103
|
}], function () { return [{ type: ComponentFactoryResolver }, { type: ComponentListMagicService }, { type: EngineMagicService }, { type: OverlayContainerMagicProvider }, { type: ConfirmationComponentsMagicProvider }]; }, null); })();
|
|
1339
1104
|
class OverlayWindowFocusManager {
|
|
@@ -1454,95 +1219,37 @@ class DialogInfo {
|
|
|
1454
1219
|
}
|
|
1455
1220
|
}
|
|
1456
1221
|
|
|
1457
|
-
/**
|
|
1458
|
-
* Main service to connect the UI with the Magic WebCLient
|
|
1459
|
-
*/
|
|
1460
1222
|
class TaskMagicService {
|
|
1461
|
-
/**
|
|
1462
|
-
*
|
|
1463
|
-
* @param magic
|
|
1464
|
-
*/
|
|
1465
1223
|
constructor(magic, overlayWindowService) {
|
|
1466
1224
|
this.magic = magic;
|
|
1467
1225
|
this.overlayWindowService = overlayWindowService;
|
|
1468
|
-
/**
|
|
1469
|
-
* Collection of data for all controls
|
|
1470
|
-
*/
|
|
1471
1226
|
this.Records = new Records();
|
|
1472
|
-
/**
|
|
1473
|
-
* FormGroup collection for line mode
|
|
1474
|
-
*/
|
|
1475
1227
|
this.formGroups = [];
|
|
1476
|
-
/**
|
|
1477
|
-
* @ignore
|
|
1478
|
-
*/
|
|
1479
1228
|
this.refreshDom = new Subject();
|
|
1480
|
-
/**
|
|
1481
|
-
* @ignore
|
|
1482
|
-
*/
|
|
1483
1229
|
this.detectChanges = new Subject();
|
|
1484
|
-
/**
|
|
1485
|
-
* @ignore
|
|
1486
|
-
*/
|
|
1487
1230
|
this.interactiveCommands = new Subject();
|
|
1488
|
-
/**
|
|
1489
|
-
* @ignore
|
|
1490
|
-
* This event is emitted when the selected row in a table changes.
|
|
1491
|
-
*/
|
|
1492
1231
|
this.OnSelectedRowChanged = new EventEmitter();
|
|
1493
|
-
/**
|
|
1494
|
-
* @ignore
|
|
1495
|
-
*/
|
|
1496
1232
|
this.customPropertiesSubject = new Subject();
|
|
1497
|
-
/**
|
|
1498
|
-
* @ignore
|
|
1499
|
-
*/
|
|
1500
1233
|
this.recordsCountChangeSubject = new Subject();
|
|
1501
|
-
/**
|
|
1502
|
-
* @ignore
|
|
1503
|
-
*/
|
|
1504
1234
|
this.oldPageSize = 0;
|
|
1505
1235
|
this.Records.setGuiTopIndex(0);
|
|
1506
1236
|
this.mgInputDateFormat = null;
|
|
1507
1237
|
}
|
|
1508
|
-
/**
|
|
1509
|
-
* returns true if used is logged in
|
|
1510
|
-
* @returns
|
|
1511
|
-
*/
|
|
1512
1238
|
getIsLoggenIn() {
|
|
1513
1239
|
return this.magic.getIsLoggedIn();
|
|
1514
1240
|
}
|
|
1515
|
-
/**
|
|
1516
|
-
* returns the task Id
|
|
1517
|
-
* @returns
|
|
1518
|
-
*/
|
|
1519
1241
|
get taskId() {
|
|
1520
1242
|
return this._taskId;
|
|
1521
1243
|
}
|
|
1522
|
-
/**
|
|
1523
|
-
* Sets the task Id
|
|
1524
|
-
* @param value the task id to set
|
|
1525
|
-
*/
|
|
1526
1244
|
set taskId(value) {
|
|
1527
|
-
// debugger;
|
|
1528
1245
|
this._taskId = value;
|
|
1529
1246
|
}
|
|
1530
|
-
/**
|
|
1531
|
-
* Returns the task's data in Screen mode
|
|
1532
|
-
* @returns
|
|
1533
|
-
*/
|
|
1534
1247
|
get ScreenControlsData() {
|
|
1535
1248
|
return this.Records.list['0'];
|
|
1536
1249
|
}
|
|
1537
|
-
/**
|
|
1538
|
-
* @ignore
|
|
1539
|
-
*/
|
|
1540
1250
|
settemplate(value) {
|
|
1541
1251
|
this.template = value;
|
|
1542
1252
|
}
|
|
1543
|
-
/**
|
|
1544
|
-
* Builds the FormControl for each and every control
|
|
1545
|
-
*/
|
|
1546
1253
|
buildScreenModeControls() {
|
|
1547
1254
|
const group = new FormGroup({});
|
|
1548
1255
|
for (const key in this.template) {
|
|
@@ -1554,21 +1261,10 @@ class TaskMagicService {
|
|
|
1554
1261
|
}
|
|
1555
1262
|
this.ScreenModeControls = group;
|
|
1556
1263
|
}
|
|
1557
|
-
/**
|
|
1558
|
-
* Is the control a table control
|
|
1559
|
-
* @param id Id of the control
|
|
1560
|
-
* @returns
|
|
1561
|
-
*/
|
|
1562
1264
|
isTableControl(id) {
|
|
1563
1265
|
return this.template[id] == '1';
|
|
1564
1266
|
}
|
|
1565
1267
|
getMgInputDateFormat() { return this.mgInputDateFormat; }
|
|
1566
|
-
/**
|
|
1567
|
-
* Returns the FormControl of a control
|
|
1568
|
-
* @param guiRowid Id of the requested row
|
|
1569
|
-
* @param id Id of the control
|
|
1570
|
-
* @returns
|
|
1571
|
-
*/
|
|
1572
1268
|
getFormControl(guiRowid, id) {
|
|
1573
1269
|
let c;
|
|
1574
1270
|
let group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
|
|
@@ -1578,21 +1274,12 @@ class TaskMagicService {
|
|
|
1578
1274
|
}
|
|
1579
1275
|
return c;
|
|
1580
1276
|
}
|
|
1581
|
-
/**
|
|
1582
|
-
* handle the change of text for input control inside table
|
|
1583
|
-
* @param guiRowId Id of the row for which the FormControls are built
|
|
1584
|
-
* set the new value of the formcontrol
|
|
1585
|
-
*/
|
|
1586
1277
|
setInputTextValue(controlId, guiRowid, val) {
|
|
1587
1278
|
this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
|
|
1588
1279
|
const fc = this.getFormControl(guiRowid, controlId);
|
|
1589
1280
|
if (!isNullOrUndefined(val))
|
|
1590
1281
|
fc.setValue(val);
|
|
1591
1282
|
}
|
|
1592
|
-
/**
|
|
1593
|
-
* Build the FormControls for a table row
|
|
1594
|
-
* @param guiRowId Id of the row for which the FormControls are built
|
|
1595
|
-
*/
|
|
1596
1283
|
buildTableRowControls(guiRowId) {
|
|
1597
1284
|
const group = new FormGroup({});
|
|
1598
1285
|
for (const key in this.template) {
|
|
@@ -1604,58 +1291,30 @@ class TaskMagicService {
|
|
|
1604
1291
|
}
|
|
1605
1292
|
this.formGroups[guiRowId] = group;
|
|
1606
1293
|
}
|
|
1607
|
-
/**
|
|
1608
|
-
*
|
|
1609
|
-
* @ignore
|
|
1610
|
-
*/
|
|
1611
1294
|
updateRecordsBeforeCurrentView(value) {
|
|
1612
1295
|
this.Records.recordsBeforeCurrentView = value;
|
|
1613
1296
|
}
|
|
1614
|
-
/**
|
|
1615
|
-
* @ignore
|
|
1616
|
-
*/
|
|
1617
1297
|
setIncludesFirst(value) {
|
|
1618
1298
|
this.Records.includesFirst = value;
|
|
1619
1299
|
}
|
|
1620
|
-
/**
|
|
1621
|
-
* @ignore
|
|
1622
|
-
*/
|
|
1623
1300
|
setIncludesLast(value) {
|
|
1624
1301
|
this.Records.includesLast = value;
|
|
1625
1302
|
}
|
|
1626
|
-
/**
|
|
1627
|
-
* @ignore
|
|
1628
|
-
*/
|
|
1629
1303
|
markRowAsCreated(guiRowId) {
|
|
1630
1304
|
this.Records.markRowAsCreated(guiRowId);
|
|
1631
1305
|
}
|
|
1632
|
-
/**
|
|
1633
|
-
* @ignore
|
|
1634
|
-
*/
|
|
1635
1306
|
markRowAsNotCreated(guiRowId) {
|
|
1636
1307
|
this.Records.markRowAsNotCreated(guiRowId);
|
|
1637
1308
|
}
|
|
1638
|
-
/**
|
|
1639
|
-
* @ignore
|
|
1640
|
-
*/
|
|
1641
1309
|
startRowEditing(guiRowId) {
|
|
1642
1310
|
this.Records.startRowEditing(guiRowId);
|
|
1643
1311
|
}
|
|
1644
|
-
/**
|
|
1645
|
-
* @ignore
|
|
1646
|
-
*/
|
|
1647
1312
|
stopRowEditing(guiRowId) {
|
|
1648
1313
|
this.Records.stopRowEditing(guiRowId);
|
|
1649
1314
|
}
|
|
1650
|
-
/**
|
|
1651
|
-
* @ignore
|
|
1652
|
-
*/
|
|
1653
1315
|
isRowInRowEditing(guiRowId) {
|
|
1654
1316
|
return this.Records.isRowInRowEditing(guiRowId);
|
|
1655
1317
|
}
|
|
1656
|
-
/**
|
|
1657
|
-
* @ignore
|
|
1658
|
-
*/
|
|
1659
1318
|
setIsEmptyDataView(isEmpty) {
|
|
1660
1319
|
if (this.Records.isEmptyDataView !== isEmpty) {
|
|
1661
1320
|
if (isEmpty)
|
|
@@ -1665,11 +1324,6 @@ class TaskMagicService {
|
|
|
1665
1324
|
this.refreshView();
|
|
1666
1325
|
}
|
|
1667
1326
|
}
|
|
1668
|
-
/**
|
|
1669
|
-
* Initialize the service to work with the task
|
|
1670
|
-
* @param taskId Id of the task
|
|
1671
|
-
* @param taskDescription
|
|
1672
|
-
*/
|
|
1673
1327
|
initTask(taskId, taskDescription) {
|
|
1674
1328
|
this.Records.createFirst();
|
|
1675
1329
|
this.oldPageSize = 0;
|
|
@@ -1681,71 +1335,39 @@ class TaskMagicService {
|
|
|
1681
1335
|
this.settemplate(taskDescription);
|
|
1682
1336
|
}
|
|
1683
1337
|
this.buildScreenModeControls();
|
|
1684
|
-
// remove previous subscriptions
|
|
1685
1338
|
if (!isNullOrUndefined(this.subscribeRefreshDom))
|
|
1686
1339
|
this.subscribeRefreshDom.unsubscribe();
|
|
1687
1340
|
if (!isNullOrUndefined(this.subscribeInteractiveCommands))
|
|
1688
1341
|
this.subscribeInteractiveCommands.unsubscribe();
|
|
1689
1342
|
this.subscribeRefreshDom = this.magic.refreshDom.pipe(filter(command => command.TaskTag === this.taskId))
|
|
1690
1343
|
.subscribe(command => {
|
|
1691
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
1692
1344
|
this.executeCommand(command);
|
|
1693
1345
|
});
|
|
1694
1346
|
this.subscribeInteractiveCommands = this.magic.interactiveCommands
|
|
1695
1347
|
.pipe(filter(command => command.TaskTag === this.taskId))
|
|
1696
1348
|
.subscribe(command => {
|
|
1697
|
-
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
|
1698
1349
|
this.executeInteractiveCommand(command);
|
|
1699
1350
|
});
|
|
1700
1351
|
}
|
|
1701
|
-
/**
|
|
1702
|
-
* @ignore
|
|
1703
|
-
*/
|
|
1704
1352
|
refreshView() {
|
|
1705
1353
|
this.detectChanges.next('');
|
|
1706
1354
|
}
|
|
1707
|
-
/**
|
|
1708
|
-
* Insert an event to the Magic WebClient event queue
|
|
1709
|
-
* @param guiEvent The event to insert
|
|
1710
|
-
*/
|
|
1711
1355
|
insertEvent(guiEvent) {
|
|
1712
1356
|
guiEvent.TaskID = this.taskId;
|
|
1713
1357
|
this.magic.insertEvent(guiEvent);
|
|
1714
1358
|
}
|
|
1715
|
-
/**
|
|
1716
|
-
* @ignore
|
|
1717
|
-
*/
|
|
1718
1359
|
GetControlPictureMask(controlName) {
|
|
1719
1360
|
return this.magic.GetControlPictureMask(this.taskId, controlName);
|
|
1720
1361
|
}
|
|
1721
|
-
/**
|
|
1722
|
-
* Validates the control value, using the Magic WebClient
|
|
1723
|
-
* @param controlName Id of validated control
|
|
1724
|
-
* @param value value to be validated
|
|
1725
|
-
* @returns If validation fails, returns error message, else returns null
|
|
1726
|
-
*/
|
|
1727
1362
|
ValidateControlValue(controlName, value) {
|
|
1728
1363
|
return this.magic.ValidateControlValue(this.taskId, controlName, value);
|
|
1729
1364
|
}
|
|
1730
|
-
/**
|
|
1731
|
-
* @ignore
|
|
1732
|
-
*/
|
|
1733
1365
|
GetRangedValue(controlName, value) {
|
|
1734
1366
|
return this.magic.GetRangedValue(this.taskId, controlName, value);
|
|
1735
1367
|
}
|
|
1736
|
-
/**
|
|
1737
|
-
* @ignore
|
|
1738
|
-
*/
|
|
1739
1368
|
GetFldRanges(controlName) {
|
|
1740
1369
|
return this.magic.GetFldRanges(this.taskId, controlName);
|
|
1741
1370
|
}
|
|
1742
|
-
/**
|
|
1743
|
-
* returns the value of a property of the control
|
|
1744
|
-
* @param controlId Id of control
|
|
1745
|
-
* @param prop Property
|
|
1746
|
-
* @param guiRowId Row Id, if applicable
|
|
1747
|
-
* @returns Property value
|
|
1748
|
-
*/
|
|
1749
1371
|
getProperty(controlId, prop, guiRowId) {
|
|
1750
1372
|
if (isNullOrUndefined(guiRowId))
|
|
1751
1373
|
guiRowId = '0';
|
|
@@ -1759,9 +1381,6 @@ class TaskMagicService {
|
|
|
1759
1381
|
return this.Records.list[guiRowId].getProperty(controlId, prop);
|
|
1760
1382
|
}
|
|
1761
1383
|
}
|
|
1762
|
-
/**
|
|
1763
|
-
* @ignore
|
|
1764
|
-
*/
|
|
1765
1384
|
getPropertyStub(ControlsProperties, controlId, prop) {
|
|
1766
1385
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
1767
1386
|
if (controlId in ControlsProperties) {
|
|
@@ -1771,31 +1390,15 @@ class TaskMagicService {
|
|
|
1771
1390
|
}
|
|
1772
1391
|
return '';
|
|
1773
1392
|
}
|
|
1774
|
-
/**
|
|
1775
|
-
* @ignore
|
|
1776
|
-
*/
|
|
1777
1393
|
getStyleStub(ControlsProperties, controlId, styleName) {
|
|
1778
1394
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
|
1779
1395
|
return ControlsProperties[controlId].stylesMap.get(styleName);
|
|
1780
1396
|
}
|
|
1781
|
-
/**
|
|
1782
|
-
* Return the CSS classes used for this control
|
|
1783
|
-
* @param controlId Id of control
|
|
1784
|
-
* @param guiRowId Row Id, if applicable
|
|
1785
|
-
* @returns String containing the classes currently defined for this control
|
|
1786
|
-
*/
|
|
1787
1397
|
getClasses(controlId, guiRowId) {
|
|
1788
1398
|
if (isNullOrUndefined(guiRowId))
|
|
1789
1399
|
guiRowId = '0';
|
|
1790
1400
|
return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
|
|
1791
1401
|
}
|
|
1792
|
-
/**
|
|
1793
|
-
* Return the value of a style used for a control
|
|
1794
|
-
* @param controlId Id of control
|
|
1795
|
-
* @param styleName Name of style
|
|
1796
|
-
* @param guiRowId Row Id, if applicable
|
|
1797
|
-
* @returns value of style of the control
|
|
1798
|
-
*/
|
|
1799
1402
|
getStyle(controlId, styleName, guiRowId) {
|
|
1800
1403
|
if (isNullOrUndefined(guiRowId))
|
|
1801
1404
|
guiRowId = '0';
|
|
@@ -1806,36 +1409,21 @@ class TaskMagicService {
|
|
|
1806
1409
|
return StylesMapManager.magicValueGetStyle(styleName, magicValue);
|
|
1807
1410
|
}
|
|
1808
1411
|
}
|
|
1809
|
-
/**
|
|
1810
|
-
* Return the value of a control
|
|
1811
|
-
* @param controlId Id of control
|
|
1812
|
-
* @param guiRowId Row Id, if applicable
|
|
1813
|
-
* @returns value of the control
|
|
1814
|
-
*/
|
|
1815
1412
|
getValue(controlId, guiRowId) {
|
|
1816
1413
|
if (isNullOrUndefined(guiRowId))
|
|
1817
1414
|
guiRowId = '0';
|
|
1818
1415
|
return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
|
|
1819
1416
|
}
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
* @param guiRowId Row Id, if applicable
|
|
1824
|
-
* @param value Value to set
|
|
1825
|
-
*/
|
|
1417
|
+
getFormattedValue(controlName, val) {
|
|
1418
|
+
return this.magic.GetFormattedValue(this.taskId, controlName, val);
|
|
1419
|
+
}
|
|
1826
1420
|
setValue(controlId, guiRowId, value) {
|
|
1827
1421
|
return this.Records.list[guiRowId].setValue(controlId, value);
|
|
1828
1422
|
}
|
|
1829
|
-
/**
|
|
1830
|
-
* @ignore
|
|
1831
|
-
*/
|
|
1832
1423
|
executeInteractiveCommand(guiInteractiveCommand) {
|
|
1833
1424
|
GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
|
|
1834
1425
|
this.interactiveCommands.next(guiInteractiveCommand);
|
|
1835
1426
|
}
|
|
1836
|
-
/**
|
|
1837
|
-
* @ignore
|
|
1838
|
-
*/
|
|
1839
1427
|
handleSetProperty(command, isTableChild) {
|
|
1840
1428
|
let controlId = command.CtrlName;
|
|
1841
1429
|
let dvRowId = (command.line || 0);
|
|
@@ -1872,7 +1460,6 @@ class TaskMagicService {
|
|
|
1872
1460
|
let controlId = command.CtrlName;
|
|
1873
1461
|
let properties;
|
|
1874
1462
|
let isTableChild = this.isTableControl(controlId);
|
|
1875
|
-
// For non-input type controls on table.
|
|
1876
1463
|
if (command.obj !== null)
|
|
1877
1464
|
isTableChild = isTableChild || command.obj.IsTableChild;
|
|
1878
1465
|
guiRowId = this.getGuiRowId(dvRowId, isTableChild);
|
|
@@ -1923,13 +1510,13 @@ class TaskMagicService {
|
|
|
1923
1510
|
break;
|
|
1924
1511
|
case CommandType.SET_PROPERTY:
|
|
1925
1512
|
this.handleSetProperty(command, isTableChild);
|
|
1513
|
+
if (command.Operation == HtmlProperties.ReadOnly)
|
|
1514
|
+
this.refreshDom.next(command);
|
|
1926
1515
|
break;
|
|
1927
1516
|
case CommandType.PROP_SET_USER_PROPERTY:
|
|
1928
1517
|
properties = this.Records.list[guiRowId].getControlMetadata(controlId);
|
|
1929
|
-
// if the property has changed, set the property and raise the subject
|
|
1930
1518
|
if (properties.userProperties.get(command.Operation) !== command.obj1) {
|
|
1931
1519
|
properties.userProperties.set(command.Operation, command.obj1);
|
|
1932
|
-
// the property name is of format <controlName>~<propertyName>
|
|
1933
1520
|
this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
|
|
1934
1521
|
}
|
|
1935
1522
|
break;
|
|
@@ -1974,12 +1561,11 @@ class TaskMagicService {
|
|
|
1974
1561
|
case CommandType.SET_EMPTY_DATAVIEW:
|
|
1975
1562
|
this.setIsEmptyDataView(command.Bool1);
|
|
1976
1563
|
break;
|
|
1564
|
+
case CommandType.SET_FOCUS:
|
|
1565
|
+
this.refreshDom.next(command);
|
|
1566
|
+
break;
|
|
1977
1567
|
}
|
|
1978
|
-
this.refreshDom.next(command);
|
|
1979
1568
|
}
|
|
1980
|
-
/**
|
|
1981
|
-
custom validator
|
|
1982
|
-
*/
|
|
1983
1569
|
customValidator(rowid, id) {
|
|
1984
1570
|
return (control) => {
|
|
1985
1571
|
let controlMetadata;
|
|
@@ -1993,13 +1579,6 @@ class TaskMagicService {
|
|
|
1993
1579
|
return null;
|
|
1994
1580
|
};
|
|
1995
1581
|
}
|
|
1996
|
-
/**
|
|
1997
|
-
* COnvert a value from Magic format to native format
|
|
1998
|
-
* @param controlId Id of control
|
|
1999
|
-
* @param rowId Row Id, if applicable
|
|
2000
|
-
* @param val Value to convert
|
|
2001
|
-
* @returns Converted value
|
|
2002
|
-
*/
|
|
2003
1582
|
ConvertValToNative(controlId, rowId, val) {
|
|
2004
1583
|
let properties;
|
|
2005
1584
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2048,13 +1627,6 @@ class TaskMagicService {
|
|
|
2048
1627
|
return val;
|
|
2049
1628
|
}
|
|
2050
1629
|
}
|
|
2051
|
-
/**
|
|
2052
|
-
* Convert a value from native to Magic format
|
|
2053
|
-
* @param controlId Id of control
|
|
2054
|
-
* @param rowId Row Id, if applicable
|
|
2055
|
-
* @param val Value to convert
|
|
2056
|
-
* @returns Converted value
|
|
2057
|
-
*/
|
|
2058
1630
|
ConvertValFromNative(controlId, rowId, val) {
|
|
2059
1631
|
let properties;
|
|
2060
1632
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2097,22 +1669,12 @@ class TaskMagicService {
|
|
|
2097
1669
|
return val;
|
|
2098
1670
|
}
|
|
2099
1671
|
}
|
|
2100
|
-
/**
|
|
2101
|
-
* Handle resize and also fetch chunk of records if having an empty view.
|
|
2102
|
-
* @ignore
|
|
2103
|
-
* @param pageSize : PageSize
|
|
2104
|
-
* @param topGuiRowId : GuiRowId of first record in view.
|
|
2105
|
-
*/
|
|
2106
1672
|
resize(pageSize, topGuiRowId) {
|
|
2107
1673
|
let guiEvent = getGuiEventObj('resize', 'table', 0);
|
|
2108
1674
|
guiEvent.PageSize = pageSize;
|
|
2109
|
-
//As 'getRows' event also gets executed, set the guiEvent.Line parameter.
|
|
2110
1675
|
guiEvent.Line = topGuiRowId;
|
|
2111
1676
|
this.insertEvent(guiEvent);
|
|
2112
1677
|
}
|
|
2113
|
-
/**
|
|
2114
|
-
* Fetches data for new table rows when scrolling done
|
|
2115
|
-
*/
|
|
2116
1678
|
onScrollDown() {
|
|
2117
1679
|
if (!this.Records.includesLast) {
|
|
2118
1680
|
let guiEvent = getGuiEventObj('getRows', 'table', 0);
|
|
@@ -2120,29 +1682,15 @@ class TaskMagicService {
|
|
|
2120
1682
|
this.insertEvent(guiEvent);
|
|
2121
1683
|
}
|
|
2122
1684
|
}
|
|
2123
|
-
/**
|
|
2124
|
-
* Sets the new browser window title
|
|
2125
|
-
* @param newTitle New window title
|
|
2126
|
-
*/
|
|
2127
1685
|
setTitle(newTitle) {
|
|
2128
1686
|
this.mgTitleService.setTitle(newTitle);
|
|
2129
1687
|
}
|
|
2130
|
-
/**
|
|
2131
|
-
* @ignore
|
|
2132
|
-
*/
|
|
2133
1688
|
getGuiRowId(dvRowId, isTableControl) {
|
|
2134
1689
|
return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
|
|
2135
1690
|
}
|
|
2136
|
-
/**
|
|
2137
|
-
*
|
|
2138
|
-
* @ignore
|
|
2139
|
-
*/
|
|
2140
1691
|
getDvRowId(guiRowId) {
|
|
2141
1692
|
return (guiRowId - this.Records.recordsBeforeCurrentView);
|
|
2142
1693
|
}
|
|
2143
|
-
/**
|
|
2144
|
-
* Clean up the service when it is no longer needed
|
|
2145
|
-
*/
|
|
2146
1694
|
dispose() {
|
|
2147
1695
|
this.refreshDom.complete();
|
|
2148
1696
|
this.detectChanges.complete();
|
|
@@ -2152,14 +1700,6 @@ class TaskMagicService {
|
|
|
2152
1700
|
this.customPropertiesSubject.complete();
|
|
2153
1701
|
this.OnSelectedRowChanged.complete();
|
|
2154
1702
|
}
|
|
2155
|
-
///////////////////////////////
|
|
2156
|
-
//Events:
|
|
2157
|
-
/**
|
|
2158
|
-
* Handle the Combobox "change" event
|
|
2159
|
-
* @param event The event received from the UI
|
|
2160
|
-
* @param idx Id of the control raising the event
|
|
2161
|
-
* @param line Row Id, if applicable
|
|
2162
|
-
*/
|
|
2163
1703
|
onComboboxSelectionChanged(event, idx, line) {
|
|
2164
1704
|
let guiEvent = getGuiEventObj('selectionchanged', idx, line);
|
|
2165
1705
|
if (typeof (event) == 'number') {
|
|
@@ -2178,11 +1718,6 @@ class TaskMagicService {
|
|
|
2178
1718
|
}
|
|
2179
1719
|
this.insertEvent(guiEvent);
|
|
2180
1720
|
}
|
|
2181
|
-
/**
|
|
2182
|
-
* Handle the Listbox "change" event
|
|
2183
|
-
* @param event The event received from the UI
|
|
2184
|
-
* @param idx Id of the control raising the event
|
|
2185
|
-
*/
|
|
2186
1721
|
onListBoxSelectionChanged(event, idx) {
|
|
2187
1722
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
|
2188
1723
|
let selectedOptions;
|
|
@@ -2198,15 +1733,9 @@ class TaskMagicService {
|
|
|
2198
1733
|
else
|
|
2199
1734
|
indexes[i] = (selectedOptions[i]).value;
|
|
2200
1735
|
}
|
|
2201
|
-
guiEvent.Value = indexes;
|
|
1736
|
+
guiEvent.Value = indexes;
|
|
2202
1737
|
this.insertEvent(guiEvent);
|
|
2203
1738
|
}
|
|
2204
|
-
/**
|
|
2205
|
-
* Handle the Checkbox "change" event
|
|
2206
|
-
* @param event The event received from the UI
|
|
2207
|
-
* @param idx Id of the control raising the event
|
|
2208
|
-
* @param rowId Row Id, if applicable
|
|
2209
|
-
*/
|
|
2210
1739
|
onCheckChanged(event, idx, rowId) {
|
|
2211
1740
|
if (typeof rowId === 'undefined')
|
|
2212
1741
|
rowId = 0;
|
|
@@ -2222,21 +1751,11 @@ class TaskMagicService {
|
|
|
2222
1751
|
}
|
|
2223
1752
|
this.insertEvent(guiEvent);
|
|
2224
1753
|
}
|
|
2225
|
-
/**
|
|
2226
|
-
* Handle tab selection change, caused by UI events
|
|
2227
|
-
* @param idx Id of the control raising the event
|
|
2228
|
-
* @param layer Id of selected tabpage
|
|
2229
|
-
*/
|
|
2230
1754
|
mgOnTabSelectionChanged(idx, layer) {
|
|
2231
1755
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
|
2232
1756
|
guiEvent.Value = layer.toString();
|
|
2233
1757
|
this.insertEvent(guiEvent);
|
|
2234
1758
|
}
|
|
2235
|
-
/**
|
|
2236
|
-
* Handle the Radio button "change" event
|
|
2237
|
-
* @param event The event received from the UI
|
|
2238
|
-
* @param idx Id of the control raising the event
|
|
2239
|
-
*/
|
|
2240
1759
|
mgOnRadioSelectionChanged(event, idx) {
|
|
2241
1760
|
let result = this.getFormControl('0', idx);
|
|
2242
1761
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
|
@@ -2246,28 +1765,15 @@ class TaskMagicService {
|
|
|
2246
1765
|
guiEvent.Value = result.value;
|
|
2247
1766
|
this.insertEvent(guiEvent);
|
|
2248
1767
|
}
|
|
2249
|
-
/**
|
|
2250
|
-
* Inserts the "close" event to the magic WebClient event queue
|
|
2251
|
-
*/
|
|
2252
1768
|
close() {
|
|
2253
1769
|
this.insertEvent(getGuiEventObj('close', null, 0));
|
|
2254
1770
|
}
|
|
2255
|
-
///////////////////////////////
|
|
2256
|
-
/**
|
|
2257
|
-
* @ignore
|
|
2258
|
-
*/
|
|
2259
1771
|
IsStub() {
|
|
2260
1772
|
return this.magic.isStub;
|
|
2261
1773
|
}
|
|
2262
|
-
/**
|
|
2263
|
-
* @ignore
|
|
2264
|
-
*/
|
|
2265
1774
|
saveData(data) {
|
|
2266
1775
|
this.magic.saveData(data);
|
|
2267
1776
|
}
|
|
2268
|
-
/**
|
|
2269
|
-
* @ignore
|
|
2270
|
-
*/
|
|
2271
1777
|
createData() {
|
|
2272
1778
|
let myData = {
|
|
2273
1779
|
records: this.Records,
|
|
@@ -2279,9 +1785,6 @@ class TaskMagicService {
|
|
|
2279
1785
|
console.log(text);
|
|
2280
1786
|
this.saveData(text);
|
|
2281
1787
|
}
|
|
2282
|
-
/**
|
|
2283
|
-
* @ignore
|
|
2284
|
-
*/
|
|
2285
1788
|
loadStubData(stubData) {
|
|
2286
1789
|
this.Records = stubData.records;
|
|
2287
1790
|
this.settemplate(stubData.template);
|
|
@@ -2289,15 +1792,9 @@ class TaskMagicService {
|
|
|
2289
1792
|
for (let i = 0; i < this.Records.list.length; i++)
|
|
2290
1793
|
this.buildTableRowControls(i);
|
|
2291
1794
|
}
|
|
2292
|
-
/**
|
|
2293
|
-
* @ignore
|
|
2294
|
-
*/
|
|
2295
1795
|
loadData() {
|
|
2296
1796
|
alert('Please, overwrite method loadData');
|
|
2297
1797
|
}
|
|
2298
|
-
/**
|
|
2299
|
-
* @ignore
|
|
2300
|
-
*/
|
|
2301
1798
|
setStubValue(guiRowId, fc, name) {
|
|
2302
1799
|
if (this.IsStub()) {
|
|
2303
1800
|
try {
|
|
@@ -2309,15 +1806,12 @@ class TaskMagicService {
|
|
|
2309
1806
|
}
|
|
2310
1807
|
}
|
|
2311
1808
|
}
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
1809
|
+
TaskMagicService.ɵfac = function TaskMagicService_Factory(t) { return new (t || TaskMagicService)(ɵɵinject(EngineMagicService), ɵɵinject(OverlayWindowService)); };
|
|
1810
|
+
TaskMagicService.ɵprov = ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
|
1811
|
+
(function () { ɵsetClassMetadata(TaskMagicService, [{
|
|
2315
1812
|
type: Injectable
|
|
2316
1813
|
}], function () { return [{ type: EngineMagicService }, { type: OverlayWindowService }]; }, null); })();
|
|
2317
1814
|
|
|
2318
|
-
/**
|
|
2319
|
-
* @ignore
|
|
2320
|
-
*/
|
|
2321
1815
|
class CommandsCollectorMagicService {
|
|
2322
1816
|
constructor(magic) {
|
|
2323
1817
|
this.magic = magic;
|
|
@@ -2349,20 +1843,14 @@ class CommandsCollectorMagicService {
|
|
|
2349
1843
|
return commands;
|
|
2350
1844
|
}
|
|
2351
1845
|
}
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
1846
|
+
CommandsCollectorMagicService.ɵfac = function CommandsCollectorMagicService_Factory(t) { return new (t || CommandsCollectorMagicService)(ɵɵinject(EngineMagicService)); };
|
|
1847
|
+
CommandsCollectorMagicService.ɵprov = ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac });
|
|
1848
|
+
(function () { ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
|
2355
1849
|
type: Injectable
|
|
2356
1850
|
}], function () { return [{ type: EngineMagicService }]; }, null); })();
|
|
2357
1851
|
|
|
2358
|
-
/**
|
|
2359
|
-
* @ignore
|
|
2360
|
-
*/
|
|
2361
1852
|
class RouteCommand {
|
|
2362
1853
|
}
|
|
2363
|
-
/**
|
|
2364
|
-
* @ignore
|
|
2365
|
-
*/
|
|
2366
1854
|
class RouterCommandsMagicService {
|
|
2367
1855
|
constructor() {
|
|
2368
1856
|
this.pendingRouteCommands = [];
|
|
@@ -2377,32 +1865,27 @@ class RouterCommandsMagicService {
|
|
|
2377
1865
|
}
|
|
2378
1866
|
}
|
|
2379
1867
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
1868
|
+
RouterCommandsMagicService.ɵfac = function RouterCommandsMagicService_Factory(t) { return new (t || RouterCommandsMagicService)(); };
|
|
1869
|
+
RouterCommandsMagicService.ɵprov = ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac });
|
|
1870
|
+
(function () { ɵsetClassMetadata(RouterCommandsMagicService, [{
|
|
2383
1871
|
type: Injectable
|
|
2384
1872
|
}], null, null); })();
|
|
2385
1873
|
|
|
2386
|
-
/**
|
|
2387
|
-
* Service for managing subforms and routing
|
|
2388
|
-
*/
|
|
2389
1874
|
class SubformMagicService {
|
|
2390
|
-
constructor(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService) {
|
|
1875
|
+
constructor(task, activatedRoute, componentList, pendingCommandsCollector, router, routerCommandsMagicService, componentListMagicService, loader, injector) {
|
|
2391
1876
|
this.task = task;
|
|
2392
1877
|
this.activatedRoute = activatedRoute;
|
|
2393
1878
|
this.componentList = componentList;
|
|
2394
1879
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
2395
1880
|
this.router = router;
|
|
2396
1881
|
this.routerCommandsMagicService = routerCommandsMagicService;
|
|
2397
|
-
this.
|
|
2398
|
-
this.
|
|
1882
|
+
this.componentListMagicService = componentListMagicService;
|
|
1883
|
+
this.loader = loader;
|
|
1884
|
+
this.injector = injector;
|
|
1885
|
+
this.subformsDict = {};
|
|
1886
|
+
this.routesDict = {};
|
|
2399
1887
|
this.currentRouteDefinition = null;
|
|
2400
1888
|
}
|
|
2401
|
-
/**
|
|
2402
|
-
* Finds and returns the component according to the subform name
|
|
2403
|
-
* @param subformName
|
|
2404
|
-
* @returns
|
|
2405
|
-
*/
|
|
2406
1889
|
mgGetComp(subformName) {
|
|
2407
1890
|
if (subformName in this.subformsDict) {
|
|
2408
1891
|
let formName = this.subformsDict[subformName].formName;
|
|
@@ -2411,11 +1894,6 @@ class SubformMagicService {
|
|
|
2411
1894
|
}
|
|
2412
1895
|
return null;
|
|
2413
1896
|
}
|
|
2414
|
-
/**
|
|
2415
|
-
* Returns the parameters of the subform
|
|
2416
|
-
* @param subformName
|
|
2417
|
-
* @returns
|
|
2418
|
-
*/
|
|
2419
1897
|
mgGetParameters(subformName) {
|
|
2420
1898
|
if (subformName in this.subformsDict) {
|
|
2421
1899
|
return this.subformsDict[subformName].parameters;
|
|
@@ -2423,9 +1901,6 @@ class SubformMagicService {
|
|
|
2423
1901
|
else
|
|
2424
1902
|
return "";
|
|
2425
1903
|
}
|
|
2426
|
-
/**
|
|
2427
|
-
* @ignore
|
|
2428
|
-
*/
|
|
2429
1904
|
deleteSubformComp(subformControlName, formName) {
|
|
2430
1905
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2431
1906
|
if (this.subformsDict[subformControlName].formName === formName) {
|
|
@@ -2434,27 +1909,34 @@ class SubformMagicService {
|
|
|
2434
1909
|
}
|
|
2435
1910
|
}
|
|
2436
1911
|
}
|
|
2437
|
-
/**
|
|
2438
|
-
* @ignore
|
|
2439
|
-
*/
|
|
2440
1912
|
addSubformComp(subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
|
2441
1913
|
this.pendingCommandsCollector.startCollecting();
|
|
2442
1914
|
let refreshNeeded = false;
|
|
2443
|
-
if (isNullOrUndefined(routerPath)) {
|
|
1915
|
+
if (isNullOrUndefined(routerPath)) {
|
|
2444
1916
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
|
2445
1917
|
if (this.subformsDict[subformControlName].formName === formName) {
|
|
2446
1918
|
this.subformsDict[subformControlName] = {};
|
|
2447
1919
|
this.task.refreshView();
|
|
2448
1920
|
}
|
|
2449
1921
|
}
|
|
1922
|
+
let moduleRef = this.componentListMagicService.getModuleRef(formName);
|
|
1923
|
+
if (moduleRef == null) {
|
|
1924
|
+
let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
|
1925
|
+
if (lazyLoadModule != null) {
|
|
1926
|
+
this.loader
|
|
1927
|
+
.load(lazyLoadModule.modulePath + "#" + lazyLoadModule.moduleName)
|
|
1928
|
+
.then((moduleFactory) => {
|
|
1929
|
+
moduleRef = moduleFactory.create(this.injector);
|
|
1930
|
+
});
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
2450
1933
|
this.subformsDict[subformControlName] = {
|
|
2451
1934
|
formName,
|
|
2452
1935
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
2453
1936
|
};
|
|
2454
|
-
//this.ref.detectChanges();
|
|
2455
1937
|
refreshNeeded = true;
|
|
2456
1938
|
}
|
|
2457
|
-
else {
|
|
1939
|
+
else {
|
|
2458
1940
|
if (inDefaultOutlet)
|
|
2459
1941
|
subformControlName = "primary";
|
|
2460
1942
|
let routeParams = new List();
|
|
@@ -2469,10 +1951,6 @@ class SubformMagicService {
|
|
|
2469
1951
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
|
2470
1952
|
routeParams: routeParams
|
|
2471
1953
|
};
|
|
2472
|
-
// If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
|
|
2473
|
-
// called once, but angular has not yet executed it (ngOnInit of the new component is not called).
|
|
2474
|
-
// In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
|
|
2475
|
-
// So, put a command in the queue which will be executed after the first one is executed.
|
|
2476
1954
|
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
2477
1955
|
this.ExecuteRouteCommand(routeCommand);
|
|
2478
1956
|
else
|
|
@@ -2481,16 +1959,11 @@ class SubformMagicService {
|
|
|
2481
1959
|
if (refreshNeeded)
|
|
2482
1960
|
this.task.refreshView();
|
|
2483
1961
|
}
|
|
2484
|
-
/**
|
|
2485
|
-
* Open the subform using a route command
|
|
2486
|
-
*/
|
|
2487
1962
|
ExecuteRouteCommand(routeCommand) {
|
|
2488
1963
|
let reusingComponent = false;
|
|
2489
1964
|
let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
|
2490
1965
|
let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
|
2491
1966
|
if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
|
|
2492
|
-
// If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
|
|
2493
|
-
// So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
|
|
2494
1967
|
currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
|
|
2495
1968
|
.then((result) => {
|
|
2496
1969
|
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
@@ -2530,12 +2003,7 @@ class SubformMagicService {
|
|
|
2530
2003
|
}
|
|
2531
2004
|
});
|
|
2532
2005
|
}
|
|
2533
|
-
/**
|
|
2534
|
-
* @ignore
|
|
2535
|
-
*/
|
|
2536
2006
|
init() {
|
|
2537
|
-
// If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
|
|
2538
|
-
// So, execute them now.
|
|
2539
2007
|
const pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
|
2540
2008
|
if (pendingCommands.length > 0) {
|
|
2541
2009
|
pendingCommands.forEach(command => { this.task.executeCommand(command); });
|
|
@@ -2543,15 +2011,9 @@ class SubformMagicService {
|
|
|
2543
2011
|
}
|
|
2544
2012
|
this.pendingCommandsCollector.stopCollecting();
|
|
2545
2013
|
}
|
|
2546
|
-
/**
|
|
2547
|
-
* @ignore
|
|
2548
|
-
*/
|
|
2549
2014
|
refreshView() {
|
|
2550
2015
|
this.task.refreshView();
|
|
2551
2016
|
}
|
|
2552
|
-
///
|
|
2553
|
-
// return the relative route
|
|
2554
|
-
//
|
|
2555
2017
|
static getRelativeRoute(sendActivatedRoute) {
|
|
2556
2018
|
let currentActiveRoute = sendActivatedRoute;
|
|
2557
2019
|
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
|
@@ -2564,70 +2026,37 @@ class SubformMagicService {
|
|
|
2564
2026
|
}
|
|
2565
2027
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
2566
2028
|
SubformMagicService.routerContainers = new Array();
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2029
|
+
SubformMagicService.ɵfac = function SubformMagicService_Factory(t) { return new (t || SubformMagicService)(ɵɵinject(TaskMagicService), ɵɵinject(ActivatedRoute), ɵɵinject(ComponentListMagicService), ɵɵinject(CommandsCollectorMagicService), ɵɵinject(Router), ɵɵinject(RouterCommandsMagicService), ɵɵinject(ComponentListMagicService), ɵɵinject(NgModuleFactoryLoader), ɵɵinject(Injector)); };
|
|
2030
|
+
SubformMagicService.ɵprov = ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
2031
|
+
(function () { ɵsetClassMetadata(SubformMagicService, [{
|
|
2570
2032
|
type: Injectable
|
|
2571
|
-
}], function () { return [{ type: TaskMagicService }, { type: ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: Router }, { type: RouterCommandsMagicService }]; }, null); })();
|
|
2033
|
+
}], function () { return [{ type: TaskMagicService }, { type: ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: NgModuleFactoryLoader }, { type: Injector }]; }, null); })();
|
|
2572
2034
|
|
|
2573
|
-
/**
|
|
2574
|
-
* Implements various table-related functionalities
|
|
2575
|
-
*/
|
|
2576
2035
|
class TableMagicService {
|
|
2577
|
-
/**
|
|
2578
|
-
*
|
|
2579
|
-
* @param componentList Component-mapping service
|
|
2580
|
-
* @param task Magic task service
|
|
2581
|
-
*/
|
|
2582
2036
|
constructor(componentList, task) {
|
|
2583
2037
|
this.componentList = componentList;
|
|
2584
2038
|
this.task = task;
|
|
2585
2039
|
this.shouldOpenFieldTextEditor = true;
|
|
2586
2040
|
}
|
|
2587
|
-
/**
|
|
2588
|
-
* Refreshes the DataSource
|
|
2589
|
-
*/
|
|
2590
2041
|
refreshDataSource() {
|
|
2591
2042
|
}
|
|
2592
|
-
/**
|
|
2593
|
-
* Returns the table page size
|
|
2594
|
-
*/
|
|
2595
2043
|
getPageSize() {
|
|
2596
2044
|
return 10;
|
|
2597
2045
|
}
|
|
2598
|
-
/**
|
|
2599
|
-
* Returns max no of rows in the table.
|
|
2600
|
-
*/
|
|
2601
2046
|
getMaxRowsInTable() {
|
|
2602
2047
|
return this.task.Records.list.length;
|
|
2603
2048
|
}
|
|
2604
|
-
/**
|
|
2605
|
-
* Selects the specified row
|
|
2606
|
-
* @param rowId The row to select
|
|
2607
|
-
*/
|
|
2608
2049
|
selectRow(rowId) {
|
|
2609
2050
|
this.selectedItem = rowId;
|
|
2610
2051
|
}
|
|
2611
2052
|
getSelectedRow() {
|
|
2612
2053
|
return this.selectedItem;
|
|
2613
2054
|
}
|
|
2614
|
-
/**
|
|
2615
|
-
* Returns the selected row
|
|
2616
|
-
*/
|
|
2617
2055
|
selectedRow() {
|
|
2618
2056
|
return null;
|
|
2619
2057
|
}
|
|
2620
|
-
/**
|
|
2621
|
-
* Selects the specified page
|
|
2622
|
-
* @param pageId The page to select
|
|
2623
|
-
*/
|
|
2624
2058
|
selectPage(pageId) {
|
|
2625
2059
|
}
|
|
2626
|
-
/**
|
|
2627
|
-
* Returns whether a dialog should be opened for the HTML element
|
|
2628
|
-
* @param element The HTML element for which a dialog may be needed
|
|
2629
|
-
* @returns
|
|
2630
|
-
*/
|
|
2631
2060
|
OpenDialogForControl(element) {
|
|
2632
2061
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
|
2633
2062
|
element.tagName === "INPUT" ||
|
|
@@ -2635,34 +2064,17 @@ class TableMagicService {
|
|
|
2635
2064
|
return false;
|
|
2636
2065
|
return true;
|
|
2637
2066
|
}
|
|
2638
|
-
/**
|
|
2639
|
-
* Returns the dialog used to edit values
|
|
2640
|
-
*/
|
|
2641
2067
|
getDialog() {
|
|
2642
2068
|
return null;
|
|
2643
2069
|
}
|
|
2644
|
-
/**
|
|
2645
|
-
* Handles the table "scrolled" event
|
|
2646
|
-
*/
|
|
2647
2070
|
onScrollDown() {
|
|
2648
2071
|
this.task.onScrollDown();
|
|
2649
2072
|
}
|
|
2650
|
-
/**
|
|
2651
|
-
* To be overwitten in specific implelemtations
|
|
2652
|
-
*/
|
|
2653
2073
|
sortData(e) { }
|
|
2654
|
-
/**
|
|
2655
|
-
* To be overwitten in specific implelemtations
|
|
2656
|
-
*/
|
|
2657
2074
|
mgOnPaginateChange(e) { }
|
|
2658
2075
|
mgOptionChanged(e) { }
|
|
2659
|
-
/**
|
|
2660
|
-
* Change the number of lines in a table
|
|
2661
|
-
* @param size New number of lines in table
|
|
2662
|
-
*/
|
|
2663
2076
|
updateTableSize(size) {
|
|
2664
|
-
if (size === 0)
|
|
2665
|
-
{
|
|
2077
|
+
if (size === 0) {
|
|
2666
2078
|
size = 1;
|
|
2667
2079
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
|
2668
2080
|
}
|
|
@@ -2670,17 +2082,11 @@ class TableMagicService {
|
|
|
2670
2082
|
this.task.Records.updateSize(size);
|
|
2671
2083
|
this.task.setIncludesFirst(false);
|
|
2672
2084
|
}
|
|
2673
|
-
/**
|
|
2674
|
-
* @ignore
|
|
2675
|
-
*/
|
|
2676
2085
|
setTableTopIndex(value) {
|
|
2677
2086
|
if (!this.task.Records.includesFirst)
|
|
2678
2087
|
value++;
|
|
2679
2088
|
this.task.Records.setGuiTopIndex(value);
|
|
2680
2089
|
}
|
|
2681
|
-
/**
|
|
2682
|
-
* @ignore
|
|
2683
|
-
*/
|
|
2684
2090
|
getTableTopIndex() {
|
|
2685
2091
|
let topIndex = this.task.Records.getGuiTopIndex();
|
|
2686
2092
|
if (!this.task.Records.includesFirst)
|
|
@@ -2688,55 +2094,32 @@ class TableMagicService {
|
|
|
2688
2094
|
return topIndex;
|
|
2689
2095
|
}
|
|
2690
2096
|
}
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2097
|
+
TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(ɵɵinject(ComponentListMagicService), ɵɵinject(TaskMagicService)); };
|
|
2098
|
+
TableMagicService.ɵprov = ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
|
2099
|
+
(function () { ɵsetClassMetadata(TableMagicService, [{
|
|
2694
2100
|
type: Injectable
|
|
2695
2101
|
}], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null); })();
|
|
2696
2102
|
|
|
2697
|
-
/**
|
|
2698
|
-
* Enables changing the browser title using Magic expression (SetTitle)
|
|
2699
|
-
*/
|
|
2700
2103
|
class TitleMagicService {
|
|
2701
|
-
/**
|
|
2702
|
-
*
|
|
2703
|
-
* @param titleService Angular's title-changing class
|
|
2704
|
-
*/
|
|
2705
2104
|
constructor(titleService) {
|
|
2706
2105
|
this.titleService = titleService;
|
|
2707
2106
|
}
|
|
2708
|
-
/**
|
|
2709
|
-
* Set the new title of the window
|
|
2710
|
-
* @param newTitle New title of the window
|
|
2711
|
-
*/
|
|
2712
2107
|
setTitle(newTitle) {
|
|
2713
2108
|
this.titleService.setTitle(newTitle);
|
|
2714
2109
|
}
|
|
2715
2110
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2111
|
+
TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(ɵɵinject(Title)); };
|
|
2112
|
+
TitleMagicService.ɵprov = ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
|
2113
|
+
(function () { ɵsetClassMetadata(TitleMagicService, [{
|
|
2719
2114
|
type: Injectable
|
|
2720
2115
|
}], function () { return [{ type: Title }]; }, null); })();
|
|
2721
2116
|
|
|
2722
|
-
/**
|
|
2723
|
-
* Provides the UI with values calculated by the Magic WebClient
|
|
2724
|
-
*/
|
|
2725
2117
|
class AccessorMagicService {
|
|
2726
|
-
/**
|
|
2727
|
-
* @ignore
|
|
2728
|
-
*/
|
|
2729
2118
|
constructor(task) {
|
|
2730
2119
|
this.task = task;
|
|
2731
2120
|
this.Logger = null;
|
|
2732
2121
|
this.Logger = Logger.Instance;
|
|
2733
2122
|
}
|
|
2734
|
-
/**
|
|
2735
|
-
* Checks if the control is read-only
|
|
2736
|
-
* @param controlId Id of control
|
|
2737
|
-
* @returns Is the control not read-only
|
|
2738
|
-
*/
|
|
2739
|
-
// CheckReadOnly
|
|
2740
2123
|
checkIsReadOnly(controlId) {
|
|
2741
2124
|
let properties;
|
|
2742
2125
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2745,99 +2128,45 @@ class AccessorMagicService {
|
|
|
2745
2128
|
else
|
|
2746
2129
|
return true;
|
|
2747
2130
|
}
|
|
2748
|
-
/**
|
|
2749
|
-
* Returns the text of the control
|
|
2750
|
-
* @param controlId Id of control
|
|
2751
|
-
* @param rowId Id of row, if applicable
|
|
2752
|
-
* @returns The text of the control
|
|
2753
|
-
*/
|
|
2754
|
-
// mgGetText
|
|
2755
2131
|
getText(controlId, rowId) {
|
|
2756
2132
|
return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
|
|
2757
2133
|
}
|
|
2758
|
-
/**
|
|
2759
|
-
* Gets the text of the tab page
|
|
2760
|
-
* @param controlId Id of control
|
|
2761
|
-
* @param layer Id of tabpage
|
|
2762
|
-
* @returns Text of tabpage
|
|
2763
|
-
*/
|
|
2764
|
-
// mgGetTabpageText
|
|
2765
2134
|
getTabpageText(controlId, layer) {
|
|
2766
2135
|
const items = this.task.getProperty(controlId, HtmlProperties.ItemsList);
|
|
2767
2136
|
if (typeof items !== "undefined")
|
|
2768
2137
|
return items[layer].displayValue;
|
|
2769
2138
|
return "";
|
|
2770
2139
|
}
|
|
2771
|
-
/**
|
|
2772
|
-
* Gets the image defined for the control
|
|
2773
|
-
* @param controlId Id of control
|
|
2774
|
-
* @param rowId Id of row, if applicable
|
|
2775
|
-
* @returns Image set on control
|
|
2776
|
-
*/
|
|
2777
|
-
// mgGetImage
|
|
2778
2140
|
getImage(controlId, rowId) {
|
|
2779
2141
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
|
2780
2142
|
return result;
|
|
2781
2143
|
}
|
|
2782
|
-
/**
|
|
2783
|
-
* Returns whether an image is set for this control
|
|
2784
|
-
* @param controlId Id of control
|
|
2785
|
-
* @param rowId Id of row, if applicable
|
|
2786
|
-
* @returns returns true if control has an image set on it
|
|
2787
|
-
*/
|
|
2788
|
-
// mgIsImageExists
|
|
2789
2144
|
isImageExists(controlId, rowId) {
|
|
2790
2145
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
|
2791
2146
|
return !isNullOrUndefined(result);
|
|
2792
2147
|
}
|
|
2793
|
-
/**
|
|
2794
|
-
* Gets the CSS classes set on the control
|
|
2795
|
-
* @param controlId Id of control
|
|
2796
|
-
* @param rowId Id of row, if applicable
|
|
2797
|
-
* @returns The classes for this control
|
|
2798
|
-
*/
|
|
2799
|
-
// mgGetClasses
|
|
2800
2148
|
getClasses(controlId, rowId) {
|
|
2801
2149
|
return this.task.getClasses(controlId, rowId);
|
|
2802
2150
|
}
|
|
2803
|
-
/**
|
|
2804
|
-
* Gets the CSS styles set on the control
|
|
2805
|
-
* @param controlId Id of control
|
|
2806
|
-
* @param styleName NAme of style requested
|
|
2807
|
-
* @param rowId Id of row, if applicable
|
|
2808
|
-
* @returns The style set on the control
|
|
2809
|
-
*/
|
|
2810
|
-
// mgGetStyle
|
|
2811
2151
|
getStyle(controlId, styleName, rowId) {
|
|
2812
2152
|
let style = this.task.getStyle(controlId, styleName, rowId);
|
|
2813
2153
|
return style;
|
|
2814
2154
|
}
|
|
2815
|
-
/**
|
|
2816
|
-
* Returns whether a control is visible or not
|
|
2817
|
-
* @param controlId Id of control
|
|
2818
|
-
* @param rowId Id of row, if applicable
|
|
2819
|
-
* @returns Is the control visible or hidden
|
|
2820
|
-
*/
|
|
2821
|
-
// mgGetVisible
|
|
2822
2155
|
getVisible(controlId, rowId) {
|
|
2823
2156
|
let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
|
|
2824
2157
|
return vis ? 'visible' : 'hidden';
|
|
2825
2158
|
}
|
|
2826
|
-
/**
|
|
2827
|
-
* Returns object representing numeric picture
|
|
2828
|
-
* @param picture string which is defined in magic
|
|
2829
|
-
* @returns object representing numeric picture
|
|
2830
|
-
*/
|
|
2831
|
-
// mgGetNumericPicture
|
|
2832
2159
|
getNumericPicture(picture) {
|
|
2833
2160
|
if (isNullOrUndefined(picture))
|
|
2834
2161
|
return null;
|
|
2835
2162
|
let pic = new PIC(picture, StorageAttribute.NUMERIC, 0);
|
|
2836
2163
|
var obj = {};
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2164
|
+
obj['prefix'] = "";
|
|
2165
|
+
if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
|
|
2166
|
+
let pref = '-' + pic.getPosPref_();
|
|
2167
|
+
if (pref == pic.getNegPref_())
|
|
2168
|
+
obj['prefix'] = pic.getPosPref_();
|
|
2169
|
+
}
|
|
2841
2170
|
if (pic.getPosSuff_().length > 0)
|
|
2842
2171
|
obj['suffix'] = pic.getPosSuff_();
|
|
2843
2172
|
else
|
|
@@ -2859,128 +2188,51 @@ class AccessorMagicService {
|
|
|
2859
2188
|
obj['wholes'] = pic.getWholes();
|
|
2860
2189
|
return obj;
|
|
2861
2190
|
}
|
|
2862
|
-
/**
|
|
2863
|
-
* Returns whether a control should have the "required" attribute set on it
|
|
2864
|
-
* @param controlId Id of control
|
|
2865
|
-
* @param rowId Id of row, if applicable
|
|
2866
|
-
* @returns
|
|
2867
|
-
*/
|
|
2868
|
-
// mgGetMustInput
|
|
2869
2191
|
getMustInput(controlId, rowId) {
|
|
2870
2192
|
let vis = this.getProperty(controlId, HtmlProperties.MustInput, rowId);
|
|
2871
2193
|
return vis ? 'true' : 'false';
|
|
2872
2194
|
}
|
|
2873
|
-
/**
|
|
2874
|
-
* Returns whether a control is disabled
|
|
2875
|
-
* @param controlId Id of control
|
|
2876
|
-
* @param rowId Id of row, if applicable
|
|
2877
|
-
* @returns
|
|
2878
|
-
*/
|
|
2879
|
-
// mgIsDisabled
|
|
2880
2195
|
isDisabled(controlId, rowId) {
|
|
2881
2196
|
let result = this.getProperty(controlId, HtmlProperties.Enabled, rowId);
|
|
2882
2197
|
return result === true ? null : true;
|
|
2883
2198
|
}
|
|
2884
|
-
/**
|
|
2885
|
-
* @ignore
|
|
2886
|
-
*/
|
|
2887
|
-
// getProperty (not changed)
|
|
2888
2199
|
getProperty(controlId, prop, rowId) {
|
|
2889
2200
|
return this.task.getProperty(controlId, prop, rowId);
|
|
2890
2201
|
}
|
|
2891
|
-
/**
|
|
2892
|
-
* Returns the title (tooltip) text of the control
|
|
2893
|
-
* @param controlId Id of control
|
|
2894
|
-
* @param rowId Id of row, if applicable
|
|
2895
|
-
* @returns
|
|
2896
|
-
*/
|
|
2897
|
-
// mgGetTitle
|
|
2898
2202
|
getTitle(controlId, rowId) {
|
|
2899
2203
|
return this.task.getProperty(controlId, HtmlProperties.Tooltip, rowId);
|
|
2900
2204
|
}
|
|
2901
|
-
/**
|
|
2902
|
-
* Returns the title (tooltip) text of the control
|
|
2903
|
-
* @param controlId Id of control
|
|
2904
|
-
* @param rowId Id of row, if applicable
|
|
2905
|
-
* @returns
|
|
2906
|
-
*/
|
|
2907
|
-
// mgGetTitle for zoom button
|
|
2908
2205
|
getZoomButtonTitle(controlId, rowId) {
|
|
2909
2206
|
return this.task.getProperty(controlId, HtmlProperties.ZoomButtonTooltip, rowId);
|
|
2910
2207
|
}
|
|
2911
|
-
/**
|
|
2912
|
-
* Gets the selection control's selected value
|
|
2913
|
-
* @param controlId Id of control
|
|
2914
|
-
* @param rowId Id of row, if applicable
|
|
2915
|
-
* @returns
|
|
2916
|
-
*/
|
|
2917
|
-
// getSelectedValue
|
|
2918
2208
|
getSelectedValue(controlId, rowId) {
|
|
2919
2209
|
return this.task.getProperty(controlId, HtmlProperties.SelectedValue, rowId);
|
|
2920
2210
|
}
|
|
2921
|
-
/**
|
|
2922
|
-
* Gets the place-holder text of the control
|
|
2923
|
-
* @param controlId Id of control
|
|
2924
|
-
* @param rowId Id of row, if applicable
|
|
2925
|
-
* @returns
|
|
2926
|
-
*/
|
|
2927
|
-
// mgGetPlaceholder
|
|
2928
2211
|
getPlaceholder(controlId, rowId) {
|
|
2929
2212
|
return this.task.getProperty(controlId, HtmlProperties.PlaceHolder, rowId);
|
|
2930
2213
|
}
|
|
2931
|
-
/**
|
|
2932
|
-
* Returns a type for input controls - should the control be a simple text or a password control
|
|
2933
|
-
* @param controlId Id of control
|
|
2934
|
-
* @param rowId Id of row, if applicable
|
|
2935
|
-
* @returns
|
|
2936
|
-
*/
|
|
2937
|
-
// mgGetType
|
|
2938
2214
|
getType(controlId, rowId) {
|
|
2939
2215
|
let result = this.task.getProperty(controlId, HtmlProperties.Password, rowId);
|
|
2940
2216
|
return result ? "password" : "text";
|
|
2941
2217
|
}
|
|
2942
|
-
/**
|
|
2943
|
-
* Returns the tab-index of the control
|
|
2944
|
-
* @param controlId Id of control
|
|
2945
|
-
* @param rowId Id of row, if applicable
|
|
2946
|
-
* @returns
|
|
2947
|
-
*/
|
|
2948
|
-
// mgGetTabIndex
|
|
2949
2218
|
getTabIndex(controlId, rowId) {
|
|
2950
2219
|
return this.task.getProperty(controlId, HtmlProperties.TabIndex, rowId);
|
|
2951
2220
|
}
|
|
2952
|
-
/**
|
|
2953
|
-
* Returns the value of the control
|
|
2954
|
-
* @param controlId Id of control
|
|
2955
|
-
* @param rowId Id of row, if applicable
|
|
2956
|
-
* @returns
|
|
2957
|
-
*/
|
|
2958
|
-
/// mgGetValue -->
|
|
2959
2221
|
getValue(controlId, rowId) {
|
|
2960
2222
|
let val = this.task.getValue(controlId, rowId);
|
|
2961
2223
|
return val;
|
|
2962
2224
|
}
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
*/
|
|
2969
|
-
/// getPicture -->
|
|
2225
|
+
getFormattedValue(controlId, rowId) {
|
|
2226
|
+
let val = this.task.getValue(controlId, rowId);
|
|
2227
|
+
val = this.task.getFormattedValue(controlId, val);
|
|
2228
|
+
return val;
|
|
2229
|
+
}
|
|
2970
2230
|
getPicture(controlId, rowId) {
|
|
2971
2231
|
if (isNullOrUndefined(controlId))
|
|
2972
2232
|
return null;
|
|
2973
2233
|
let pic = this.task.GetControlPictureMask(controlId);
|
|
2974
2234
|
return (pic != null) ? pic.getFormat().toString() : null;
|
|
2975
2235
|
}
|
|
2976
|
-
/**
|
|
2977
|
-
* Returns the custom (user) properties of the control
|
|
2978
|
-
* @param controlId Id of control
|
|
2979
|
-
* @param propertyName Name of requested property
|
|
2980
|
-
* @param rowId Id of row, if applicable
|
|
2981
|
-
* @returns
|
|
2982
|
-
*/
|
|
2983
|
-
// mgGetCustomProperty
|
|
2984
2236
|
getCustomProperty(controlId, propertyNameOrRowID, rowId) {
|
|
2985
2237
|
if (controlId.indexOf('~') == -1)
|
|
2986
2238
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
|
@@ -3005,22 +2257,19 @@ class AccessorMagicService {
|
|
|
3005
2257
|
}
|
|
3006
2258
|
return userProperties;
|
|
3007
2259
|
}
|
|
3008
|
-
/**
|
|
3009
|
-
* Gets the values of the items of a selection control
|
|
3010
|
-
* @param id Id of control
|
|
3011
|
-
* @param rowId Id of row, if applicable
|
|
3012
|
-
* @returns
|
|
3013
|
-
*/
|
|
3014
|
-
// mgGetItemListValues
|
|
3015
2260
|
getItemListValues(id, rowId) {
|
|
3016
2261
|
return this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
|
3017
2262
|
}
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
2263
|
+
getFilteredList(controlId, rowId) {
|
|
2264
|
+
if (isNullOrUndefined(rowId))
|
|
2265
|
+
rowId = '0';
|
|
2266
|
+
let items = this.getItemListValues(controlId, rowId);
|
|
2267
|
+
let value = this.task.getFormControl(rowId, controlId).value;
|
|
2268
|
+
if (value !== null && value !== "")
|
|
2269
|
+
return items.filter(option => option.displayValue.toLowerCase().includes(value));
|
|
2270
|
+
else
|
|
2271
|
+
return items;
|
|
2272
|
+
}
|
|
3024
2273
|
getDisplayValue(id, rowId) {
|
|
3025
2274
|
let displayValue = "";
|
|
3026
2275
|
let o = this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
|
@@ -3029,12 +2278,6 @@ class AccessorMagicService {
|
|
|
3029
2278
|
displayValue = o[value].displayValue;
|
|
3030
2279
|
return displayValue;
|
|
3031
2280
|
}
|
|
3032
|
-
/**
|
|
3033
|
-
* Returns whether a tab page is selected or not
|
|
3034
|
-
* @param index of current option in iterarotr
|
|
3035
|
-
* @param control Id of list control
|
|
3036
|
-
* @returns
|
|
3037
|
-
*/ // isOptionSelected
|
|
3038
2281
|
isOptionSelected(index, controlId) {
|
|
3039
2282
|
let val = this.task.getValue(controlId, "0");
|
|
3040
2283
|
for (let item of val) {
|
|
@@ -3043,40 +2286,18 @@ class AccessorMagicService {
|
|
|
3043
2286
|
}
|
|
3044
2287
|
return false;
|
|
3045
2288
|
}
|
|
3046
|
-
/**
|
|
3047
|
-
* Returns whether a tab page is selected or not - used for the tab buttons
|
|
3048
|
-
* @param controlId Id of control
|
|
3049
|
-
* @param layer Id of the tab page
|
|
3050
|
-
* @returns
|
|
3051
|
-
*/ // mgIsTabPageSelected
|
|
3052
2289
|
isTabPageSelected(controlId, layer) {
|
|
3053
2290
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
|
3054
|
-
return val == (layer - 1);
|
|
3055
|
-
}
|
|
3056
|
-
/**
|
|
3057
|
-
* Returns whether a tab page layer is selected or not - used for the div which represents the tab page
|
|
3058
|
-
* @param controlId Id of control
|
|
3059
|
-
* @param layer Id of the tab page
|
|
3060
|
-
* @returns
|
|
3061
|
-
*/ // mgIsTabLayerSelected
|
|
2291
|
+
return val == (layer - 1);
|
|
2292
|
+
}
|
|
3062
2293
|
isTabPageLayerSelected(controlId, layer) {
|
|
3063
2294
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedLayer);
|
|
3064
|
-
return val == (layer - 1);
|
|
2295
|
+
return val == (layer - 1);
|
|
3065
2296
|
}
|
|
3066
|
-
/**
|
|
3067
|
-
* Returns the index of the selected tab page
|
|
3068
|
-
* @param controlId Id of control
|
|
3069
|
-
* @returns
|
|
3070
|
-
*/
|
|
3071
2297
|
getTabSelectedIndex(controlId) {
|
|
3072
2298
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
|
3073
|
-
return val;
|
|
2299
|
+
return val;
|
|
3074
2300
|
}
|
|
3075
|
-
// private methodes
|
|
3076
|
-
/**
|
|
3077
|
-
* @ignore
|
|
3078
|
-
*/
|
|
3079
|
-
// mgIfRowCreated
|
|
3080
2301
|
ifRowCreated(row) {
|
|
3081
2302
|
if (row == null)
|
|
3082
2303
|
return false;
|
|
@@ -3084,48 +2305,25 @@ class AccessorMagicService {
|
|
|
3084
2305
|
let result = this.getFormGroupByRow(rowId);
|
|
3085
2306
|
return !isNullOrUndefined(result);
|
|
3086
2307
|
}
|
|
3087
|
-
/**
|
|
3088
|
-
* @ignore
|
|
3089
|
-
*/
|
|
3090
|
-
// mgGetFormGroupByRow
|
|
3091
2308
|
getFormGroupByRow(id) {
|
|
3092
2309
|
return this.task.formGroups[id];
|
|
3093
2310
|
}
|
|
3094
|
-
/**
|
|
3095
|
-
* @ignore
|
|
3096
|
-
*/
|
|
3097
|
-
// isRowSelected (not changed)
|
|
3098
2311
|
isRowSelected(controlId, rowId) {
|
|
3099
2312
|
const selectedRow = this.task.getProperty(controlId, HtmlProperties.SelectedRow, "0");
|
|
3100
2313
|
return selectedRow == rowId;
|
|
3101
2314
|
}
|
|
3102
|
-
/**
|
|
3103
|
-
* Returns whether a row is in edit state
|
|
3104
|
-
* @param row
|
|
3105
|
-
*/
|
|
3106
2315
|
isRowInRowEditing(row) {
|
|
3107
2316
|
let guiRowId = '0';
|
|
3108
2317
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
|
3109
2318
|
return this.task.isRowInRowEditing(guiRowId);
|
|
3110
2319
|
}
|
|
3111
|
-
/**
|
|
3112
|
-
* Returns whether a row is in edit state, use this method while control outside table control
|
|
3113
|
-
* @param row
|
|
3114
|
-
*/
|
|
3115
2320
|
isCurrentInRowEditing() {
|
|
3116
2321
|
let row = this.task.tableService.getSelectedRow();
|
|
3117
2322
|
return this.task.isRowInRowEditing(row);
|
|
3118
2323
|
}
|
|
3119
|
-
/**
|
|
3120
|
-
* @ignore
|
|
3121
|
-
*/
|
|
3122
|
-
// GetGuiTopIndex
|
|
3123
2324
|
guiTopIndex() {
|
|
3124
2325
|
return this.task.tableService.getTableTopIndex();
|
|
3125
2326
|
}
|
|
3126
|
-
/**
|
|
3127
|
-
* @ignore
|
|
3128
|
-
*/
|
|
3129
2327
|
getErrMsg(id, rowId) {
|
|
3130
2328
|
let c = this.task.getFormControl(rowId, id);
|
|
3131
2329
|
if (c.hasError('required'))
|
|
@@ -3147,12 +2345,6 @@ class AccessorMagicService {
|
|
|
3147
2345
|
}
|
|
3148
2346
|
return 'unknown error';
|
|
3149
2347
|
}
|
|
3150
|
-
/**
|
|
3151
|
-
* Sets a user-supplied value to the specified control
|
|
3152
|
-
* @param controlName
|
|
3153
|
-
* @param value
|
|
3154
|
-
* @param refreshDisplay
|
|
3155
|
-
*/
|
|
3156
2348
|
setValueToControl(controlName, value, refreshDisplay) {
|
|
3157
2349
|
if (typeof refreshDisplay === "undefined")
|
|
3158
2350
|
refreshDisplay = true;
|
|
@@ -3161,44 +2353,28 @@ class AccessorMagicService {
|
|
|
3161
2353
|
guiEvent.param = refreshDisplay;
|
|
3162
2354
|
this.task.insertEvent(guiEvent);
|
|
3163
2355
|
}
|
|
3164
|
-
/**
|
|
3165
|
-
* @ignore
|
|
3166
|
-
*/
|
|
3167
2356
|
isDataviewEmpty() {
|
|
3168
2357
|
return this.task.Records.isEmptyDataView;
|
|
3169
2358
|
}
|
|
3170
|
-
/**
|
|
3171
|
-
* simulates a click event on the specified control, for the Magic engine
|
|
3172
|
-
* @param controlName
|
|
3173
|
-
* @param rowId
|
|
3174
|
-
*/
|
|
3175
2359
|
simulateClick(controlName, rowId) {
|
|
3176
2360
|
if (typeof rowId === "undefined")
|
|
3177
2361
|
rowId = 0;
|
|
3178
2362
|
this.task.insertEvent(getGuiEventObj('click', controlName, rowId));
|
|
3179
2363
|
}
|
|
3180
|
-
/**
|
|
3181
|
-
* Return Boolean TRUE if user logged in Else it will return FALSE
|
|
3182
|
-
*/
|
|
3183
2364
|
isLoggedIn() {
|
|
3184
2365
|
return this.task.getIsLoggenIn();
|
|
3185
2366
|
}
|
|
3186
|
-
/**
|
|
3187
|
-
* Returns JS object containing the records with all table fields.
|
|
3188
|
-
*/
|
|
3189
2367
|
GetFormRecords() {
|
|
3190
2368
|
let rowId = 0;
|
|
3191
2369
|
let recArray;
|
|
3192
2370
|
if (!isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
|
3193
2371
|
let recList = this.task.Records.list;
|
|
3194
2372
|
let tableControls = new Array();
|
|
3195
|
-
//Generate list of table fields names
|
|
3196
2373
|
for (const key in this.task.template) {
|
|
3197
2374
|
if (this.task.template[key] == '1')
|
|
3198
2375
|
tableControls.push(key);
|
|
3199
2376
|
}
|
|
3200
2377
|
recArray = new Array();
|
|
3201
|
-
//Update the records as list of objects with values for table fields.
|
|
3202
2378
|
if (tableControls.length > 0) {
|
|
3203
2379
|
recList.forEach((ctrlMetaData) => {
|
|
3204
2380
|
if (this.task.Records.isRowCreated(rowId)) {
|
|
@@ -3214,20 +2390,23 @@ class AccessorMagicService {
|
|
|
3214
2390
|
}
|
|
3215
2391
|
return recArray;
|
|
3216
2392
|
}
|
|
2393
|
+
SetCookie(name, value, expires, path, domain, secure, sameSite) {
|
|
2394
|
+
CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
|
2395
|
+
}
|
|
2396
|
+
GetCookie(name) {
|
|
2397
|
+
return CookieService.getCookie(name);
|
|
2398
|
+
}
|
|
2399
|
+
DeleteCookie(name) {
|
|
2400
|
+
return CookieService.deleteCookie(name);
|
|
2401
|
+
}
|
|
3217
2402
|
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
2403
|
+
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(ɵɵinject(TaskMagicService)); };
|
|
2404
|
+
AccessorMagicService.ɵprov = ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
2405
|
+
(function () { ɵsetClassMetadata(AccessorMagicService, [{
|
|
3221
2406
|
type: Injectable
|
|
3222
2407
|
}], function () { return [{ type: TaskMagicService }]; }, null); })();
|
|
3223
2408
|
|
|
3224
|
-
/**
|
|
3225
|
-
* Central place for adding the Magic services
|
|
3226
|
-
*/
|
|
3227
2409
|
class MagicServices {
|
|
3228
|
-
/**
|
|
3229
|
-
* @ignore
|
|
3230
|
-
*/
|
|
3231
2410
|
constructor(task, subformService, tableService, titleService, mgAccessorService) {
|
|
3232
2411
|
this.task = task;
|
|
3233
2412
|
this.subformService = subformService;
|
|
@@ -3240,74 +2419,36 @@ class MagicServices {
|
|
|
3240
2419
|
task.mgAccessorService = mgAccessorService;
|
|
3241
2420
|
}
|
|
3242
2421
|
}
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
2422
|
+
MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(ɵɵinject(TaskMagicService), ɵɵinject(SubformMagicService), ɵɵinject(TableMagicService), ɵɵinject(TitleMagicService), ɵɵinject(AccessorMagicService)); };
|
|
2423
|
+
MagicServices.ɵprov = ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
|
2424
|
+
(function () { ɵsetClassMetadata(MagicServices, [{
|
|
3246
2425
|
type: Injectable
|
|
3247
2426
|
}], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null); })();
|
|
3248
2427
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Base component representing a Magic task
|
|
3251
|
-
*/
|
|
3252
2428
|
class TaskBaseMagicComponent {
|
|
3253
|
-
/**
|
|
3254
|
-
*
|
|
3255
|
-
* @param ref changes-detector object
|
|
3256
|
-
* @param magicServices Access point for all Magic services
|
|
3257
|
-
*/
|
|
3258
2429
|
constructor(ref, magicServices) {
|
|
3259
2430
|
this.ref = ref;
|
|
3260
2431
|
this.magicServices = magicServices;
|
|
3261
|
-
/**
|
|
3262
|
-
* @ignore
|
|
3263
|
-
*/
|
|
3264
2432
|
this.magicProperties = MagicProperties;
|
|
3265
2433
|
}
|
|
3266
|
-
/**
|
|
3267
|
-
* Returns the Magic task service
|
|
3268
|
-
* @returns
|
|
3269
|
-
*/
|
|
3270
2434
|
get task() {
|
|
3271
2435
|
return this.magicServices.task;
|
|
3272
2436
|
}
|
|
3273
|
-
/**
|
|
3274
|
-
* Returns the Magic subform service
|
|
3275
|
-
* @returns
|
|
3276
|
-
*/
|
|
3277
2437
|
get mgSub() {
|
|
3278
2438
|
return this.magicServices.subformService;
|
|
3279
2439
|
}
|
|
3280
|
-
/**
|
|
3281
|
-
* Returns the Magic table service
|
|
3282
|
-
* @returns
|
|
3283
|
-
*/
|
|
3284
2440
|
get tableService() {
|
|
3285
2441
|
return this.magicServices.tableService;
|
|
3286
2442
|
}
|
|
3287
|
-
/**
|
|
3288
|
-
* Returns the Magic accessor service
|
|
3289
|
-
* @returns
|
|
3290
|
-
*/
|
|
3291
2443
|
get mg() {
|
|
3292
2444
|
return this.magicServices.mgAccessorService;
|
|
3293
2445
|
}
|
|
3294
|
-
/**
|
|
3295
|
-
* Returns the task Id
|
|
3296
|
-
* @returns
|
|
3297
|
-
*/
|
|
3298
2446
|
get taskId() {
|
|
3299
2447
|
return this.task.taskId;
|
|
3300
2448
|
}
|
|
3301
|
-
/**
|
|
3302
|
-
* Returns the FormGroup for screen-mode forms
|
|
3303
|
-
* @returns
|
|
3304
|
-
*/
|
|
3305
2449
|
get screenFormGroup() {
|
|
3306
2450
|
return this.task.ScreenModeControls;
|
|
3307
2451
|
}
|
|
3308
|
-
/**
|
|
3309
|
-
* Interface implementation
|
|
3310
|
-
*/
|
|
3311
2452
|
ngOnInit() {
|
|
3312
2453
|
let subscription = this.task.detectChanges.pipe().subscribe(c => {
|
|
3313
2454
|
this.ref.detectChanges();
|
|
@@ -3315,48 +2456,19 @@ class TaskBaseMagicComponent {
|
|
|
3315
2456
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
3316
2457
|
this.createFormControlsAccessor(this.screenFormGroup);
|
|
3317
2458
|
this.setInputDateFormat();
|
|
3318
|
-
// subcribe to custom property changes
|
|
3319
2459
|
this.task.customPropertiesSubject.pipe().subscribe(property => {
|
|
3320
2460
|
this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
|
3321
2461
|
});
|
|
3322
|
-
// subcribe to records count changes
|
|
3323
2462
|
this.task.recordsCountChangeSubject.pipe().subscribe(value => {
|
|
3324
2463
|
this.RecordsCountChanged(value);
|
|
3325
2464
|
});
|
|
3326
2465
|
}
|
|
3327
|
-
/**
|
|
3328
|
-
* @ignore
|
|
3329
|
-
*/
|
|
3330
2466
|
createFormControlsAccessor(formGroup) { }
|
|
3331
|
-
/**
|
|
3332
|
-
* @ignore
|
|
3333
|
-
*/
|
|
3334
2467
|
setInputDateFormat() { }
|
|
3335
|
-
/**
|
|
3336
|
-
* This method is called when the value of any custom property is updated in Magic
|
|
3337
|
-
* propertyName : name of property which is updated. The format is <controlname>~<propertyname>
|
|
3338
|
-
* rowId : row number of the updated property for controls in table control (0 for controls outside table)
|
|
3339
|
-
* value : updated value of the property
|
|
3340
|
-
* @returns : void
|
|
3341
|
-
* To use the method override it in your component and check the property name and write you code ..for eg
|
|
3342
|
-
* if(propertyName == 'controlname~propertyName') {// your code}
|
|
3343
|
-
* else { // your code}
|
|
3344
|
-
*/
|
|
3345
2468
|
PropertyChanged(propertyName, rowId, value) {
|
|
3346
|
-
|
|
3347
|
-
}
|
|
3348
|
-
/**
|
|
3349
|
-
* Records count change subject is subscribed to change in its value. This method will be called
|
|
3350
|
-
* as the value of records count is received at from server.
|
|
3351
|
-
* @returns : void
|
|
3352
|
-
* To use the method override it in your component.
|
|
3353
|
-
*/
|
|
2469
|
+
}
|
|
3354
2470
|
RecordsCountChanged(recordsCount) {
|
|
3355
|
-
// intentionally left blank because the implementation should be in the derived class
|
|
3356
2471
|
}
|
|
3357
|
-
/**
|
|
3358
|
-
* Interface implementation
|
|
3359
|
-
*/
|
|
3360
2472
|
ngAfterViewInit() {
|
|
3361
2473
|
this.mgSub.init();
|
|
3362
2474
|
}
|
|
@@ -3366,16 +2478,13 @@ class TaskBaseMagicComponent {
|
|
|
3366
2478
|
this.task.oldPageSize = this.tableService.getPageSize();
|
|
3367
2479
|
}
|
|
3368
2480
|
}
|
|
3369
|
-
/**
|
|
3370
|
-
* Interface implementation
|
|
3371
|
-
*/
|
|
3372
2481
|
ngOnDestroy() {
|
|
3373
2482
|
this.task.dispose();
|
|
3374
2483
|
}
|
|
3375
2484
|
}
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
2485
|
+
TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(MagicServices)); };
|
|
2486
|
+
TaskBaseMagicComponent.ɵcmp = ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
2487
|
+
(function () { ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
|
3379
2488
|
type: Component,
|
|
3380
2489
|
args: [{
|
|
3381
2490
|
selector: 'task-magic',
|
|
@@ -3388,22 +2497,13 @@ class TaskBaseMagicComponent {
|
|
|
3388
2497
|
type: Input
|
|
3389
2498
|
}] }); })();
|
|
3390
2499
|
|
|
3391
|
-
/**
|
|
3392
|
-
* @ignore
|
|
3393
|
-
*/
|
|
3394
2500
|
class RowMagicDirective {
|
|
3395
2501
|
constructor(_task, element) {
|
|
3396
2502
|
this._task = _task;
|
|
3397
2503
|
this.element = element;
|
|
3398
|
-
/**
|
|
3399
|
-
* @ignore
|
|
3400
|
-
*/
|
|
3401
2504
|
this.rowChangedSubscriber = null;
|
|
3402
2505
|
this.htmlElement = this.element.nativeElement;
|
|
3403
2506
|
}
|
|
3404
|
-
/**
|
|
3405
|
-
* Initializes this object
|
|
3406
|
-
*/
|
|
3407
2507
|
ngOnInit() {
|
|
3408
2508
|
this.rowChangedSubscriber = this._task
|
|
3409
2509
|
.OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
|
|
@@ -3418,16 +2518,7 @@ class RowMagicDirective {
|
|
|
3418
2518
|
return (rect.top >= parentRect.top &&
|
|
3419
2519
|
rect.bottom <= parentRect.bottom);
|
|
3420
2520
|
}
|
|
3421
|
-
/**
|
|
3422
|
-
* Cleanup
|
|
3423
|
-
*/
|
|
3424
2521
|
ngOnDestroy() {
|
|
3425
|
-
// Don't know why, but when the table is loaded for the first time, we
|
|
3426
|
-
// get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
|
|
3427
|
-
// for number of rows in the page but here this.rowId is undefined.
|
|
3428
|
-
// Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
|
|
3429
|
-
// is null and hence crashes.
|
|
3430
|
-
// So, the condition to check nulity is added.
|
|
3431
2522
|
if (this.rowChangedSubscriber !== null) {
|
|
3432
2523
|
this.rowChangedSubscriber.unsubscribe();
|
|
3433
2524
|
}
|
|
@@ -3439,11 +2530,11 @@ class RowMagicDirective {
|
|
|
3439
2530
|
}
|
|
3440
2531
|
}
|
|
3441
2532
|
}
|
|
3442
|
-
|
|
3443
|
-
|
|
2533
|
+
RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef)); };
|
|
2534
|
+
RowMagicDirective.ɵdir = ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
3444
2535
|
ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
|
3445
2536
|
} }, inputs: { rowId: ["magicRow", "rowId"] } });
|
|
3446
|
-
|
|
2537
|
+
(function () { ɵsetClassMetadata(RowMagicDirective, [{
|
|
3447
2538
|
type: Directive,
|
|
3448
2539
|
args: [{
|
|
3449
2540
|
selector: '[magicRow]'
|
|
@@ -3456,35 +2547,16 @@ class RowMagicDirective {
|
|
|
3456
2547
|
args: ['click', ['$event']]
|
|
3457
2548
|
}] }); })();
|
|
3458
2549
|
|
|
3459
|
-
/**
|
|
3460
|
-
* Connects HTML elements to the Magic Web Client engine
|
|
3461
|
-
*/
|
|
3462
2550
|
class MagicDirective {
|
|
3463
|
-
/**
|
|
3464
|
-
*
|
|
3465
|
-
* @param _task The task service
|
|
3466
|
-
* @param element The element for which the directive is applied
|
|
3467
|
-
* @param renderer Renderer for the element
|
|
3468
|
-
* @param vcRef
|
|
3469
|
-
* @param magicRow
|
|
3470
|
-
*/
|
|
3471
2551
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
|
3472
2552
|
this._task = _task;
|
|
3473
2553
|
this.element = element;
|
|
3474
2554
|
this.renderer = renderer;
|
|
3475
2555
|
this.vcRef = vcRef;
|
|
3476
2556
|
this.magicRow = magicRow;
|
|
3477
|
-
/**
|
|
3478
|
-
* Collection of event handlers for this element
|
|
3479
|
-
*/
|
|
3480
2557
|
this.eventHandlers = {};
|
|
3481
2558
|
this.eventsOnlyVal = false;
|
|
3482
2559
|
this.htmlElement = this.element.nativeElement;
|
|
3483
|
-
//let c = (<any>this.vcRef)._view;
|
|
3484
|
-
//while (!(c instanceof TaskBaseMagicComponent)) {
|
|
3485
|
-
// c = c.component;
|
|
3486
|
-
//}
|
|
3487
|
-
//this.component = c;
|
|
3488
2560
|
if (!(typeof magicRow === 'undefined' || magicRow === null))
|
|
3489
2561
|
this.rowId = magicRow.rowId;
|
|
3490
2562
|
}
|
|
@@ -3493,40 +2565,26 @@ class MagicDirective {
|
|
|
3493
2565
|
this.selector = 'magic';
|
|
3494
2566
|
}
|
|
3495
2567
|
;
|
|
3496
|
-
/**
|
|
3497
|
-
* This flag is used when we only want to register to events, but do not want to execute commands sent from server
|
|
3498
|
-
*/
|
|
3499
2568
|
set eventsOnly(val) {
|
|
3500
2569
|
console.log('eventsOnly');
|
|
3501
2570
|
this.eventsOnlyVal = true;
|
|
3502
2571
|
}
|
|
3503
2572
|
;
|
|
3504
|
-
/**
|
|
3505
|
-
* Get the task service
|
|
3506
|
-
* @returns
|
|
3507
|
-
*/
|
|
3508
2573
|
get task() {
|
|
3509
2574
|
return this._task;
|
|
3510
2575
|
}
|
|
3511
|
-
/**
|
|
3512
|
-
* Register to the events this element may need to handle
|
|
3513
|
-
*/
|
|
3514
2576
|
regEvents() {
|
|
3515
|
-
// Handle events for which event handler may be removed and restored
|
|
3516
2577
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
3517
2578
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
3518
2579
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
3519
2580
|
});
|
|
3520
|
-
|
|
3521
|
-
let events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
|
|
2581
|
+
let events = ['click', 'mousedown', 'dblclick'];
|
|
3522
2582
|
events.forEach(event => {
|
|
3523
2583
|
this.renderer.listen(this.htmlElement, event, (e) => {
|
|
3524
|
-
// check if the event is fired from zoom button ( to identify the connected zoom button in engine)
|
|
3525
2584
|
let fromButton = false;
|
|
3526
2585
|
if (this.htmlElement instanceof HTMLButtonElement)
|
|
3527
2586
|
fromButton = true;
|
|
3528
2587
|
this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
|
|
3529
|
-
e.cancelBubble = true;
|
|
3530
2588
|
});
|
|
3531
2589
|
});
|
|
3532
2590
|
this.renderer.listen(this.htmlElement, 'change', (e) => {
|
|
@@ -3537,13 +2595,10 @@ class MagicDirective {
|
|
|
3537
2595
|
this.task.insertEvent(guiEvent);
|
|
3538
2596
|
}
|
|
3539
2597
|
});
|
|
3540
|
-
// handle the input event
|
|
3541
2598
|
fromEvent(this.htmlElement, 'input').pipe(map((event) => {
|
|
3542
2599
|
return event.target.value;
|
|
3543
|
-
}), debounceTime(200)
|
|
3544
|
-
).subscribe((x) => {
|
|
2600
|
+
}), debounceTime(200)).subscribe((x) => {
|
|
3545
2601
|
if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
|
|
3546
|
-
// Don't support character binding for date/time values
|
|
3547
2602
|
let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
|
|
3548
2603
|
if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
|
|
3549
2604
|
this.task.mgAccessorService.setValueToControl(this.id, x, true);
|
|
@@ -3569,25 +2624,16 @@ class MagicDirective {
|
|
|
3569
2624
|
(e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
|
|
3570
2625
|
if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
|
|
3571
2626
|
guiEvent.keyCode = e.keyCode;
|
|
3572
|
-
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
|
3573
2627
|
if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && !MagicDirective.opened)
|
|
3574
2628
|
e.cancelBubble = true;
|
|
3575
2629
|
this.task.insertEvent(guiEvent);
|
|
3576
2630
|
}
|
|
3577
2631
|
});
|
|
3578
2632
|
}
|
|
3579
|
-
/**
|
|
3580
|
-
* Handle focus event
|
|
3581
|
-
*/
|
|
3582
2633
|
OnFocus() {
|
|
3583
2634
|
this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
|
|
3584
2635
|
event.cancelBubble = true;
|
|
3585
2636
|
}
|
|
3586
|
-
/**
|
|
3587
|
-
* Is the command's element the same as this directive's element
|
|
3588
|
-
* @param command
|
|
3589
|
-
* @returns true/false
|
|
3590
|
-
*/
|
|
3591
2637
|
IsSameElement(command) {
|
|
3592
2638
|
let line = command.line;
|
|
3593
2639
|
if (this.task.isTableControl(command.CtrlName))
|
|
@@ -3596,17 +2642,9 @@ class MagicDirective {
|
|
|
3596
2642
|
(line === +this.rowId ||
|
|
3597
2643
|
(line === 0 && isNullOrUndefined(this.rowId))));
|
|
3598
2644
|
}
|
|
3599
|
-
/**
|
|
3600
|
-
* Is the command's element the same as this directive's component
|
|
3601
|
-
* @param command
|
|
3602
|
-
* @returns true/false
|
|
3603
|
-
*/
|
|
3604
2645
|
IsSameComponent(command) {
|
|
3605
2646
|
return (command.controlName === this.id);
|
|
3606
2647
|
}
|
|
3607
|
-
/**
|
|
3608
|
-
* @ignore
|
|
3609
|
-
*/
|
|
3610
2648
|
regUpdatesUI() {
|
|
3611
2649
|
this.subscribeRefreshDom = this.task
|
|
3612
2650
|
.refreshDom.pipe(filter(c => this.IsSameElement(c)))
|
|
@@ -3628,17 +2666,10 @@ class MagicDirective {
|
|
|
3628
2666
|
this.handleInteractiveCommands(command);
|
|
3629
2667
|
});
|
|
3630
2668
|
}
|
|
3631
|
-
/**
|
|
3632
|
-
* Initializes this object
|
|
3633
|
-
*/
|
|
3634
2669
|
ngOnInit() {
|
|
3635
2670
|
this.regEvents();
|
|
3636
2671
|
this.regUpdatesUI();
|
|
3637
2672
|
}
|
|
3638
|
-
/**
|
|
3639
|
-
* Handles the commands received from the Magic WebClient engine
|
|
3640
|
-
* @param command
|
|
3641
|
-
*/
|
|
3642
2673
|
handleCommand(command) {
|
|
3643
2674
|
switch (command.CommandType) {
|
|
3644
2675
|
case CommandType.SET_PROPERTY:
|
|
@@ -3646,16 +2677,12 @@ class MagicDirective {
|
|
|
3646
2677
|
break;
|
|
3647
2678
|
case CommandType.SET_FOCUS:
|
|
3648
2679
|
this.focusUnlistener();
|
|
3649
|
-
// Do not set focus on connected zoom button
|
|
3650
2680
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
|
3651
2681
|
this.htmlElement.focus();
|
|
3652
2682
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
|
|
3653
2683
|
break;
|
|
3654
2684
|
}
|
|
3655
2685
|
}
|
|
3656
|
-
/**
|
|
3657
|
-
* handle the interactive commands like CallJS
|
|
3658
|
-
*/
|
|
3659
2686
|
handleInteractiveCommands(command) {
|
|
3660
2687
|
switch (command._commandType) {
|
|
3661
2688
|
case InteractiveCommandType.CALL_JS:
|
|
@@ -3665,24 +2692,18 @@ class MagicDirective {
|
|
|
3665
2692
|
let resultString = '';
|
|
3666
2693
|
try {
|
|
3667
2694
|
if (!isNullOrUndefined(magicComponent[methodName])) {
|
|
3668
|
-
// invoke the method on instance of magic componenet
|
|
3669
2695
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
|
3670
2696
|
}
|
|
3671
2697
|
else
|
|
3672
|
-
console.error('Instance method ' + methodName + ' does not exists');
|
|
2698
|
+
console.error('Instance method ' + methodName + ' does not exists');
|
|
3673
2699
|
}
|
|
3674
2700
|
catch (e) {
|
|
3675
|
-
// any other exception
|
|
3676
2701
|
console.error(e.message);
|
|
3677
2702
|
}
|
|
3678
|
-
command.resultString = resultString;
|
|
2703
|
+
command.resultString = resultString;
|
|
3679
2704
|
break;
|
|
3680
2705
|
}
|
|
3681
2706
|
}
|
|
3682
|
-
/**
|
|
3683
|
-
* Handle the Magic set-property command
|
|
3684
|
-
* @param command
|
|
3685
|
-
*/
|
|
3686
2707
|
handleSetProperty(command) {
|
|
3687
2708
|
switch (command.Operation) {
|
|
3688
2709
|
case HtmlProperties.ReadOnly:
|
|
@@ -3693,17 +2714,14 @@ class MagicDirective {
|
|
|
3693
2714
|
break;
|
|
3694
2715
|
}
|
|
3695
2716
|
}
|
|
3696
|
-
/**
|
|
3697
|
-
* Cleanup
|
|
3698
|
-
*/
|
|
3699
2717
|
ngOnDestroy() {
|
|
3700
2718
|
this.subscribeRefreshDom.unsubscribe();
|
|
3701
2719
|
}
|
|
3702
2720
|
}
|
|
3703
2721
|
MagicDirective.opened = false;
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
2722
|
+
MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
2723
|
+
MagicDirective.ɵdir = ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
|
|
2724
|
+
(function () { ɵsetClassMetadata(MagicDirective, [{
|
|
3707
2725
|
type: Directive,
|
|
3708
2726
|
args: [{
|
|
3709
2727
|
selector: '[magic]'
|
|
@@ -3720,9 +2738,6 @@ MagicDirective.opened = false;
|
|
|
3720
2738
|
type: Input
|
|
3721
2739
|
}] }); })();
|
|
3722
2740
|
|
|
3723
|
-
/**
|
|
3724
|
-
* @ignore
|
|
3725
|
-
*/
|
|
3726
2741
|
class NoControlMagicDirective extends MagicDirective {
|
|
3727
2742
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
|
3728
2743
|
super(_task, element, renderer, vcRef, magicRow);
|
|
@@ -3757,12 +2772,10 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3757
2772
|
}
|
|
3758
2773
|
}
|
|
3759
2774
|
}
|
|
3760
|
-
// is the div a tab control
|
|
3761
2775
|
isTabControl() {
|
|
3762
2776
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
3763
2777
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
|
3764
2778
|
}
|
|
3765
|
-
// is the div a radio buttons wrapper
|
|
3766
2779
|
isRadio() {
|
|
3767
2780
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
3768
2781
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
|
@@ -3771,7 +2784,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3771
2784
|
super.handleCommand(command);
|
|
3772
2785
|
switch (command.CommandType) {
|
|
3773
2786
|
case CommandType.SET_CLASS:
|
|
3774
|
-
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
|
3775
2787
|
const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
|
3776
2788
|
if (controlMetadata.removedClass != '') {
|
|
3777
2789
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
|
@@ -3784,7 +2796,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3784
2796
|
this.htmlElement.innerText = command.value;
|
|
3785
2797
|
if (this.htmlElement instanceof HTMLSelectElement)
|
|
3786
2798
|
this.htmlElement.value = command.value;
|
|
3787
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
2799
|
+
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
3788
2800
|
this.htmlElement.text = command.value;
|
|
3789
2801
|
if (this.htmlElement instanceof HTMLInputElement) {
|
|
3790
2802
|
if (this.htmlElement.type === "checkbox") {
|
|
@@ -3808,7 +2820,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3808
2820
|
break;
|
|
3809
2821
|
}
|
|
3810
2822
|
}
|
|
3811
|
-
// handle set-property commands
|
|
3812
2823
|
handleSetProperty(command) {
|
|
3813
2824
|
super.handleSetProperty(command);
|
|
3814
2825
|
switch (command.Operation) {
|
|
@@ -3824,7 +2835,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3824
2835
|
break;
|
|
3825
2836
|
case HtmlProperties.ItemsList:
|
|
3826
2837
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
|
3827
|
-
// clear the list
|
|
3828
2838
|
var len = this.htmlElement.length;
|
|
3829
2839
|
for (var i = len - 1; i >= 0; i--) {
|
|
3830
2840
|
this.htmlElement.remove(i);
|
|
@@ -3866,8 +2876,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3866
2876
|
let child = tabControl.children[i];
|
|
3867
2877
|
const layer = child.getAttribute('layer') - 1;
|
|
3868
2878
|
if (child instanceof HTMLButtonElement) {
|
|
3869
|
-
|
|
3870
|
-
if (layer == command.obj1) { // compare int to string
|
|
2879
|
+
if (layer == command.obj1) {
|
|
3871
2880
|
child.classList.add('tab_button_active');
|
|
3872
2881
|
}
|
|
3873
2882
|
else {
|
|
@@ -3875,7 +2884,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3875
2884
|
}
|
|
3876
2885
|
}
|
|
3877
2886
|
else {
|
|
3878
|
-
// not a buton - hide unselected tabpages
|
|
3879
2887
|
let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
|
3880
2888
|
child.setAttribute('style', style);
|
|
3881
2889
|
}
|
|
@@ -3897,9 +2905,9 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3897
2905
|
}
|
|
3898
2906
|
}
|
|
3899
2907
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
2908
|
+
NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
2909
|
+
NoControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [ɵɵInheritDefinitionFeature] });
|
|
2910
|
+
(function () { ɵsetClassMetadata(NoControlMagicDirective, [{
|
|
3903
2911
|
type: Directive,
|
|
3904
2912
|
args: [{
|
|
3905
2913
|
selector: '[magicnc]'
|
|
@@ -3911,20 +2919,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3911
2919
|
args: ['magicnc']
|
|
3912
2920
|
}] }); })();
|
|
3913
2921
|
|
|
3914
|
-
/**
|
|
3915
|
-
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
|
3916
|
-
*/
|
|
3917
2922
|
class RouterContainerMagicComponent {
|
|
3918
|
-
/**
|
|
3919
|
-
*
|
|
3920
|
-
* @param changeDetectorRef
|
|
3921
|
-
* @param activatedRoute
|
|
3922
|
-
* @param magic
|
|
3923
|
-
* @param componentFactoryResolver
|
|
3924
|
-
* @param viewContainerRef
|
|
3925
|
-
* @param componentList
|
|
3926
|
-
* @param pendingCommandsCollector
|
|
3927
|
-
*/
|
|
3928
2923
|
constructor(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
3929
2924
|
this.activatedRoute = activatedRoute;
|
|
3930
2925
|
this.magic = magic;
|
|
@@ -3937,9 +2932,6 @@ class RouterContainerMagicComponent {
|
|
|
3937
2932
|
this.componentRef = null;
|
|
3938
2933
|
this.parentMgSubformService = null;
|
|
3939
2934
|
}
|
|
3940
|
-
/**
|
|
3941
|
-
* Initialization
|
|
3942
|
-
*/
|
|
3943
2935
|
ngOnInit() {
|
|
3944
2936
|
let outletname = this.activatedRoute.outlet;
|
|
3945
2937
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
@@ -3957,10 +2949,7 @@ class RouterContainerMagicComponent {
|
|
|
3957
2949
|
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
3958
2950
|
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
3959
2951
|
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
|
3960
|
-
// if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
|
|
3961
|
-
// need to take the path form routeConfig.path
|
|
3962
2952
|
let calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
3963
|
-
// add the RouterPath only if exist
|
|
3964
2953
|
if (calcRouterPath.length > 0) {
|
|
3965
2954
|
let routerPath = calcRouterPath;
|
|
3966
2955
|
let tokens = StrUtil.tokenize(routerPath, "/:");
|
|
@@ -3973,7 +2962,6 @@ class RouterContainerMagicComponent {
|
|
|
3973
2962
|
this.containerTaskService.insertEvent(guiEvent);
|
|
3974
2963
|
}
|
|
3975
2964
|
initializeComponent() {
|
|
3976
|
-
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
|
3977
2965
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
3978
2966
|
if (subformMagicService.currentRouteDefinition !== null) {
|
|
3979
2967
|
let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
@@ -3986,9 +2974,6 @@ class RouterContainerMagicComponent {
|
|
|
3986
2974
|
this.parentMgSubformService = subformMagicService;
|
|
3987
2975
|
subformMagicService.currentRouteDefinition = null;
|
|
3988
2976
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
3989
|
-
//When the component is initialized, then also we get the notification for paramMap subscription.
|
|
3990
|
-
//But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
|
|
3991
|
-
//So, control it via ignoreParamChange flag.
|
|
3992
2977
|
let ignoreParamChange = true;
|
|
3993
2978
|
myActiveRoute.paramMap.subscribe(params => {
|
|
3994
2979
|
if (!ignoreParamChange)
|
|
@@ -3999,12 +2984,7 @@ class RouterContainerMagicComponent {
|
|
|
3999
2984
|
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
4000
2985
|
}
|
|
4001
2986
|
}
|
|
4002
|
-
/**
|
|
4003
|
-
* Cleanup
|
|
4004
|
-
*/
|
|
4005
2987
|
ngOnDestroy() {
|
|
4006
|
-
// TODO Routing: Call close() only if the task is not already closed.
|
|
4007
|
-
// Task can be closed when a router is overlayed by another task via call operation.
|
|
4008
2988
|
if (this.componentRef != null) {
|
|
4009
2989
|
this.componentRef.instance.task.close();
|
|
4010
2990
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
@@ -4012,9 +2992,9 @@ class RouterContainerMagicComponent {
|
|
|
4012
2992
|
}
|
|
4013
2993
|
}
|
|
4014
2994
|
}
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
2995
|
+
RouterContainerMagicComponent.ɵfac = function RouterContainerMagicComponent_Factory(t) { return new (t || RouterContainerMagicComponent)(ɵɵdirectiveInject(ActivatedRoute), ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ComponentFactoryResolver), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(RouterCommandsMagicService)); };
|
|
2996
|
+
RouterContainerMagicComponent.ɵcmp = ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
2997
|
+
(function () { ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
4018
2998
|
type: Component,
|
|
4019
2999
|
args: [{
|
|
4020
3000
|
selector: 'magic-route-outlet',
|
|
@@ -4023,15 +3003,9 @@ class RouterContainerMagicComponent {
|
|
|
4023
3003
|
}]
|
|
4024
3004
|
}], function () { return [{ type: ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: ComponentFactoryResolver }, { type: ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null); })();
|
|
4025
3005
|
|
|
4026
|
-
/**
|
|
4027
|
-
* @ignore
|
|
4028
|
-
*/
|
|
4029
3006
|
class Constants {
|
|
4030
3007
|
}
|
|
4031
3008
|
Constants.DATE_FMT = 'dd/MMM/yyyy';
|
|
4032
|
-
/**
|
|
4033
|
-
* @ignore
|
|
4034
|
-
*/
|
|
4035
3009
|
class DateMagicPipe extends DatePipe {
|
|
4036
3010
|
constructor(_task) {
|
|
4037
3011
|
super('en-US');
|
|
@@ -4043,7 +3017,6 @@ class DateMagicPipe extends DatePipe {
|
|
|
4043
3017
|
let mgDateFormatter = new MgDateFormatter();
|
|
4044
3018
|
if (!isNullOrUndefined(value) && mask !== null) {
|
|
4045
3019
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
|
4046
|
-
// If control is label control of table, due to query mode, then save the format here.
|
|
4047
3020
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
|
4048
3021
|
if (this._task.mgInputDateFormat == null)
|
|
4049
3022
|
this._task.mgInputDateFormat = formatStr;
|
|
@@ -4057,9 +3030,9 @@ class DateMagicPipe extends DatePipe {
|
|
|
4057
3030
|
return value;
|
|
4058
3031
|
}
|
|
4059
3032
|
}
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
3033
|
+
DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
|
|
3034
|
+
DateMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
|
3035
|
+
(function () { ɵsetClassMetadata(DateMagicPipe, [{
|
|
4063
3036
|
type: Pipe,
|
|
4064
3037
|
args: [{
|
|
4065
3038
|
name: 'magicDate'
|
|
@@ -4124,17 +3097,11 @@ class MgDateFormatter {
|
|
|
4124
3097
|
return formatStr.ToString();
|
|
4125
3098
|
}
|
|
4126
3099
|
else
|
|
4127
|
-
return "dd-mm-yyyy";
|
|
3100
|
+
return "dd-mm-yyyy";
|
|
4128
3101
|
}
|
|
4129
3102
|
}
|
|
4130
3103
|
|
|
4131
|
-
/**
|
|
4132
|
-
* Perform Magic validation on input controls which hold alphanumeric strings
|
|
4133
|
-
*/
|
|
4134
3104
|
class MgformatMagicDirective {
|
|
4135
|
-
/**
|
|
4136
|
-
* @ignore
|
|
4137
|
-
*/
|
|
4138
3105
|
constructor(magicDir, _task) {
|
|
4139
3106
|
this.magicDir = magicDir;
|
|
4140
3107
|
this._task = _task;
|
|
@@ -4142,20 +3109,12 @@ class MgformatMagicDirective {
|
|
|
4142
3109
|
ngAfterViewInit() {
|
|
4143
3110
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4144
3111
|
if (control != null && this._task.mgInputDateFormat == null) {
|
|
4145
|
-
// get the first date control's format.
|
|
4146
3112
|
let pic = this._task.GetControlPictureMask(this.magicDir.id);
|
|
4147
3113
|
if (pic.getAttr() == StorageAttribute.DATE) {
|
|
4148
3114
|
this.formatDate(pic);
|
|
4149
3115
|
}
|
|
4150
3116
|
}
|
|
4151
3117
|
}
|
|
4152
|
-
/**
|
|
4153
|
-
* @ignore
|
|
4154
|
-
*/
|
|
4155
|
-
/**
|
|
4156
|
-
* This can be used to set pattern
|
|
4157
|
-
* On input, verifies the input matches the required mask
|
|
4158
|
-
*/
|
|
4159
3118
|
onFocusEvent($event) {
|
|
4160
3119
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4161
3120
|
if (control != null) {
|
|
@@ -4180,10 +3139,6 @@ class MgformatMagicDirective {
|
|
|
4180
3139
|
}
|
|
4181
3140
|
}
|
|
4182
3141
|
}
|
|
4183
|
-
/**
|
|
4184
|
-
* @ignore
|
|
4185
|
-
*/
|
|
4186
|
-
// This can be used to implement uppercase/lower case
|
|
4187
3142
|
onChangeEvent($event) {
|
|
4188
3143
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4189
3144
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
@@ -4201,9 +3156,6 @@ class MgformatMagicDirective {
|
|
|
4201
3156
|
let mgDateFormatter = new MgDateFormatter();
|
|
4202
3157
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
|
4203
3158
|
}
|
|
4204
|
-
/**
|
|
4205
|
-
* @ignore
|
|
4206
|
-
*/
|
|
4207
3159
|
formatAlphaUnicode(control) {
|
|
4208
3160
|
let value = control.value;
|
|
4209
3161
|
if (value !== null && value.length > 0) {
|
|
@@ -4229,9 +3181,6 @@ class MgformatMagicDirective {
|
|
|
4229
3181
|
control.setValue(valueStr.ToString());
|
|
4230
3182
|
}
|
|
4231
3183
|
}
|
|
4232
|
-
/**
|
|
4233
|
-
* @ignore
|
|
4234
|
-
*/
|
|
4235
3184
|
formatBoolean(control) {
|
|
4236
3185
|
let value = control.value;
|
|
4237
3186
|
if (value !== null && value.length > 0) {
|
|
@@ -4244,12 +3193,6 @@ class MgformatMagicDirective {
|
|
|
4244
3193
|
}
|
|
4245
3194
|
}
|
|
4246
3195
|
}
|
|
4247
|
-
/**
|
|
4248
|
-
* @ignore
|
|
4249
|
-
*/
|
|
4250
|
-
/// <summary>
|
|
4251
|
-
/// generate pattern from fld's format
|
|
4252
|
-
/// </summary>
|
|
4253
3196
|
generatePattern(attribute, pic) {
|
|
4254
3197
|
let pattern = "";
|
|
4255
3198
|
switch (attribute) {
|
|
@@ -4263,12 +3206,6 @@ class MgformatMagicDirective {
|
|
|
4263
3206
|
}
|
|
4264
3207
|
return pattern;
|
|
4265
3208
|
}
|
|
4266
|
-
/**
|
|
4267
|
-
* @ignore
|
|
4268
|
-
*/
|
|
4269
|
-
/// <summary>
|
|
4270
|
-
/// generate pattern for Alpha
|
|
4271
|
-
/// </summary>
|
|
4272
3209
|
generatePatternForNumber(pic) {
|
|
4273
3210
|
let patternStr = new StringBuilder();
|
|
4274
3211
|
patternStr.Append("^");
|
|
@@ -4281,9 +3218,6 @@ class MgformatMagicDirective {
|
|
|
4281
3218
|
patternStr.Append("$");
|
|
4282
3219
|
return patternStr.ToString();
|
|
4283
3220
|
}
|
|
4284
|
-
/**
|
|
4285
|
-
* @ignore
|
|
4286
|
-
*/
|
|
4287
3221
|
isPatternGenerationNeeded(attr, pic) {
|
|
4288
3222
|
switch (attr) {
|
|
4289
3223
|
case StorageAttribute.NUMERIC:
|
|
@@ -4293,12 +3227,6 @@ class MgformatMagicDirective {
|
|
|
4293
3227
|
return (pic.getMaskChars() > 0) ? true : false;
|
|
4294
3228
|
}
|
|
4295
3229
|
}
|
|
4296
|
-
/**
|
|
4297
|
-
* @ignore
|
|
4298
|
-
*/
|
|
4299
|
-
/// <summary>
|
|
4300
|
-
/// generate pattern for Alpha
|
|
4301
|
-
/// </summary>
|
|
4302
3230
|
generatePatternForAlpha(pic) {
|
|
4303
3231
|
let cnt = 0;
|
|
4304
3232
|
let inputAllChars = false;
|
|
@@ -4309,7 +3237,6 @@ class MgformatMagicDirective {
|
|
|
4309
3237
|
let pattern = new StringBuilder();
|
|
4310
3238
|
pattern.Append("^");
|
|
4311
3239
|
for (let i = 0; i < mask.length;) {
|
|
4312
|
-
//start new subset , if mask[i] is one of these.
|
|
4313
3240
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
|
4314
3241
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
|
4315
3242
|
pattern.Append("(");
|
|
@@ -4355,13 +3282,9 @@ class MgformatMagicDirective {
|
|
|
4355
3282
|
pattern.Append("$");
|
|
4356
3283
|
return pattern.ToString();
|
|
4357
3284
|
}
|
|
4358
|
-
/**
|
|
4359
|
-
* @ignore
|
|
4360
|
-
*/
|
|
4361
3285
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
|
4362
3286
|
changeInPattern.value = false;
|
|
4363
3287
|
let patternCount = 0;
|
|
4364
|
-
// find max chars
|
|
4365
3288
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
|
4366
3289
|
patternCount++;
|
|
4367
3290
|
idx++;
|
|
@@ -4370,9 +3293,6 @@ class MgformatMagicDirective {
|
|
|
4370
3293
|
changeInPattern.value = true;
|
|
4371
3294
|
return patternCount;
|
|
4372
3295
|
}
|
|
4373
|
-
/**
|
|
4374
|
-
* @ignore
|
|
4375
|
-
*/
|
|
4376
3296
|
IsPatternMatches(mask, pattern) {
|
|
4377
3297
|
for (let i = 0; i < pattern.length; i++)
|
|
4378
3298
|
if (mask == pattern[i])
|
|
@@ -4380,11 +3300,11 @@ class MgformatMagicDirective {
|
|
|
4380
3300
|
return false;
|
|
4381
3301
|
}
|
|
4382
3302
|
}
|
|
4383
|
-
|
|
4384
|
-
|
|
3303
|
+
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(ɵɵdirectiveInject(MagicDirective), ɵɵdirectiveInject(TaskMagicService)); };
|
|
3304
|
+
MgformatMagicDirective.ɵdir = ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4385
3305
|
ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
|
4386
3306
|
} } });
|
|
4387
|
-
|
|
3307
|
+
(function () { ɵsetClassMetadata(MgformatMagicDirective, [{
|
|
4388
3308
|
type: Directive,
|
|
4389
3309
|
args: [{
|
|
4390
3310
|
selector: '[mgFormat]'
|
|
@@ -4397,9 +3317,6 @@ class MgformatMagicDirective {
|
|
|
4397
3317
|
args: ['change', ['$event']]
|
|
4398
3318
|
}] }); })();
|
|
4399
3319
|
|
|
4400
|
-
/**
|
|
4401
|
-
* @ignore
|
|
4402
|
-
*/
|
|
4403
3320
|
class TimeMagicPipe extends DatePipe {
|
|
4404
3321
|
constructor(_task) {
|
|
4405
3322
|
super('en-US');
|
|
@@ -4435,33 +3352,20 @@ class TimeMagicPipe extends DatePipe {
|
|
|
4435
3352
|
return value;
|
|
4436
3353
|
}
|
|
4437
3354
|
}
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
3355
|
+
TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
|
|
3356
|
+
TimeMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
|
3357
|
+
(function () { ɵsetClassMetadata(TimeMagicPipe, [{
|
|
4441
3358
|
type: Pipe,
|
|
4442
3359
|
args: [{
|
|
4443
3360
|
name: 'magicTime'
|
|
4444
3361
|
}]
|
|
4445
3362
|
}], function () { return [{ type: TaskMagicService }]; }, null); })();
|
|
4446
3363
|
|
|
4447
|
-
/**
|
|
4448
|
-
* Validates the field range.
|
|
4449
|
-
*/
|
|
4450
3364
|
class RangeValidatorMagicDirective {
|
|
4451
|
-
/**
|
|
4452
|
-
*
|
|
4453
|
-
* @param _task The task service
|
|
4454
|
-
* @param vcRef
|
|
4455
|
-
*/
|
|
4456
3365
|
constructor(_task, vcRef) {
|
|
4457
3366
|
this._task = _task;
|
|
4458
3367
|
this.vcRef = vcRef;
|
|
4459
3368
|
}
|
|
4460
|
-
/**
|
|
4461
|
-
* Validation method
|
|
4462
|
-
* @param c FormControl to validate
|
|
4463
|
-
* @returns If validation fails, return error message, else returns null
|
|
4464
|
-
*/
|
|
4465
3369
|
validate(c) {
|
|
4466
3370
|
let controlName;
|
|
4467
3371
|
controlName = this.getControlName(c);
|
|
@@ -4483,23 +3387,20 @@ class RangeValidatorMagicDirective {
|
|
|
4483
3387
|
};
|
|
4484
3388
|
}
|
|
4485
3389
|
}
|
|
4486
|
-
/**
|
|
4487
|
-
* @ignore
|
|
4488
|
-
*/
|
|
4489
3390
|
getControlName(c) {
|
|
4490
3391
|
const formGroup = c.parent.controls;
|
|
4491
3392
|
return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
|
|
4492
3393
|
}
|
|
4493
3394
|
}
|
|
4494
|
-
|
|
4495
|
-
|
|
3395
|
+
RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ViewContainerRef)); };
|
|
3396
|
+
RangeValidatorMagicDirective.ɵdir = ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [ɵɵProvidersFeature([
|
|
4496
3397
|
{
|
|
4497
3398
|
provide: NG_VALIDATORS,
|
|
4498
3399
|
useExisting: RangeValidatorMagicDirective,
|
|
4499
3400
|
multi: true,
|
|
4500
3401
|
}
|
|
4501
3402
|
])] });
|
|
4502
|
-
|
|
3403
|
+
(function () { ɵsetClassMetadata(RangeValidatorMagicDirective, [{
|
|
4503
3404
|
type: Directive,
|
|
4504
3405
|
args: [{
|
|
4505
3406
|
selector: '[rangevalidator] ',
|
|
@@ -4519,48 +3420,29 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
4519
3420
|
const ctx_r0 = ɵɵnextContext();
|
|
4520
3421
|
ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
|
4521
3422
|
} }
|
|
4522
|
-
/**
|
|
4523
|
-
* Represents a Magic subform
|
|
4524
|
-
*/
|
|
4525
3423
|
class SubformMagicComponent {
|
|
4526
|
-
/**
|
|
4527
|
-
* @ignore
|
|
4528
|
-
*/
|
|
4529
3424
|
constructor(vcRef, mgSub) {
|
|
4530
3425
|
this.vcRef = vcRef;
|
|
4531
3426
|
this.mgSub = mgSub;
|
|
4532
|
-
/**
|
|
4533
|
-
* @ignore
|
|
4534
|
-
*/
|
|
4535
3427
|
this.component = null;
|
|
4536
|
-
// For angular 10 - find the component from views
|
|
4537
3428
|
this.component = (this.vcRef._hostView).find(v => !isNullOrUndefined(v));
|
|
4538
3429
|
}
|
|
4539
|
-
/**
|
|
4540
|
-
* @ignore
|
|
4541
|
-
*/
|
|
4542
3430
|
set magic(val) { this.id = val; }
|
|
4543
3431
|
;
|
|
4544
|
-
/**
|
|
4545
|
-
* @ignore
|
|
4546
|
-
*/
|
|
4547
3432
|
get Component() {
|
|
4548
3433
|
return this.mgSub.mgGetComp(this.id);
|
|
4549
3434
|
}
|
|
4550
|
-
/**
|
|
4551
|
-
* @ignore
|
|
4552
|
-
*/
|
|
4553
3435
|
get Parameters() {
|
|
4554
3436
|
return this.mgSub.mgGetParameters(this.id);
|
|
4555
3437
|
}
|
|
4556
3438
|
}
|
|
4557
|
-
|
|
4558
|
-
|
|
3439
|
+
SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(SubformMagicService)); };
|
|
3440
|
+
SubformMagicComponent.ɵcmp = ɵɵ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) {
|
|
4559
3441
|
ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
|
4560
3442
|
} if (rf & 2) {
|
|
4561
3443
|
ɵɵproperty("ngIf", ctx.Component);
|
|
4562
3444
|
} }, directives: [NgIf, DynamicComponent, DynamicIoDirective], encapsulation: 2 });
|
|
4563
|
-
|
|
3445
|
+
(function () { ɵsetClassMetadata(SubformMagicComponent, [{
|
|
4564
3446
|
type: Component,
|
|
4565
3447
|
args: [{
|
|
4566
3448
|
selector: 'magic-subform',
|
|
@@ -4600,24 +3482,14 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
4600
3482
|
ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
|
|
4601
3483
|
} }
|
|
4602
3484
|
const _c1$1 = ["*"];
|
|
4603
|
-
/**
|
|
4604
|
-
* Represents a Magic subform
|
|
4605
|
-
*/
|
|
4606
3485
|
class ErrorMagicComponent {
|
|
4607
|
-
/**
|
|
4608
|
-
* @ignore
|
|
4609
|
-
*/
|
|
4610
3486
|
constructor(_task, mgService, changeDetectorRef) {
|
|
4611
3487
|
this._task = _task;
|
|
4612
3488
|
this.mgService = mgService;
|
|
4613
3489
|
this.changeDetectorRef = changeDetectorRef;
|
|
4614
|
-
// if true - display standard magic error message, if false - customer has provides his own content and we'll use it
|
|
4615
3490
|
this.defaultDisplay = true;
|
|
4616
3491
|
this.rowId = "0";
|
|
4617
3492
|
}
|
|
4618
|
-
/**
|
|
4619
|
-
* @ignore
|
|
4620
|
-
*/
|
|
4621
3493
|
set magic(val) {
|
|
4622
3494
|
this.id = val;
|
|
4623
3495
|
}
|
|
@@ -4631,10 +3503,6 @@ class ErrorMagicComponent {
|
|
|
4631
3503
|
this.changeDetectorRef.detectChanges();
|
|
4632
3504
|
}
|
|
4633
3505
|
;
|
|
4634
|
-
/**
|
|
4635
|
-
* returns true if the html element has no children
|
|
4636
|
-
* @param element
|
|
4637
|
-
*/
|
|
4638
3506
|
isEmpty(element) {
|
|
4639
3507
|
const nodes = element.childNodes;
|
|
4640
3508
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -4645,9 +3513,6 @@ class ErrorMagicComponent {
|
|
|
4645
3513
|
}
|
|
4646
3514
|
return true;
|
|
4647
3515
|
}
|
|
4648
|
-
/**
|
|
4649
|
-
* @ignore
|
|
4650
|
-
*/
|
|
4651
3516
|
HasErrors(id) {
|
|
4652
3517
|
if (!isUndefined(id)) {
|
|
4653
3518
|
let control = this._task.getFormControl(this.rowId, id);
|
|
@@ -4669,8 +3534,8 @@ class ErrorMagicComponent {
|
|
|
4669
3534
|
return false;
|
|
4670
3535
|
}
|
|
4671
3536
|
}
|
|
4672
|
-
|
|
4673
|
-
|
|
3537
|
+
ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(AccessorMagicService), ɵɵdirectiveInject(ChangeDetectorRef)); };
|
|
3538
|
+
ErrorMagicComponent.ɵcmp = ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
|
4674
3539
|
ɵɵviewQuery(_c0$2, true);
|
|
4675
3540
|
} if (rf & 2) {
|
|
4676
3541
|
var _t;
|
|
@@ -4681,7 +3546,7 @@ class ErrorMagicComponent {
|
|
|
4681
3546
|
} if (rf & 2) {
|
|
4682
3547
|
ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
|
4683
3548
|
} }, directives: [NgIf], encapsulation: 2 });
|
|
4684
|
-
|
|
3549
|
+
(function () { ɵsetClassMetadata(ErrorMagicComponent, [{
|
|
4685
3550
|
type: Component,
|
|
4686
3551
|
args: [{
|
|
4687
3552
|
selector: 'mgError',
|
|
@@ -4706,28 +3571,19 @@ class ErrorMagicComponent {
|
|
|
4706
3571
|
args: ['customContent', { static: false }]
|
|
4707
3572
|
}] }); })();
|
|
4708
3573
|
|
|
4709
|
-
/**
|
|
4710
|
-
* Directive for checkboxes, to handle the 'change' event
|
|
4711
|
-
*/
|
|
4712
3574
|
class CheckboxMagicDirective {
|
|
4713
|
-
/**
|
|
4714
|
-
* @ignore
|
|
4715
|
-
*/
|
|
4716
3575
|
constructor(magicDirective) {
|
|
4717
3576
|
this.magicDirective = magicDirective;
|
|
4718
3577
|
}
|
|
4719
|
-
/**
|
|
4720
|
-
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
|
4721
|
-
*/
|
|
4722
3578
|
onChange($event) {
|
|
4723
3579
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
4724
3580
|
}
|
|
4725
3581
|
}
|
|
4726
|
-
|
|
4727
|
-
|
|
3582
|
+
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3583
|
+
CheckboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4728
3584
|
ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
4729
3585
|
} } });
|
|
4730
|
-
|
|
3586
|
+
(function () { ɵsetClassMetadata(CheckboxMagicDirective, [{
|
|
4731
3587
|
type: Directive,
|
|
4732
3588
|
args: [{
|
|
4733
3589
|
selector: `
|
|
@@ -4739,25 +3595,19 @@ class CheckboxMagicDirective {
|
|
|
4739
3595
|
args: ['change', ['$event']]
|
|
4740
3596
|
}] }); })();
|
|
4741
3597
|
|
|
4742
|
-
/**
|
|
4743
|
-
* Directive for comboboxes, to handle the 'change' event
|
|
4744
|
-
*/
|
|
4745
3598
|
class ComboboxMagicDirective {
|
|
4746
3599
|
constructor(magicDirective) {
|
|
4747
3600
|
this.magicDirective = magicDirective;
|
|
4748
3601
|
}
|
|
4749
|
-
/**
|
|
4750
|
-
* Handles the Combobox 'change' event - pass it to the Magic engine
|
|
4751
|
-
*/
|
|
4752
3602
|
onChange($event) {
|
|
4753
3603
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
4754
3604
|
}
|
|
4755
3605
|
}
|
|
4756
|
-
|
|
4757
|
-
|
|
3606
|
+
ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3607
|
+
ComboboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4758
3608
|
ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
4759
3609
|
} } });
|
|
4760
|
-
|
|
3610
|
+
(function () { ɵsetClassMetadata(ComboboxMagicDirective, [{
|
|
4761
3611
|
type: Directive,
|
|
4762
3612
|
args: [{
|
|
4763
3613
|
selector: `select[magic]:not([multiple])`,
|
|
@@ -4767,20 +3617,14 @@ class ComboboxMagicDirective {
|
|
|
4767
3617
|
args: ['change', ['$event']]
|
|
4768
3618
|
}] }); })();
|
|
4769
3619
|
|
|
4770
|
-
/**
|
|
4771
|
-
* This service supports custom actions on magic exit
|
|
4772
|
-
*/
|
|
4773
3620
|
class ExitMagicService {
|
|
4774
|
-
/**
|
|
4775
|
-
* Override this method to implement custom logic on magic exit
|
|
4776
|
-
*/
|
|
4777
3621
|
exitMagic() {
|
|
4778
3622
|
console.log("Magic application terminated");
|
|
4779
3623
|
}
|
|
4780
3624
|
}
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
3625
|
+
ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
|
|
3626
|
+
ExitMagicService.ɵprov = ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
|
3627
|
+
(function () { ɵsetClassMetadata(ExitMagicService, [{
|
|
4784
3628
|
type: Injectable
|
|
4785
3629
|
}], null, null); })();
|
|
4786
3630
|
|
|
@@ -4804,19 +3648,7 @@ function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
4804
3648
|
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
4805
3649
|
ɵɵelement(0, "div", 9);
|
|
4806
3650
|
} }
|
|
4807
|
-
/**
|
|
4808
|
-
* Root Magic component
|
|
4809
|
-
*/
|
|
4810
3651
|
class MagicShellComponent {
|
|
4811
|
-
/**
|
|
4812
|
-
*
|
|
4813
|
-
* @param magic Magic's service
|
|
4814
|
-
* @param componentList Magic component list
|
|
4815
|
-
* @param changeDetectorRef Changes detector
|
|
4816
|
-
* @param titleService Title setting service
|
|
4817
|
-
* @param httpClient The native httpClient instance
|
|
4818
|
-
* @param exitMagicService Magic exit service
|
|
4819
|
-
*/
|
|
4820
3652
|
constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
|
|
4821
3653
|
this.engineMagicService = engineMagicService;
|
|
4822
3654
|
this.componentList = componentList;
|
|
@@ -4826,32 +3658,22 @@ class MagicShellComponent {
|
|
|
4826
3658
|
this.httpClient = httpClient;
|
|
4827
3659
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
4828
3660
|
this.exitMagicService = exitMagicService;
|
|
4829
|
-
/**
|
|
4830
|
-
* Root component to be displayed in the window
|
|
4831
|
-
*/
|
|
4832
3661
|
this.RootComponent = null;
|
|
4833
3662
|
this.magicEngineTerminated = false;
|
|
4834
3663
|
this.initialize();
|
|
4835
3664
|
this.setTitle();
|
|
4836
3665
|
}
|
|
4837
|
-
/**
|
|
4838
|
-
* Before-unload event listener
|
|
4839
|
-
* @param event
|
|
4840
|
-
*/
|
|
4841
3666
|
onBeforeUnload(event) {
|
|
4842
3667
|
if (this.engineMagicService.TransCacheExists()) {
|
|
4843
|
-
// Show the confirmation box before unloading the browser
|
|
4844
3668
|
event.returnValue = 'Are you sure?';
|
|
4845
3669
|
return 'Are you sure?';
|
|
4846
3670
|
}
|
|
4847
3671
|
else {
|
|
4848
|
-
// terminate the magic server context using fetch API with keep-alive
|
|
4849
3672
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
4850
3673
|
this.magicEngineTerminated = true;
|
|
4851
3674
|
}
|
|
4852
3675
|
}
|
|
4853
3676
|
onUnload(event) {
|
|
4854
|
-
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
|
4855
3677
|
if (!this.magicEngineTerminated)
|
|
4856
3678
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
4857
3679
|
}
|
|
@@ -4862,26 +3684,13 @@ class MagicShellComponent {
|
|
|
4862
3684
|
setViewContainerRef(vcRef) {
|
|
4863
3685
|
this.overlayWindowsContainerViewRef = vcRef;
|
|
4864
3686
|
}
|
|
4865
|
-
/**
|
|
4866
|
-
* Initialization of Magic mechanisms
|
|
4867
|
-
*/
|
|
4868
3687
|
initialize() {
|
|
4869
3688
|
this.registerUICommands();
|
|
4870
3689
|
}
|
|
4871
|
-
/**
|
|
4872
|
-
* Set the title
|
|
4873
|
-
*/
|
|
4874
3690
|
setTitle() {
|
|
4875
3691
|
const newTitle = this.componentList.title;
|
|
4876
3692
|
this.titleService.setTitle(newTitle);
|
|
4877
3693
|
}
|
|
4878
|
-
/**
|
|
4879
|
-
* Set the component according to requested form
|
|
4880
|
-
* @param formName Name of the form to open
|
|
4881
|
-
* @param taskId Id of opening task
|
|
4882
|
-
* @param taskDescription TODO
|
|
4883
|
-
* @param isModal whether modal window is being opened
|
|
4884
|
-
*/
|
|
4885
3694
|
setComponent(formName, taskId, taskDescription, isModal) {
|
|
4886
3695
|
this.pendingCommandsCollector.startCollecting();
|
|
4887
3696
|
if (isModal) {
|
|
@@ -4893,9 +3702,6 @@ class MagicShellComponent {
|
|
|
4893
3702
|
}
|
|
4894
3703
|
this.changeDetectorRef.detectChanges();
|
|
4895
3704
|
}
|
|
4896
|
-
/**
|
|
4897
|
-
* @ignore
|
|
4898
|
-
*/
|
|
4899
3705
|
registerUICommands() {
|
|
4900
3706
|
this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
|
|
4901
3707
|
.subscribe(command => {
|
|
@@ -4907,10 +3713,6 @@ class MagicShellComponent {
|
|
|
4907
3713
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
|
|
4908
3714
|
});
|
|
4909
3715
|
}
|
|
4910
|
-
/**
|
|
4911
|
-
* Execute commands received from the Magic WebClient engine
|
|
4912
|
-
* @param command
|
|
4913
|
-
*/
|
|
4914
3716
|
executeCommand(command) {
|
|
4915
3717
|
switch (command.CommandType) {
|
|
4916
3718
|
case CommandType.OPEN_FORM:
|
|
@@ -4925,7 +3727,7 @@ class MagicShellComponent {
|
|
|
4925
3727
|
this.RootComponentParameters = {};
|
|
4926
3728
|
this.changeDetectorRef.detectChanges();
|
|
4927
3729
|
}
|
|
4928
|
-
else {
|
|
3730
|
+
else {
|
|
4929
3731
|
this.overlayWindowService.close(command.str);
|
|
4930
3732
|
this.changeDetectorRef.detectChanges();
|
|
4931
3733
|
}
|
|
@@ -4943,20 +3745,21 @@ class MagicShellComponent {
|
|
|
4943
3745
|
if (this.exitMagicService)
|
|
4944
3746
|
this.exitMagicService.exitMagic();
|
|
4945
3747
|
break;
|
|
3748
|
+
case CommandType.SHOW_HTML_ERROR:
|
|
3749
|
+
window.document.write(command.str);
|
|
3750
|
+
break;
|
|
4946
3751
|
}
|
|
4947
3752
|
}
|
|
4948
3753
|
}
|
|
4949
|
-
|
|
4950
|
-
|
|
3754
|
+
MagicShellComponent.ɵfac = function MagicShellComponent_Factory(t) { return new (t || MagicShellComponent)(ɵɵdirectiveInject(EngineMagicService), ɵɵdirectiveInject(ComponentListMagicService), ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(Title), ɵɵdirectiveInject(OverlayWindowService), ɵɵdirectiveInject(HttpClient), ɵɵdirectiveInject(CommandsCollectorMagicService), ɵɵdirectiveInject(ExitMagicService, 8)); };
|
|
3755
|
+
MagicShellComponent.ɵcmp = ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
|
4951
3756
|
ɵɵstaticViewQuery(_c0$3, true);
|
|
4952
3757
|
} if (rf & 2) {
|
|
4953
3758
|
var _t;
|
|
4954
3759
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
|
4955
3760
|
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4956
3761
|
ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, ɵɵresolveWindow);
|
|
4957
|
-
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [ɵɵProvidersFeature([
|
|
4958
|
-
// ExitMagicService
|
|
4959
|
-
])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
|
|
3762
|
+
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [ɵɵProvidersFeature([])], decls: 8, vars: 2, consts: [["magicRoot", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["overlayWindowsContainer", ""], ["class", "spinner-background", 4, "ngIf"], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
|
|
4960
3763
|
ɵɵelementStart(0, "div", null, 0);
|
|
4961
3764
|
ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
|
|
4962
3765
|
ɵɵelement(3, "div", 2, 3);
|
|
@@ -4969,13 +3772,11 @@ class MagicShellComponent {
|
|
|
4969
3772
|
ɵɵadvance(3);
|
|
4970
3773
|
ɵɵproperty("ngIf", ctx.showSpinner);
|
|
4971
3774
|
} }, directives: [NgIf, MagicViewContainerRef, DynamicComponent, DynamicIoDirective, NgTemplateOutlet], styles: [".mgSpinnerClass[_ngcontent-%COMP%] {\n border: 10px solid #cccccc; \n border-top: 10px solid black; \n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"] });
|
|
4972
|
-
|
|
3775
|
+
(function () { ɵsetClassMetadata(MagicShellComponent, [{
|
|
4973
3776
|
type: Component,
|
|
4974
3777
|
args: [{
|
|
4975
3778
|
selector: 'magic-root',
|
|
4976
|
-
providers: [
|
|
4977
|
-
// ExitMagicService
|
|
4978
|
-
],
|
|
3779
|
+
providers: [],
|
|
4979
3780
|
template: `
|
|
4980
3781
|
<div #magicRoot>
|
|
4981
3782
|
<ndc-dynamic
|
|
@@ -5042,25 +3843,19 @@ class MagicShellComponent {
|
|
|
5042
3843
|
args: ['window:unload', ['$event']]
|
|
5043
3844
|
}] }); })();
|
|
5044
3845
|
|
|
5045
|
-
/**
|
|
5046
|
-
* @ignore
|
|
5047
|
-
*/
|
|
5048
3846
|
const CHECKBOX_VALUE_ACCESSOR = {
|
|
5049
3847
|
provide: NG_VALUE_ACCESSOR,
|
|
5050
3848
|
useExisting: forwardRef(() => MagicCheckboxControlValueAccessor),
|
|
5051
3849
|
multi: true,
|
|
5052
3850
|
};
|
|
5053
|
-
/**
|
|
5054
|
-
* Value accessor for Checkbox without a FormControl
|
|
5055
|
-
*/
|
|
5056
3851
|
class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
|
5057
3852
|
}
|
|
5058
|
-
|
|
5059
|
-
|
|
3853
|
+
MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
|
|
3854
|
+
MagicCheckboxControlValueAccessor.ɵdir = ɵɵ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) {
|
|
5060
3855
|
ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5061
3856
|
} }, features: [ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
|
|
5062
|
-
const ɵMagicCheckboxControlValueAccessor_BaseFactory =
|
|
5063
|
-
|
|
3857
|
+
const ɵMagicCheckboxControlValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
|
|
3858
|
+
(function () { ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
|
5064
3859
|
type: Directive,
|
|
5065
3860
|
args: [{
|
|
5066
3861
|
selector: `
|
|
@@ -5073,25 +3868,19 @@ const ɵMagicCheckboxControlValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInh
|
|
|
5073
3868
|
}]
|
|
5074
3869
|
}], null, null); })();
|
|
5075
3870
|
|
|
5076
|
-
/**
|
|
5077
|
-
* @ignore
|
|
5078
|
-
*/
|
|
5079
3871
|
const MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
|
5080
3872
|
provide: NG_VALUE_ACCESSOR,
|
|
5081
3873
|
useExisting: forwardRef(() => MagicDefaultValueAccessor),
|
|
5082
3874
|
multi: true
|
|
5083
3875
|
};
|
|
5084
|
-
/**
|
|
5085
|
-
* @ignore
|
|
5086
|
-
*/
|
|
5087
3876
|
class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
5088
3877
|
}
|
|
5089
|
-
|
|
5090
|
-
|
|
3878
|
+
MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
|
|
3879
|
+
MagicDefaultValueAccessor.ɵdir = ɵɵ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) {
|
|
5091
3880
|
ɵɵ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); });
|
|
5092
3881
|
} }, exportAs: ["magic"], features: [ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
|
|
5093
|
-
const ɵMagicDefaultValueAccessor_BaseFactory =
|
|
5094
|
-
|
|
3882
|
+
const ɵMagicDefaultValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
|
|
3883
|
+
(function () { ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
|
5095
3884
|
type: Directive,
|
|
5096
3885
|
args: [{
|
|
5097
3886
|
selector: `
|
|
@@ -5109,25 +3898,19 @@ const ɵMagicDefaultValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFa
|
|
|
5109
3898
|
}]
|
|
5110
3899
|
}], null, null); })();
|
|
5111
3900
|
|
|
5112
|
-
/**
|
|
5113
|
-
* Directive for checkboxes which should not have a form control
|
|
5114
|
-
*/
|
|
5115
3901
|
class CheckboxNoFormControlMagicDirective {
|
|
5116
3902
|
constructor(magicDirective) {
|
|
5117
3903
|
this.magicDirective = magicDirective;
|
|
5118
3904
|
}
|
|
5119
|
-
/**
|
|
5120
|
-
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
|
5121
|
-
*/
|
|
5122
3905
|
onChange($event) {
|
|
5123
3906
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5124
3907
|
}
|
|
5125
3908
|
}
|
|
5126
|
-
|
|
5127
|
-
|
|
3909
|
+
CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3910
|
+
CheckboxNoFormControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5128
3911
|
ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5129
3912
|
} } });
|
|
5130
|
-
|
|
3913
|
+
(function () { ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
|
5131
3914
|
type: Directive,
|
|
5132
3915
|
args: [{
|
|
5133
3916
|
selector: `
|
|
@@ -5139,25 +3922,19 @@ class CheckboxNoFormControlMagicDirective {
|
|
|
5139
3922
|
args: ['change', ['$event']]
|
|
5140
3923
|
}] }); })();
|
|
5141
3924
|
|
|
5142
|
-
/**
|
|
5143
|
-
* Directive for non-checkbox input controls which do not have a form control
|
|
5144
|
-
*/
|
|
5145
3925
|
class InputNoFormControlMagicDirective {
|
|
5146
3926
|
constructor(magicDirective) {
|
|
5147
3927
|
this.magicDirective = magicDirective;
|
|
5148
3928
|
}
|
|
5149
|
-
/**
|
|
5150
|
-
* Handles the 'change' event - pass it to the Magic engine
|
|
5151
|
-
*/
|
|
5152
3929
|
onChange($event) {
|
|
5153
3930
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
|
5154
3931
|
}
|
|
5155
3932
|
}
|
|
5156
|
-
|
|
5157
|
-
|
|
3933
|
+
InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3934
|
+
InputNoFormControlMagicDirective.ɵdir = ɵɵ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) {
|
|
5158
3935
|
ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5159
3936
|
} } });
|
|
5160
|
-
|
|
3937
|
+
(function () { ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
|
5161
3938
|
type: Directive,
|
|
5162
3939
|
args: [{
|
|
5163
3940
|
selector: `input[magic]:([noFormControl]):not([type=checkbox]),
|
|
@@ -5173,14 +3950,6 @@ const DATE_VALUE_ACCESSOR = {
|
|
|
5173
3950
|
useExisting: forwardRef(() => DateValueAccessor),
|
|
5174
3951
|
multi: true
|
|
5175
3952
|
};
|
|
5176
|
-
/**
|
|
5177
|
-
* The accessor for writing a value and listening to changes on a date input element
|
|
5178
|
-
*
|
|
5179
|
-
* ### Example
|
|
5180
|
-
* `<input type="date" name="birthday" ngModel dateInput>`
|
|
5181
|
-
* OR
|
|
5182
|
-
* `<input type="date" formControlName="birthday" dateInput>`
|
|
5183
|
-
*/
|
|
5184
3953
|
class DateValueAccessor {
|
|
5185
3954
|
constructor(renderer, elementRef) {
|
|
5186
3955
|
this.renderer = renderer;
|
|
@@ -5188,7 +3957,6 @@ class DateValueAccessor {
|
|
|
5188
3957
|
this.onChange = (_) => { };
|
|
5189
3958
|
this.onTouched = () => { };
|
|
5190
3959
|
}
|
|
5191
|
-
/** Writes a new value to the element (model -> view) */
|
|
5192
3960
|
writeValue(value) {
|
|
5193
3961
|
if (!value) {
|
|
5194
3962
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
|
@@ -5196,26 +3964,23 @@ class DateValueAccessor {
|
|
|
5196
3964
|
}
|
|
5197
3965
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
|
5198
3966
|
}
|
|
5199
|
-
/** Registers a callback function, called when value changes (view -> model) */
|
|
5200
3967
|
registerOnChange(fn) {
|
|
5201
3968
|
this.onChange = v => fn(v instanceof Date
|
|
5202
3969
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
|
5203
3970
|
: v);
|
|
5204
3971
|
}
|
|
5205
|
-
/** Registers a callback function, called when the control is blurred */
|
|
5206
3972
|
registerOnTouched(fn) {
|
|
5207
3973
|
this.onTouched = fn;
|
|
5208
3974
|
}
|
|
5209
|
-
/** Enables or disables the element when the control status changes */
|
|
5210
3975
|
setDisabledState(isDisabled) {
|
|
5211
3976
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
|
5212
3977
|
}
|
|
5213
3978
|
}
|
|
5214
|
-
|
|
5215
|
-
|
|
3979
|
+
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ElementRef)); };
|
|
3980
|
+
DateValueAccessor.ɵdir = ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5216
3981
|
ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5217
3982
|
} }, features: [ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
|
5218
|
-
|
|
3983
|
+
(function () { ɵsetClassMetadata(DateValueAccessor, [{
|
|
5219
3984
|
type: Directive,
|
|
5220
3985
|
args: [{
|
|
5221
3986
|
selector: "[dateInput]",
|
|
@@ -5229,25 +3994,12 @@ class DateValueAccessor {
|
|
|
5229
3994
|
args: ["blur", []]
|
|
5230
3995
|
}] }); })();
|
|
5231
3996
|
|
|
5232
|
-
/**
|
|
5233
|
-
* 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
|
|
5234
|
-
*/
|
|
5235
3997
|
class NonMagicControlDirective {
|
|
5236
|
-
/**
|
|
5237
|
-
*
|
|
5238
|
-
* @param _task The task service
|
|
5239
|
-
* @param element The element for which the directive is applied
|
|
5240
|
-
* @param renderer Renderer for the element
|
|
5241
|
-
* @param vcRef
|
|
5242
|
-
*/
|
|
5243
3998
|
constructor(_task, element, renderer, vcRef) {
|
|
5244
3999
|
this._task = _task;
|
|
5245
4000
|
this.element = element;
|
|
5246
4001
|
this.renderer = renderer;
|
|
5247
4002
|
this.vcRef = vcRef;
|
|
5248
|
-
/**
|
|
5249
|
-
* Collection of event handlers for this element
|
|
5250
|
-
*/
|
|
5251
4003
|
this.eventHandlers = {};
|
|
5252
4004
|
this.eventsOnlyVal = false;
|
|
5253
4005
|
this.htmlElement = this.element.nativeElement;
|
|
@@ -5257,40 +4009,26 @@ class NonMagicControlDirective {
|
|
|
5257
4009
|
this.selector = 'NonMagicControl';
|
|
5258
4010
|
}
|
|
5259
4011
|
;
|
|
5260
|
-
/**
|
|
5261
|
-
* Get the task service
|
|
5262
|
-
* @returns
|
|
5263
|
-
*/
|
|
5264
4012
|
get task() {
|
|
5265
4013
|
return this._task;
|
|
5266
4014
|
}
|
|
5267
|
-
/**
|
|
5268
|
-
* Register to the events this element may need to handle
|
|
5269
|
-
*/
|
|
5270
4015
|
regEvents() {
|
|
5271
|
-
// Handle events for which event handler may be removed and restored
|
|
5272
4016
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
5273
4017
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
5274
4018
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
5275
4019
|
});
|
|
5276
4020
|
}
|
|
5277
|
-
/**
|
|
5278
|
-
* Handle focus event
|
|
5279
|
-
*/
|
|
5280
4021
|
OnFocus() {
|
|
5281
4022
|
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', "", -1));
|
|
5282
4023
|
event.cancelBubble = true;
|
|
5283
4024
|
}
|
|
5284
|
-
/**
|
|
5285
|
-
* Initialize this object
|
|
5286
|
-
*/
|
|
5287
4025
|
ngOnInit() {
|
|
5288
4026
|
this.regEvents();
|
|
5289
4027
|
}
|
|
5290
4028
|
}
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
4029
|
+
NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef)); };
|
|
4030
|
+
NonMagicControlDirective.ɵdir = ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
|
|
4031
|
+
(function () { ɵsetClassMetadata(NonMagicControlDirective, [{
|
|
5294
4032
|
type: Directive,
|
|
5295
4033
|
args: [{
|
|
5296
4034
|
selector: '[NonMagicControl]'
|
|
@@ -5300,9 +4038,6 @@ class NonMagicControlDirective {
|
|
|
5300
4038
|
args: ['NonMagicControl']
|
|
5301
4039
|
}] }); })();
|
|
5302
4040
|
|
|
5303
|
-
/**
|
|
5304
|
-
* @ignore
|
|
5305
|
-
*/
|
|
5306
4041
|
const decs = [
|
|
5307
4042
|
MagicDirective,
|
|
5308
4043
|
CheckboxMagicDirective,
|
|
@@ -5333,9 +4068,6 @@ const decs = [
|
|
|
5333
4068
|
MagicFocusDirective,
|
|
5334
4069
|
MagicViewContainerRef
|
|
5335
4070
|
];
|
|
5336
|
-
/**
|
|
5337
|
-
* @ignore
|
|
5338
|
-
*/
|
|
5339
4071
|
class MagicModule {
|
|
5340
4072
|
static forRoot() {
|
|
5341
4073
|
return {
|
|
@@ -5350,12 +4082,11 @@ class MagicModule {
|
|
|
5350
4082
|
};
|
|
5351
4083
|
}
|
|
5352
4084
|
}
|
|
5353
|
-
|
|
5354
|
-
|
|
4085
|
+
MagicModule.ɵmod = ɵɵdefineNgModule({ type: MagicModule });
|
|
4086
|
+
MagicModule.ɵinj = ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
|
|
5355
4087
|
CommonModule,
|
|
5356
4088
|
FormsModule,
|
|
5357
4089
|
ReactiveFormsModule,
|
|
5358
|
-
//ThemeModule,
|
|
5359
4090
|
RouterModule,
|
|
5360
4091
|
DynamicModule,
|
|
5361
4092
|
HttpClientModule
|
|
@@ -5390,7 +4121,6 @@ class MagicModule {
|
|
|
5390
4121
|
MagicViewContainerRef], imports: [CommonModule,
|
|
5391
4122
|
FormsModule,
|
|
5392
4123
|
ReactiveFormsModule,
|
|
5393
|
-
//ThemeModule,
|
|
5394
4124
|
RouterModule,
|
|
5395
4125
|
DynamicModule,
|
|
5396
4126
|
HttpClientModule], exports: [MagicDirective,
|
|
@@ -5421,7 +4151,7 @@ class MagicModule {
|
|
|
5421
4151
|
NonMagicControlDirective,
|
|
5422
4152
|
MagicFocusDirective,
|
|
5423
4153
|
MagicViewContainerRef] }); })();
|
|
5424
|
-
|
|
4154
|
+
(function () { ɵsetClassMetadata(MagicModule, [{
|
|
5425
4155
|
type: NgModule,
|
|
5426
4156
|
args: [{
|
|
5427
4157
|
declarations: [...decs],
|
|
@@ -5431,12 +4161,10 @@ class MagicModule {
|
|
|
5431
4161
|
CommonModule,
|
|
5432
4162
|
FormsModule,
|
|
5433
4163
|
ReactiveFormsModule,
|
|
5434
|
-
//ThemeModule,
|
|
5435
4164
|
RouterModule,
|
|
5436
4165
|
DynamicModule,
|
|
5437
4166
|
HttpClientModule
|
|
5438
4167
|
],
|
|
5439
|
-
//Customizable providers
|
|
5440
4168
|
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
|
|
5441
4169
|
}]
|
|
5442
4170
|
}], null, null); })();
|
|
@@ -5524,7 +4252,7 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
5524
4252
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
5525
4253
|
if (displayFormat === 'input') {
|
|
5526
4254
|
if (this.mgdtfmt == null)
|
|
5527
|
-
this.mgdtfmt = 'M/d/yyyy';
|
|
4255
|
+
this.mgdtfmt = 'M/d/yyyy';
|
|
5528
4256
|
return formatDate(date, this.mgdtfmt, this.locale);
|
|
5529
4257
|
}
|
|
5530
4258
|
else {
|
|
@@ -5532,9 +4260,9 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
5532
4260
|
}
|
|
5533
4261
|
}
|
|
5534
4262
|
}
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
4263
|
+
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(ɵɵinject(Platform), ɵɵinject(TaskMagicService)); };
|
|
4264
|
+
MgDateAdapter.ɵprov = ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
4265
|
+
(function () { ɵsetClassMetadata(MgDateAdapter, [{
|
|
5538
4266
|
type: Injectable
|
|
5539
4267
|
}], function () { return [{ type: Platform }, { type: TaskMagicService }]; }, null); })();
|
|
5540
4268
|
|
|
@@ -5542,9 +4270,6 @@ const matDateProviders = [
|
|
|
5542
4270
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
|
5543
4271
|
{ provide: MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
|
5544
4272
|
];
|
|
5545
|
-
/**
|
|
5546
|
-
* Magic service providers
|
|
5547
|
-
*/
|
|
5548
4273
|
const basicMagicProviders = [
|
|
5549
4274
|
MagicServices,
|
|
5550
4275
|
TaskMagicService,
|
|
@@ -5558,18 +4283,7 @@ const magicProviders = [
|
|
|
5558
4283
|
TableMagicService
|
|
5559
4284
|
];
|
|
5560
4285
|
|
|
5561
|
-
/**
|
|
5562
|
-
* @ignore
|
|
5563
|
-
*/
|
|
5564
|
-
///////////////////////////////////////////////////////////
|
|
5565
|
-
// class to hold gui-related helper methods
|
|
5566
|
-
///////////////////////////////////////////////////////////
|
|
5567
4286
|
class utils {
|
|
5568
|
-
///////////////////////////////////////////////////////////
|
|
5569
|
-
// Add magic child control to the supplied array.
|
|
5570
|
-
// Recursive, and checks children even if they are not magic controls.
|
|
5571
|
-
// Magic controls are controls which have a magic directive attached to them.
|
|
5572
|
-
///////////////////////////////////////////////////////////
|
|
5573
4287
|
static addChildren(parent, children, selector) {
|
|
5574
4288
|
for (var i = 0; i < parent.children.length; i++) {
|
|
5575
4289
|
if (typeof parent.children[i].attributes[selector] !== "undefined") {
|
|
@@ -5578,9 +4292,6 @@ class utils {
|
|
|
5578
4292
|
this.addChildren(parent.children[i], children, selector);
|
|
5579
4293
|
}
|
|
5580
4294
|
}
|
|
5581
|
-
///////////////////////////////////////////////////////////
|
|
5582
|
-
// Calculate the distance between the control and the supplied x,y coordinates
|
|
5583
|
-
///////////////////////////////////////////////////////////
|
|
5584
4295
|
static getDistance(control, x, y) {
|
|
5585
4296
|
let left = control.clientLeft, top = control.clientTop;
|
|
5586
4297
|
let dx, dy;
|
|
@@ -5607,9 +4318,6 @@ class utils {
|
|
|
5607
4318
|
const ret = (dx * dx + dy * dy);
|
|
5608
4319
|
return ret;
|
|
5609
4320
|
}
|
|
5610
|
-
///////////////////////////////////////////////////////////
|
|
5611
|
-
//
|
|
5612
|
-
///////////////////////////////////////////////////////////
|
|
5613
4321
|
static getDimentions(el) {
|
|
5614
4322
|
let xPos = 0;
|
|
5615
4323
|
let yPos = 0;
|
|
@@ -5617,14 +4325,12 @@ class utils {
|
|
|
5617
4325
|
let height = el.height;
|
|
5618
4326
|
while (el) {
|
|
5619
4327
|
if (el.tagName == "BODY") {
|
|
5620
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
5621
4328
|
let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
5622
4329
|
let yScroll = el.scrollTop || document.documentElement.scrollTop;
|
|
5623
4330
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
|
5624
4331
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
|
5625
4332
|
}
|
|
5626
4333
|
else {
|
|
5627
|
-
// for all other non-BODY elements
|
|
5628
4334
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
|
5629
4335
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
|
5630
4336
|
}
|
|
@@ -5639,9 +4345,6 @@ class utils {
|
|
|
5639
4345
|
}
|
|
5640
4346
|
}
|
|
5641
4347
|
|
|
5642
|
-
/**
|
|
5643
|
-
* @ignore
|
|
5644
|
-
*/
|
|
5645
4348
|
class ModalFormDefinition {
|
|
5646
4349
|
constructor() {
|
|
5647
4350
|
this.taskId = "";
|
|
@@ -5650,9 +4353,5 @@ class ModalFormDefinition {
|
|
|
5650
4353
|
}
|
|
5651
4354
|
}
|
|
5652
4355
|
|
|
5653
|
-
/**
|
|
5654
|
-
* Generated bundle index. Do not edit.
|
|
5655
|
-
*/
|
|
5656
|
-
|
|
5657
4356
|
export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_DEFAULT_VALUE_ACCESSOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, 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, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
|
5658
4357
|
//# sourceMappingURL=magic-xpa-angular.js.map
|