@magic-xpa/angular 4.800.0-dev480.17 → 4.800.0-dev480.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/magic-xpa-angular.umd.js +232 -1520
- package/bundles/magic-xpa-angular.umd.js.map +1 -1
- package/bundles/magic-xpa-angular.umd.min.js +2 -2
- package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
- package/esm2015/index.js +1 -1
- package/esm2015/magic-xpa-angular.js +1 -4
- package/esm2015/src/controls.metadata.model.js +3 -36
- package/esm2015/src/interfaces/sub-form-definition.iterface.js +1 -1
- package/esm2015/src/magic.core.module.js +4 -14
- package/esm2015/src/services/ISubformMagicService.js +1 -1
- package/esm2015/src/services/OverlayWindowService.js +4 -29
- package/esm2015/src/services/StylesMapManager.js +1 -4
- package/esm2015/src/services/accessor.magic.service.js +41 -249
- package/esm2015/src/services/commands-collector.magic.service.js +4 -7
- package/esm2015/src/services/component-list.magic.service.js +1 -25
- package/esm2015/src/services/confirmation.components.magic.provider.js +4 -24
- package/esm2015/src/services/engine.magic.service.js +7 -10
- package/esm2015/src/services/exit.magic.service.js +4 -10
- package/esm2015/src/services/magic.providers.js +1 -4
- package/esm2015/src/services/magic.services.js +4 -10
- package/esm2015/src/services/mg-date-adapter.js +5 -5
- package/esm2015/src/services/overlay.conainer.magic.provider.js +4 -8
- package/esm2015/src/services/router-commands.magic.service.js +4 -10
- package/esm2015/src/services/subform.magic.service.js +37 -56
- package/esm2015/src/services/table.magic.service.js +5 -61
- package/esm2015/src/services/task.magics.service.js +13 -281
- package/esm2015/src/services/title.magic.service.js +4 -15
- package/esm2015/src/ui/GuiInteractiveExecutor.js +1 -6
- package/esm2015/src/ui/components/base-magic-alert.component.js +4 -14
- package/esm2015/src/ui/components/base-magic-confirm.component.js +4 -16
- package/esm2015/src/ui/components/magic-alert.component.js +5 -8
- package/esm2015/src/ui/components/magic-confirmation-box.component.js +5 -8
- package/esm2015/src/ui/directives/NonMagicControlDirective.js +4 -31
- package/esm2015/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/checkbox.magic.directive.js +4 -13
- package/esm2015/src/ui/directives/magic/combobox.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.js +4 -16
- package/esm2015/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.js +5 -11
- package/esm2015/src/ui/directives/magic/input.noformcontrol.magic.directive.js +4 -10
- package/esm2015/src/ui/directives/magic/nocontrol.magic.directive.js +6 -16
- package/esm2015/src/ui/directives/magic/row.magic.directive.js +4 -22
- package/esm2015/src/ui/directives/magic-focus.directive.js +4 -7
- package/esm2015/src/ui/directives/magic.directive.js +8 -81
- package/esm2015/src/ui/directives/magicViewContainerRef.directive.js +4 -8
- package/esm2015/src/ui/directives/mgformat.magic.directive.js +4 -57
- package/esm2015/src/ui/directives/range-validator.magic.directive.js +4 -20
- package/esm2015/src/ui/magic-confirmationBox.js +1 -25
- package/esm2015/src/ui/magic-modal/base-magic-overlay-container.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-modal-form.js +1 -4
- package/esm2015/src/ui/magic-modal/magic-modal-interface.js +1 -1
- package/esm2015/src/ui/magic-modal/magic-overlay-container-wrapper.js +4 -21
- package/esm2015/src/ui/magic-modal/magic-overlay-container.js +4 -46
- package/esm2015/src/ui/magic-root.component.js +10 -53
- package/esm2015/src/ui/mgerror.magic.component.js +4 -21
- package/esm2015/src/ui/pipes/date.magic.pipe.js +5 -12
- package/esm2015/src/ui/pipes/time.magic.pipe.js +4 -7
- package/esm2015/src/ui/router-container.magic.component.js +4 -32
- package/esm2015/src/ui/subform.magic.component.js +4 -23
- package/esm2015/src/ui/task-base.magic.component.js +4 -74
- package/esm2015/src/ui/utils.js +1 -20
- package/fesm2015/magic-xpa-angular.js +232 -1524
- package/fesm2015/magic-xpa-angular.js.map +1 -1
- package/magic-xpa-angular.d.ts +0 -3
- package/package.json +3 -3
- package/src/controls.metadata.model.d.ts +0 -16
- package/src/interfaces/sub-form-definition.iterface.d.ts +0 -6
- package/src/magic.core.module.d.ts +0 -3
- package/src/services/OverlayWindowService.d.ts +0 -19
- package/src/services/StylesMapManager.d.ts +0 -3
- package/src/services/accessor.magic.service.d.ts +15 -208
- package/src/services/commands-collector.magic.service.d.ts +0 -3
- package/src/services/component-list.magic.service.d.ts +0 -27
- package/src/services/confirmation.components.magic.provider.d.ts +0 -16
- package/src/services/engine.magic.service.d.ts +1 -3
- package/src/services/exit.magic.service.d.ts +0 -6
- package/src/services/magic.providers.d.ts +0 -3
- package/src/services/magic.services.d.ts +0 -6
- package/src/services/router-commands.magic.service.d.ts +0 -6
- package/src/services/subform.magic.service.d.ts +5 -30
- package/src/services/table.magic.service.d.ts +0 -55
- package/src/services/task.magics.service.d.ts +1 -294
- package/src/services/title.magic.service.d.ts +0 -11
- package/src/ui/GuiInteractiveExecutor.d.ts +0 -3
- package/src/ui/components/base-magic-alert.component.d.ts +0 -16
- package/src/ui/components/base-magic-confirm.component.d.ts +0 -18
- package/src/ui/components/magic-alert.component.d.ts +0 -3
- package/src/ui/components/magic-confirmation-box.component.d.ts +0 -3
- package/src/ui/directives/NonMagicControlDirective.d.ts +0 -41
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +0 -9
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +0 -12
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +0 -6
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +0 -6
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +0 -3
- package/src/ui/directives/magic/row.magic.directive.d.ts +0 -15
- package/src/ui/directives/magic-focus.directive.d.ts +0 -3
- package/src/ui/directives/magic.directive.d.ts +0 -78
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +0 -3
- package/src/ui/directives/mgformat.magic.directive.d.ts +0 -40
- package/src/ui/directives/range-validator.magic.directive.d.ts +0 -16
- package/src/ui/magic-confirmationBox.d.ts +0 -19
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +0 -9
- package/src/ui/magic-modal/magic-modal-form.d.ts +0 -3
- package/src/ui/magic-modal/magic-modal-interface.d.ts +0 -27
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +0 -20
- package/src/ui/magic-modal/magic-overlay-container.d.ts +0 -51
- package/src/ui/magic-root.component.d.ts +0 -42
- package/src/ui/mgerror.magic.component.d.ts +0 -19
- package/src/ui/pipes/date.magic.pipe.d.ts +0 -6
- package/src/ui/pipes/time.magic.pipe.d.ts +0 -3
- package/src/ui/router-container.magic.component.d.ts +0 -19
- package/src/ui/subform.magic.component.d.ts +0 -21
- package/src/ui/task-base.magic.component.d.ts +0 -72
- package/src/ui/utils.d.ts +0 -3
|
@@ -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,41 @@ 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
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
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
|
+
this.subformsDict[subformControlName] = {
|
|
1931
|
+
formName,
|
|
1932
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
1933
|
+
};
|
|
1934
|
+
this.task.refreshView();
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
else {
|
|
1939
|
+
this.subformsDict[subformControlName] = {
|
|
1940
|
+
formName,
|
|
1941
|
+
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
|
1942
|
+
};
|
|
1943
|
+
refreshNeeded = true;
|
|
1944
|
+
}
|
|
2456
1945
|
}
|
|
2457
|
-
else {
|
|
1946
|
+
else {
|
|
2458
1947
|
if (inDefaultOutlet)
|
|
2459
1948
|
subformControlName = "primary";
|
|
2460
1949
|
let routeParams = new List();
|
|
@@ -2469,10 +1958,6 @@ class SubformMagicService {
|
|
|
2469
1958
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
|
2470
1959
|
routeParams: routeParams
|
|
2471
1960
|
};
|
|
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
1961
|
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
|
2477
1962
|
this.ExecuteRouteCommand(routeCommand);
|
|
2478
1963
|
else
|
|
@@ -2481,16 +1966,11 @@ class SubformMagicService {
|
|
|
2481
1966
|
if (refreshNeeded)
|
|
2482
1967
|
this.task.refreshView();
|
|
2483
1968
|
}
|
|
2484
|
-
/**
|
|
2485
|
-
* Open the subform using a route command
|
|
2486
|
-
*/
|
|
2487
1969
|
ExecuteRouteCommand(routeCommand) {
|
|
2488
1970
|
let reusingComponent = false;
|
|
2489
1971
|
let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
|
2490
1972
|
let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
|
2491
1973
|
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
1974
|
currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
|
|
2495
1975
|
.then((result) => {
|
|
2496
1976
|
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
|
@@ -2530,12 +2010,7 @@ class SubformMagicService {
|
|
|
2530
2010
|
}
|
|
2531
2011
|
});
|
|
2532
2012
|
}
|
|
2533
|
-
/**
|
|
2534
|
-
* @ignore
|
|
2535
|
-
*/
|
|
2536
2013
|
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
2014
|
const pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
|
2540
2015
|
if (pendingCommands.length > 0) {
|
|
2541
2016
|
pendingCommands.forEach(command => { this.task.executeCommand(command); });
|
|
@@ -2543,15 +2018,9 @@ class SubformMagicService {
|
|
|
2543
2018
|
}
|
|
2544
2019
|
this.pendingCommandsCollector.stopCollecting();
|
|
2545
2020
|
}
|
|
2546
|
-
/**
|
|
2547
|
-
* @ignore
|
|
2548
|
-
*/
|
|
2549
2021
|
refreshView() {
|
|
2550
2022
|
this.task.refreshView();
|
|
2551
2023
|
}
|
|
2552
|
-
///
|
|
2553
|
-
// return the relative route
|
|
2554
|
-
//
|
|
2555
2024
|
static getRelativeRoute(sendActivatedRoute) {
|
|
2556
2025
|
let currentActiveRoute = sendActivatedRoute;
|
|
2557
2026
|
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
|
@@ -2564,70 +2033,37 @@ class SubformMagicService {
|
|
|
2564
2033
|
}
|
|
2565
2034
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
|
2566
2035
|
SubformMagicService.routerContainers = new Array();
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2036
|
+
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)); };
|
|
2037
|
+
SubformMagicService.ɵprov = ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
|
2038
|
+
(function () { ɵsetClassMetadata(SubformMagicService, [{
|
|
2570
2039
|
type: Injectable
|
|
2571
|
-
}], function () { return [{ type: TaskMagicService }, { type: ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: Router }, { type: RouterCommandsMagicService }]; }, null); })();
|
|
2040
|
+
}], function () { return [{ type: TaskMagicService }, { type: ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: NgModuleFactoryLoader }, { type: Injector }]; }, null); })();
|
|
2572
2041
|
|
|
2573
|
-
/**
|
|
2574
|
-
* Implements various table-related functionalities
|
|
2575
|
-
*/
|
|
2576
2042
|
class TableMagicService {
|
|
2577
|
-
/**
|
|
2578
|
-
*
|
|
2579
|
-
* @param componentList Component-mapping service
|
|
2580
|
-
* @param task Magic task service
|
|
2581
|
-
*/
|
|
2582
2043
|
constructor(componentList, task) {
|
|
2583
2044
|
this.componentList = componentList;
|
|
2584
2045
|
this.task = task;
|
|
2585
2046
|
this.shouldOpenFieldTextEditor = true;
|
|
2586
2047
|
}
|
|
2587
|
-
/**
|
|
2588
|
-
* Refreshes the DataSource
|
|
2589
|
-
*/
|
|
2590
2048
|
refreshDataSource() {
|
|
2591
2049
|
}
|
|
2592
|
-
/**
|
|
2593
|
-
* Returns the table page size
|
|
2594
|
-
*/
|
|
2595
2050
|
getPageSize() {
|
|
2596
2051
|
return 10;
|
|
2597
2052
|
}
|
|
2598
|
-
/**
|
|
2599
|
-
* Returns max no of rows in the table.
|
|
2600
|
-
*/
|
|
2601
2053
|
getMaxRowsInTable() {
|
|
2602
2054
|
return this.task.Records.list.length;
|
|
2603
2055
|
}
|
|
2604
|
-
/**
|
|
2605
|
-
* Selects the specified row
|
|
2606
|
-
* @param rowId The row to select
|
|
2607
|
-
*/
|
|
2608
2056
|
selectRow(rowId) {
|
|
2609
2057
|
this.selectedItem = rowId;
|
|
2610
2058
|
}
|
|
2611
2059
|
getSelectedRow() {
|
|
2612
2060
|
return this.selectedItem;
|
|
2613
2061
|
}
|
|
2614
|
-
/**
|
|
2615
|
-
* Returns the selected row
|
|
2616
|
-
*/
|
|
2617
2062
|
selectedRow() {
|
|
2618
2063
|
return null;
|
|
2619
2064
|
}
|
|
2620
|
-
/**
|
|
2621
|
-
* Selects the specified page
|
|
2622
|
-
* @param pageId The page to select
|
|
2623
|
-
*/
|
|
2624
2065
|
selectPage(pageId) {
|
|
2625
2066
|
}
|
|
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
2067
|
OpenDialogForControl(element) {
|
|
2632
2068
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
|
2633
2069
|
element.tagName === "INPUT" ||
|
|
@@ -2635,34 +2071,17 @@ class TableMagicService {
|
|
|
2635
2071
|
return false;
|
|
2636
2072
|
return true;
|
|
2637
2073
|
}
|
|
2638
|
-
/**
|
|
2639
|
-
* Returns the dialog used to edit values
|
|
2640
|
-
*/
|
|
2641
2074
|
getDialog() {
|
|
2642
2075
|
return null;
|
|
2643
2076
|
}
|
|
2644
|
-
/**
|
|
2645
|
-
* Handles the table "scrolled" event
|
|
2646
|
-
*/
|
|
2647
2077
|
onScrollDown() {
|
|
2648
2078
|
this.task.onScrollDown();
|
|
2649
2079
|
}
|
|
2650
|
-
/**
|
|
2651
|
-
* To be overwitten in specific implelemtations
|
|
2652
|
-
*/
|
|
2653
2080
|
sortData(e) { }
|
|
2654
|
-
/**
|
|
2655
|
-
* To be overwitten in specific implelemtations
|
|
2656
|
-
*/
|
|
2657
2081
|
mgOnPaginateChange(e) { }
|
|
2658
2082
|
mgOptionChanged(e) { }
|
|
2659
|
-
/**
|
|
2660
|
-
* Change the number of lines in a table
|
|
2661
|
-
* @param size New number of lines in table
|
|
2662
|
-
*/
|
|
2663
2083
|
updateTableSize(size) {
|
|
2664
|
-
if (size === 0)
|
|
2665
|
-
{
|
|
2084
|
+
if (size === 0) {
|
|
2666
2085
|
size = 1;
|
|
2667
2086
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
|
2668
2087
|
}
|
|
@@ -2670,17 +2089,11 @@ class TableMagicService {
|
|
|
2670
2089
|
this.task.Records.updateSize(size);
|
|
2671
2090
|
this.task.setIncludesFirst(false);
|
|
2672
2091
|
}
|
|
2673
|
-
/**
|
|
2674
|
-
* @ignore
|
|
2675
|
-
*/
|
|
2676
2092
|
setTableTopIndex(value) {
|
|
2677
2093
|
if (!this.task.Records.includesFirst)
|
|
2678
2094
|
value++;
|
|
2679
2095
|
this.task.Records.setGuiTopIndex(value);
|
|
2680
2096
|
}
|
|
2681
|
-
/**
|
|
2682
|
-
* @ignore
|
|
2683
|
-
*/
|
|
2684
2097
|
getTableTopIndex() {
|
|
2685
2098
|
let topIndex = this.task.Records.getGuiTopIndex();
|
|
2686
2099
|
if (!this.task.Records.includesFirst)
|
|
@@ -2688,55 +2101,32 @@ class TableMagicService {
|
|
|
2688
2101
|
return topIndex;
|
|
2689
2102
|
}
|
|
2690
2103
|
}
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2104
|
+
TableMagicService.ɵfac = function TableMagicService_Factory(t) { return new (t || TableMagicService)(ɵɵinject(ComponentListMagicService), ɵɵinject(TaskMagicService)); };
|
|
2105
|
+
TableMagicService.ɵprov = ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
|
2106
|
+
(function () { ɵsetClassMetadata(TableMagicService, [{
|
|
2694
2107
|
type: Injectable
|
|
2695
2108
|
}], function () { return [{ type: ComponentListMagicService }, { type: TaskMagicService }]; }, null); })();
|
|
2696
2109
|
|
|
2697
|
-
/**
|
|
2698
|
-
* Enables changing the browser title using Magic expression (SetTitle)
|
|
2699
|
-
*/
|
|
2700
2110
|
class TitleMagicService {
|
|
2701
|
-
/**
|
|
2702
|
-
*
|
|
2703
|
-
* @param titleService Angular's title-changing class
|
|
2704
|
-
*/
|
|
2705
2111
|
constructor(titleService) {
|
|
2706
2112
|
this.titleService = titleService;
|
|
2707
2113
|
}
|
|
2708
|
-
/**
|
|
2709
|
-
* Set the new title of the window
|
|
2710
|
-
* @param newTitle New title of the window
|
|
2711
|
-
*/
|
|
2712
2114
|
setTitle(newTitle) {
|
|
2713
2115
|
this.titleService.setTitle(newTitle);
|
|
2714
2116
|
}
|
|
2715
2117
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2118
|
+
TitleMagicService.ɵfac = function TitleMagicService_Factory(t) { return new (t || TitleMagicService)(ɵɵinject(Title)); };
|
|
2119
|
+
TitleMagicService.ɵprov = ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
|
2120
|
+
(function () { ɵsetClassMetadata(TitleMagicService, [{
|
|
2719
2121
|
type: Injectable
|
|
2720
2122
|
}], function () { return [{ type: Title }]; }, null); })();
|
|
2721
2123
|
|
|
2722
|
-
/**
|
|
2723
|
-
* Provides the UI with values calculated by the Magic WebClient
|
|
2724
|
-
*/
|
|
2725
2124
|
class AccessorMagicService {
|
|
2726
|
-
/**
|
|
2727
|
-
* @ignore
|
|
2728
|
-
*/
|
|
2729
2125
|
constructor(task) {
|
|
2730
2126
|
this.task = task;
|
|
2731
2127
|
this.Logger = null;
|
|
2732
2128
|
this.Logger = Logger.Instance;
|
|
2733
2129
|
}
|
|
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
2130
|
checkIsReadOnly(controlId) {
|
|
2741
2131
|
let properties;
|
|
2742
2132
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
|
@@ -2745,99 +2135,45 @@ class AccessorMagicService {
|
|
|
2745
2135
|
else
|
|
2746
2136
|
return true;
|
|
2747
2137
|
}
|
|
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
2138
|
getText(controlId, rowId) {
|
|
2756
2139
|
return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
|
|
2757
2140
|
}
|
|
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
2141
|
getTabpageText(controlId, layer) {
|
|
2766
2142
|
const items = this.task.getProperty(controlId, HtmlProperties.ItemsList);
|
|
2767
2143
|
if (typeof items !== "undefined")
|
|
2768
2144
|
return items[layer].displayValue;
|
|
2769
2145
|
return "";
|
|
2770
2146
|
}
|
|
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
2147
|
getImage(controlId, rowId) {
|
|
2779
2148
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
|
2780
2149
|
return result;
|
|
2781
2150
|
}
|
|
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
2151
|
isImageExists(controlId, rowId) {
|
|
2790
2152
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
|
2791
2153
|
return !isNullOrUndefined(result);
|
|
2792
2154
|
}
|
|
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
2155
|
getClasses(controlId, rowId) {
|
|
2801
2156
|
return this.task.getClasses(controlId, rowId);
|
|
2802
2157
|
}
|
|
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
2158
|
getStyle(controlId, styleName, rowId) {
|
|
2812
2159
|
let style = this.task.getStyle(controlId, styleName, rowId);
|
|
2813
2160
|
return style;
|
|
2814
2161
|
}
|
|
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
2162
|
getVisible(controlId, rowId) {
|
|
2823
2163
|
let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
|
|
2824
2164
|
return vis ? 'visible' : 'hidden';
|
|
2825
2165
|
}
|
|
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
2166
|
getNumericPicture(picture) {
|
|
2833
2167
|
if (isNullOrUndefined(picture))
|
|
2834
2168
|
return null;
|
|
2835
2169
|
let pic = new PIC(picture, StorageAttribute.NUMERIC, 0);
|
|
2836
2170
|
var obj = {};
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2171
|
+
obj['prefix'] = "";
|
|
2172
|
+
if (pic.getPosPref_().length > 0 && pic.getNegPref_().length > 0) {
|
|
2173
|
+
let pref = '-' + pic.getPosPref_();
|
|
2174
|
+
if (pref == pic.getNegPref_())
|
|
2175
|
+
obj['prefix'] = pic.getPosPref_();
|
|
2176
|
+
}
|
|
2841
2177
|
if (pic.getPosSuff_().length > 0)
|
|
2842
2178
|
obj['suffix'] = pic.getPosSuff_();
|
|
2843
2179
|
else
|
|
@@ -2859,128 +2195,51 @@ class AccessorMagicService {
|
|
|
2859
2195
|
obj['wholes'] = pic.getWholes();
|
|
2860
2196
|
return obj;
|
|
2861
2197
|
}
|
|
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
2198
|
getMustInput(controlId, rowId) {
|
|
2870
2199
|
let vis = this.getProperty(controlId, HtmlProperties.MustInput, rowId);
|
|
2871
2200
|
return vis ? 'true' : 'false';
|
|
2872
2201
|
}
|
|
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
2202
|
isDisabled(controlId, rowId) {
|
|
2881
2203
|
let result = this.getProperty(controlId, HtmlProperties.Enabled, rowId);
|
|
2882
2204
|
return result === true ? null : true;
|
|
2883
2205
|
}
|
|
2884
|
-
/**
|
|
2885
|
-
* @ignore
|
|
2886
|
-
*/
|
|
2887
|
-
// getProperty (not changed)
|
|
2888
2206
|
getProperty(controlId, prop, rowId) {
|
|
2889
2207
|
return this.task.getProperty(controlId, prop, rowId);
|
|
2890
2208
|
}
|
|
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
2209
|
getTitle(controlId, rowId) {
|
|
2899
2210
|
return this.task.getProperty(controlId, HtmlProperties.Tooltip, rowId);
|
|
2900
2211
|
}
|
|
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
2212
|
getZoomButtonTitle(controlId, rowId) {
|
|
2909
2213
|
return this.task.getProperty(controlId, HtmlProperties.ZoomButtonTooltip, rowId);
|
|
2910
2214
|
}
|
|
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
2215
|
getSelectedValue(controlId, rowId) {
|
|
2919
2216
|
return this.task.getProperty(controlId, HtmlProperties.SelectedValue, rowId);
|
|
2920
2217
|
}
|
|
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
2218
|
getPlaceholder(controlId, rowId) {
|
|
2929
2219
|
return this.task.getProperty(controlId, HtmlProperties.PlaceHolder, rowId);
|
|
2930
2220
|
}
|
|
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
2221
|
getType(controlId, rowId) {
|
|
2939
2222
|
let result = this.task.getProperty(controlId, HtmlProperties.Password, rowId);
|
|
2940
2223
|
return result ? "password" : "text";
|
|
2941
2224
|
}
|
|
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
2225
|
getTabIndex(controlId, rowId) {
|
|
2950
2226
|
return this.task.getProperty(controlId, HtmlProperties.TabIndex, rowId);
|
|
2951
2227
|
}
|
|
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
2228
|
getValue(controlId, rowId) {
|
|
2960
2229
|
let val = this.task.getValue(controlId, rowId);
|
|
2961
2230
|
return val;
|
|
2962
2231
|
}
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
*/
|
|
2969
|
-
/// getPicture -->
|
|
2232
|
+
getFormattedValue(controlId, rowId) {
|
|
2233
|
+
let val = this.task.getValue(controlId, rowId);
|
|
2234
|
+
val = this.task.getFormattedValue(controlId, val);
|
|
2235
|
+
return val;
|
|
2236
|
+
}
|
|
2970
2237
|
getPicture(controlId, rowId) {
|
|
2971
2238
|
if (isNullOrUndefined(controlId))
|
|
2972
2239
|
return null;
|
|
2973
2240
|
let pic = this.task.GetControlPictureMask(controlId);
|
|
2974
2241
|
return (pic != null) ? pic.getFormat().toString() : null;
|
|
2975
2242
|
}
|
|
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
2243
|
getCustomProperty(controlId, propertyNameOrRowID, rowId) {
|
|
2985
2244
|
if (controlId.indexOf('~') == -1)
|
|
2986
2245
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
|
@@ -3005,22 +2264,21 @@ class AccessorMagicService {
|
|
|
3005
2264
|
}
|
|
3006
2265
|
return userProperties;
|
|
3007
2266
|
}
|
|
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
2267
|
getItemListValues(id, rowId) {
|
|
3016
2268
|
return this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
|
3017
2269
|
}
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
2270
|
+
getFilteredList(controlId, rowId) {
|
|
2271
|
+
if (isNullOrUndefined(rowId))
|
|
2272
|
+
rowId = '0';
|
|
2273
|
+
let items = this.getItemListValues(controlId, rowId);
|
|
2274
|
+
let value = this.task.getFormControl(rowId, controlId).value;
|
|
2275
|
+
if (value !== null && value !== "" && items instanceof Array) {
|
|
2276
|
+
value = value.toLowerCase();
|
|
2277
|
+
return items.filter(option => option.displayValue.toLowerCase().includes(value));
|
|
2278
|
+
}
|
|
2279
|
+
else
|
|
2280
|
+
return items;
|
|
2281
|
+
}
|
|
3024
2282
|
getDisplayValue(id, rowId) {
|
|
3025
2283
|
let displayValue = "";
|
|
3026
2284
|
let o = this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
|
@@ -3029,12 +2287,6 @@ class AccessorMagicService {
|
|
|
3029
2287
|
displayValue = o[value].displayValue;
|
|
3030
2288
|
return displayValue;
|
|
3031
2289
|
}
|
|
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
2290
|
isOptionSelected(index, controlId) {
|
|
3039
2291
|
let val = this.task.getValue(controlId, "0");
|
|
3040
2292
|
for (let item of val) {
|
|
@@ -3043,40 +2295,18 @@ class AccessorMagicService {
|
|
|
3043
2295
|
}
|
|
3044
2296
|
return false;
|
|
3045
2297
|
}
|
|
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
2298
|
isTabPageSelected(controlId, layer) {
|
|
3053
2299
|
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
|
|
2300
|
+
return val == (layer - 1);
|
|
2301
|
+
}
|
|
3062
2302
|
isTabPageLayerSelected(controlId, layer) {
|
|
3063
2303
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedLayer);
|
|
3064
|
-
return val == (layer - 1);
|
|
2304
|
+
return val == (layer - 1);
|
|
3065
2305
|
}
|
|
3066
|
-
/**
|
|
3067
|
-
* Returns the index of the selected tab page
|
|
3068
|
-
* @param controlId Id of control
|
|
3069
|
-
* @returns
|
|
3070
|
-
*/
|
|
3071
2306
|
getTabSelectedIndex(controlId) {
|
|
3072
2307
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
|
3073
|
-
return val;
|
|
2308
|
+
return val;
|
|
3074
2309
|
}
|
|
3075
|
-
// private methodes
|
|
3076
|
-
/**
|
|
3077
|
-
* @ignore
|
|
3078
|
-
*/
|
|
3079
|
-
// mgIfRowCreated
|
|
3080
2310
|
ifRowCreated(row) {
|
|
3081
2311
|
if (row == null)
|
|
3082
2312
|
return false;
|
|
@@ -3084,48 +2314,25 @@ class AccessorMagicService {
|
|
|
3084
2314
|
let result = this.getFormGroupByRow(rowId);
|
|
3085
2315
|
return !isNullOrUndefined(result);
|
|
3086
2316
|
}
|
|
3087
|
-
/**
|
|
3088
|
-
* @ignore
|
|
3089
|
-
*/
|
|
3090
|
-
// mgGetFormGroupByRow
|
|
3091
2317
|
getFormGroupByRow(id) {
|
|
3092
2318
|
return this.task.formGroups[id];
|
|
3093
2319
|
}
|
|
3094
|
-
/**
|
|
3095
|
-
* @ignore
|
|
3096
|
-
*/
|
|
3097
|
-
// isRowSelected (not changed)
|
|
3098
2320
|
isRowSelected(controlId, rowId) {
|
|
3099
2321
|
const selectedRow = this.task.getProperty(controlId, HtmlProperties.SelectedRow, "0");
|
|
3100
2322
|
return selectedRow == rowId;
|
|
3101
2323
|
}
|
|
3102
|
-
/**
|
|
3103
|
-
* Returns whether a row is in edit state
|
|
3104
|
-
* @param row
|
|
3105
|
-
*/
|
|
3106
2324
|
isRowInRowEditing(row) {
|
|
3107
2325
|
let guiRowId = '0';
|
|
3108
2326
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
|
3109
2327
|
return this.task.isRowInRowEditing(guiRowId);
|
|
3110
2328
|
}
|
|
3111
|
-
/**
|
|
3112
|
-
* Returns whether a row is in edit state, use this method while control outside table control
|
|
3113
|
-
* @param row
|
|
3114
|
-
*/
|
|
3115
2329
|
isCurrentInRowEditing() {
|
|
3116
2330
|
let row = this.task.tableService.getSelectedRow();
|
|
3117
2331
|
return this.task.isRowInRowEditing(row);
|
|
3118
2332
|
}
|
|
3119
|
-
/**
|
|
3120
|
-
* @ignore
|
|
3121
|
-
*/
|
|
3122
|
-
// GetGuiTopIndex
|
|
3123
2333
|
guiTopIndex() {
|
|
3124
2334
|
return this.task.tableService.getTableTopIndex();
|
|
3125
2335
|
}
|
|
3126
|
-
/**
|
|
3127
|
-
* @ignore
|
|
3128
|
-
*/
|
|
3129
2336
|
getErrMsg(id, rowId) {
|
|
3130
2337
|
let c = this.task.getFormControl(rowId, id);
|
|
3131
2338
|
if (c.hasError('required'))
|
|
@@ -3147,12 +2354,6 @@ class AccessorMagicService {
|
|
|
3147
2354
|
}
|
|
3148
2355
|
return 'unknown error';
|
|
3149
2356
|
}
|
|
3150
|
-
/**
|
|
3151
|
-
* Sets a user-supplied value to the specified control
|
|
3152
|
-
* @param controlName
|
|
3153
|
-
* @param value
|
|
3154
|
-
* @param refreshDisplay
|
|
3155
|
-
*/
|
|
3156
2357
|
setValueToControl(controlName, value, refreshDisplay) {
|
|
3157
2358
|
if (typeof refreshDisplay === "undefined")
|
|
3158
2359
|
refreshDisplay = true;
|
|
@@ -3161,44 +2362,28 @@ class AccessorMagicService {
|
|
|
3161
2362
|
guiEvent.param = refreshDisplay;
|
|
3162
2363
|
this.task.insertEvent(guiEvent);
|
|
3163
2364
|
}
|
|
3164
|
-
/**
|
|
3165
|
-
* @ignore
|
|
3166
|
-
*/
|
|
3167
2365
|
isDataviewEmpty() {
|
|
3168
2366
|
return this.task.Records.isEmptyDataView;
|
|
3169
2367
|
}
|
|
3170
|
-
/**
|
|
3171
|
-
* simulates a click event on the specified control, for the Magic engine
|
|
3172
|
-
* @param controlName
|
|
3173
|
-
* @param rowId
|
|
3174
|
-
*/
|
|
3175
2368
|
simulateClick(controlName, rowId) {
|
|
3176
2369
|
if (typeof rowId === "undefined")
|
|
3177
2370
|
rowId = 0;
|
|
3178
2371
|
this.task.insertEvent(getGuiEventObj('click', controlName, rowId));
|
|
3179
2372
|
}
|
|
3180
|
-
/**
|
|
3181
|
-
* Return Boolean TRUE if user logged in Else it will return FALSE
|
|
3182
|
-
*/
|
|
3183
2373
|
isLoggedIn() {
|
|
3184
2374
|
return this.task.getIsLoggenIn();
|
|
3185
2375
|
}
|
|
3186
|
-
/**
|
|
3187
|
-
* Returns JS object containing the records with all table fields.
|
|
3188
|
-
*/
|
|
3189
2376
|
GetFormRecords() {
|
|
3190
2377
|
let rowId = 0;
|
|
3191
2378
|
let recArray;
|
|
3192
2379
|
if (!isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
|
3193
2380
|
let recList = this.task.Records.list;
|
|
3194
2381
|
let tableControls = new Array();
|
|
3195
|
-
//Generate list of table fields names
|
|
3196
2382
|
for (const key in this.task.template) {
|
|
3197
2383
|
if (this.task.template[key] == '1')
|
|
3198
2384
|
tableControls.push(key);
|
|
3199
2385
|
}
|
|
3200
2386
|
recArray = new Array();
|
|
3201
|
-
//Update the records as list of objects with values for table fields.
|
|
3202
2387
|
if (tableControls.length > 0) {
|
|
3203
2388
|
recList.forEach((ctrlMetaData) => {
|
|
3204
2389
|
if (this.task.Records.isRowCreated(rowId)) {
|
|
@@ -3214,20 +2399,23 @@ class AccessorMagicService {
|
|
|
3214
2399
|
}
|
|
3215
2400
|
return recArray;
|
|
3216
2401
|
}
|
|
2402
|
+
SetCookie(name, value, expires, path, domain, secure, sameSite) {
|
|
2403
|
+
CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
|
2404
|
+
}
|
|
2405
|
+
GetCookie(name) {
|
|
2406
|
+
return CookieService.getCookie(name);
|
|
2407
|
+
}
|
|
2408
|
+
DeleteCookie(name) {
|
|
2409
|
+
return CookieService.deleteCookie(name);
|
|
2410
|
+
}
|
|
3217
2411
|
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
2412
|
+
AccessorMagicService.ɵfac = function AccessorMagicService_Factory(t) { return new (t || AccessorMagicService)(ɵɵinject(TaskMagicService)); };
|
|
2413
|
+
AccessorMagicService.ɵprov = ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
|
2414
|
+
(function () { ɵsetClassMetadata(AccessorMagicService, [{
|
|
3221
2415
|
type: Injectable
|
|
3222
2416
|
}], function () { return [{ type: TaskMagicService }]; }, null); })();
|
|
3223
2417
|
|
|
3224
|
-
/**
|
|
3225
|
-
* Central place for adding the Magic services
|
|
3226
|
-
*/
|
|
3227
2418
|
class MagicServices {
|
|
3228
|
-
/**
|
|
3229
|
-
* @ignore
|
|
3230
|
-
*/
|
|
3231
2419
|
constructor(task, subformService, tableService, titleService, mgAccessorService) {
|
|
3232
2420
|
this.task = task;
|
|
3233
2421
|
this.subformService = subformService;
|
|
@@ -3240,74 +2428,36 @@ class MagicServices {
|
|
|
3240
2428
|
task.mgAccessorService = mgAccessorService;
|
|
3241
2429
|
}
|
|
3242
2430
|
}
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
2431
|
+
MagicServices.ɵfac = function MagicServices_Factory(t) { return new (t || MagicServices)(ɵɵinject(TaskMagicService), ɵɵinject(SubformMagicService), ɵɵinject(TableMagicService), ɵɵinject(TitleMagicService), ɵɵinject(AccessorMagicService)); };
|
|
2432
|
+
MagicServices.ɵprov = ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
|
2433
|
+
(function () { ɵsetClassMetadata(MagicServices, [{
|
|
3246
2434
|
type: Injectable
|
|
3247
2435
|
}], function () { return [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }]; }, null); })();
|
|
3248
2436
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Base component representing a Magic task
|
|
3251
|
-
*/
|
|
3252
2437
|
class TaskBaseMagicComponent {
|
|
3253
|
-
/**
|
|
3254
|
-
*
|
|
3255
|
-
* @param ref changes-detector object
|
|
3256
|
-
* @param magicServices Access point for all Magic services
|
|
3257
|
-
*/
|
|
3258
2438
|
constructor(ref, magicServices) {
|
|
3259
2439
|
this.ref = ref;
|
|
3260
2440
|
this.magicServices = magicServices;
|
|
3261
|
-
/**
|
|
3262
|
-
* @ignore
|
|
3263
|
-
*/
|
|
3264
2441
|
this.magicProperties = MagicProperties;
|
|
3265
2442
|
}
|
|
3266
|
-
/**
|
|
3267
|
-
* Returns the Magic task service
|
|
3268
|
-
* @returns
|
|
3269
|
-
*/
|
|
3270
2443
|
get task() {
|
|
3271
2444
|
return this.magicServices.task;
|
|
3272
2445
|
}
|
|
3273
|
-
/**
|
|
3274
|
-
* Returns the Magic subform service
|
|
3275
|
-
* @returns
|
|
3276
|
-
*/
|
|
3277
2446
|
get mgSub() {
|
|
3278
2447
|
return this.magicServices.subformService;
|
|
3279
2448
|
}
|
|
3280
|
-
/**
|
|
3281
|
-
* Returns the Magic table service
|
|
3282
|
-
* @returns
|
|
3283
|
-
*/
|
|
3284
2449
|
get tableService() {
|
|
3285
2450
|
return this.magicServices.tableService;
|
|
3286
2451
|
}
|
|
3287
|
-
/**
|
|
3288
|
-
* Returns the Magic accessor service
|
|
3289
|
-
* @returns
|
|
3290
|
-
*/
|
|
3291
2452
|
get mg() {
|
|
3292
2453
|
return this.magicServices.mgAccessorService;
|
|
3293
2454
|
}
|
|
3294
|
-
/**
|
|
3295
|
-
* Returns the task Id
|
|
3296
|
-
* @returns
|
|
3297
|
-
*/
|
|
3298
2455
|
get taskId() {
|
|
3299
2456
|
return this.task.taskId;
|
|
3300
2457
|
}
|
|
3301
|
-
/**
|
|
3302
|
-
* Returns the FormGroup for screen-mode forms
|
|
3303
|
-
* @returns
|
|
3304
|
-
*/
|
|
3305
2458
|
get screenFormGroup() {
|
|
3306
2459
|
return this.task.ScreenModeControls;
|
|
3307
2460
|
}
|
|
3308
|
-
/**
|
|
3309
|
-
* Interface implementation
|
|
3310
|
-
*/
|
|
3311
2461
|
ngOnInit() {
|
|
3312
2462
|
let subscription = this.task.detectChanges.pipe().subscribe(c => {
|
|
3313
2463
|
this.ref.detectChanges();
|
|
@@ -3315,48 +2465,19 @@ class TaskBaseMagicComponent {
|
|
|
3315
2465
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
|
3316
2466
|
this.createFormControlsAccessor(this.screenFormGroup);
|
|
3317
2467
|
this.setInputDateFormat();
|
|
3318
|
-
// subcribe to custom property changes
|
|
3319
2468
|
this.task.customPropertiesSubject.pipe().subscribe(property => {
|
|
3320
2469
|
this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
|
3321
2470
|
});
|
|
3322
|
-
// subcribe to records count changes
|
|
3323
2471
|
this.task.recordsCountChangeSubject.pipe().subscribe(value => {
|
|
3324
2472
|
this.RecordsCountChanged(value);
|
|
3325
2473
|
});
|
|
3326
2474
|
}
|
|
3327
|
-
/**
|
|
3328
|
-
* @ignore
|
|
3329
|
-
*/
|
|
3330
2475
|
createFormControlsAccessor(formGroup) { }
|
|
3331
|
-
/**
|
|
3332
|
-
* @ignore
|
|
3333
|
-
*/
|
|
3334
2476
|
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
2477
|
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
|
-
*/
|
|
2478
|
+
}
|
|
3354
2479
|
RecordsCountChanged(recordsCount) {
|
|
3355
|
-
// intentionally left blank because the implementation should be in the derived class
|
|
3356
2480
|
}
|
|
3357
|
-
/**
|
|
3358
|
-
* Interface implementation
|
|
3359
|
-
*/
|
|
3360
2481
|
ngAfterViewInit() {
|
|
3361
2482
|
this.mgSub.init();
|
|
3362
2483
|
}
|
|
@@ -3366,16 +2487,13 @@ class TaskBaseMagicComponent {
|
|
|
3366
2487
|
this.task.oldPageSize = this.tableService.getPageSize();
|
|
3367
2488
|
}
|
|
3368
2489
|
}
|
|
3369
|
-
/**
|
|
3370
|
-
* Interface implementation
|
|
3371
|
-
*/
|
|
3372
2490
|
ngOnDestroy() {
|
|
3373
2491
|
this.task.dispose();
|
|
3374
2492
|
}
|
|
3375
2493
|
}
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
2494
|
+
TaskBaseMagicComponent.ɵfac = function TaskBaseMagicComponent_Factory(t) { return new (t || TaskBaseMagicComponent)(ɵɵdirectiveInject(ChangeDetectorRef), ɵɵdirectiveInject(MagicServices)); };
|
|
2495
|
+
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 });
|
|
2496
|
+
(function () { ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
|
3379
2497
|
type: Component,
|
|
3380
2498
|
args: [{
|
|
3381
2499
|
selector: 'task-magic',
|
|
@@ -3388,22 +2506,13 @@ class TaskBaseMagicComponent {
|
|
|
3388
2506
|
type: Input
|
|
3389
2507
|
}] }); })();
|
|
3390
2508
|
|
|
3391
|
-
/**
|
|
3392
|
-
* @ignore
|
|
3393
|
-
*/
|
|
3394
2509
|
class RowMagicDirective {
|
|
3395
2510
|
constructor(_task, element) {
|
|
3396
2511
|
this._task = _task;
|
|
3397
2512
|
this.element = element;
|
|
3398
|
-
/**
|
|
3399
|
-
* @ignore
|
|
3400
|
-
*/
|
|
3401
2513
|
this.rowChangedSubscriber = null;
|
|
3402
2514
|
this.htmlElement = this.element.nativeElement;
|
|
3403
2515
|
}
|
|
3404
|
-
/**
|
|
3405
|
-
* Initializes this object
|
|
3406
|
-
*/
|
|
3407
2516
|
ngOnInit() {
|
|
3408
2517
|
this.rowChangedSubscriber = this._task
|
|
3409
2518
|
.OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
|
|
@@ -3418,16 +2527,7 @@ class RowMagicDirective {
|
|
|
3418
2527
|
return (rect.top >= parentRect.top &&
|
|
3419
2528
|
rect.bottom <= parentRect.bottom);
|
|
3420
2529
|
}
|
|
3421
|
-
/**
|
|
3422
|
-
* Cleanup
|
|
3423
|
-
*/
|
|
3424
2530
|
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
2531
|
if (this.rowChangedSubscriber !== null) {
|
|
3432
2532
|
this.rowChangedSubscriber.unsubscribe();
|
|
3433
2533
|
}
|
|
@@ -3439,11 +2539,11 @@ class RowMagicDirective {
|
|
|
3439
2539
|
}
|
|
3440
2540
|
}
|
|
3441
2541
|
}
|
|
3442
|
-
|
|
3443
|
-
|
|
2542
|
+
RowMagicDirective.ɵfac = function RowMagicDirective_Factory(t) { return new (t || RowMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef)); };
|
|
2543
|
+
RowMagicDirective.ɵdir = ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
3444
2544
|
ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
|
3445
2545
|
} }, inputs: { rowId: ["magicRow", "rowId"] } });
|
|
3446
|
-
|
|
2546
|
+
(function () { ɵsetClassMetadata(RowMagicDirective, [{
|
|
3447
2547
|
type: Directive,
|
|
3448
2548
|
args: [{
|
|
3449
2549
|
selector: '[magicRow]'
|
|
@@ -3456,35 +2556,16 @@ class RowMagicDirective {
|
|
|
3456
2556
|
args: ['click', ['$event']]
|
|
3457
2557
|
}] }); })();
|
|
3458
2558
|
|
|
3459
|
-
/**
|
|
3460
|
-
* Connects HTML elements to the Magic Web Client engine
|
|
3461
|
-
*/
|
|
3462
2559
|
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
2560
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
|
3472
2561
|
this._task = _task;
|
|
3473
2562
|
this.element = element;
|
|
3474
2563
|
this.renderer = renderer;
|
|
3475
2564
|
this.vcRef = vcRef;
|
|
3476
2565
|
this.magicRow = magicRow;
|
|
3477
|
-
/**
|
|
3478
|
-
* Collection of event handlers for this element
|
|
3479
|
-
*/
|
|
3480
2566
|
this.eventHandlers = {};
|
|
3481
2567
|
this.eventsOnlyVal = false;
|
|
3482
2568
|
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
2569
|
if (!(typeof magicRow === 'undefined' || magicRow === null))
|
|
3489
2570
|
this.rowId = magicRow.rowId;
|
|
3490
2571
|
}
|
|
@@ -3493,40 +2574,26 @@ class MagicDirective {
|
|
|
3493
2574
|
this.selector = 'magic';
|
|
3494
2575
|
}
|
|
3495
2576
|
;
|
|
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
2577
|
set eventsOnly(val) {
|
|
3500
2578
|
console.log('eventsOnly');
|
|
3501
2579
|
this.eventsOnlyVal = true;
|
|
3502
2580
|
}
|
|
3503
2581
|
;
|
|
3504
|
-
/**
|
|
3505
|
-
* Get the task service
|
|
3506
|
-
* @returns
|
|
3507
|
-
*/
|
|
3508
2582
|
get task() {
|
|
3509
2583
|
return this._task;
|
|
3510
2584
|
}
|
|
3511
|
-
/**
|
|
3512
|
-
* Register to the events this element may need to handle
|
|
3513
|
-
*/
|
|
3514
2585
|
regEvents() {
|
|
3515
|
-
// Handle events for which event handler may be removed and restored
|
|
3516
2586
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
3517
2587
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
3518
2588
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
3519
2589
|
});
|
|
3520
|
-
|
|
3521
|
-
let events = ['click', 'mousedown', 'dblclick']; // ,'resize', 'load', 'unload'
|
|
2590
|
+
let events = ['click', 'mousedown', 'dblclick'];
|
|
3522
2591
|
events.forEach(event => {
|
|
3523
2592
|
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
2593
|
let fromButton = false;
|
|
3526
2594
|
if (this.htmlElement instanceof HTMLButtonElement)
|
|
3527
2595
|
fromButton = true;
|
|
3528
2596
|
this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
|
|
3529
|
-
e.cancelBubble = true;
|
|
3530
2597
|
});
|
|
3531
2598
|
});
|
|
3532
2599
|
this.renderer.listen(this.htmlElement, 'change', (e) => {
|
|
@@ -3537,13 +2604,10 @@ class MagicDirective {
|
|
|
3537
2604
|
this.task.insertEvent(guiEvent);
|
|
3538
2605
|
}
|
|
3539
2606
|
});
|
|
3540
|
-
// handle the input event
|
|
3541
2607
|
fromEvent(this.htmlElement, 'input').pipe(map((event) => {
|
|
3542
2608
|
return event.target.value;
|
|
3543
|
-
}), debounceTime(200)
|
|
3544
|
-
).subscribe((x) => {
|
|
2609
|
+
}), debounceTime(200)).subscribe((x) => {
|
|
3545
2610
|
if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
|
|
3546
|
-
// Don't support character binding for date/time values
|
|
3547
2611
|
let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
|
|
3548
2612
|
if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
|
|
3549
2613
|
this.task.mgAccessorService.setValueToControl(this.id, x, true);
|
|
@@ -3569,25 +2633,16 @@ class MagicDirective {
|
|
|
3569
2633
|
(e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
|
|
3570
2634
|
if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
|
|
3571
2635
|
guiEvent.keyCode = e.keyCode;
|
|
3572
|
-
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
|
3573
2636
|
if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && !MagicDirective.opened)
|
|
3574
2637
|
e.cancelBubble = true;
|
|
3575
2638
|
this.task.insertEvent(guiEvent);
|
|
3576
2639
|
}
|
|
3577
2640
|
});
|
|
3578
2641
|
}
|
|
3579
|
-
/**
|
|
3580
|
-
* Handle focus event
|
|
3581
|
-
*/
|
|
3582
2642
|
OnFocus() {
|
|
3583
2643
|
this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
|
|
3584
2644
|
event.cancelBubble = true;
|
|
3585
2645
|
}
|
|
3586
|
-
/**
|
|
3587
|
-
* Is the command's element the same as this directive's element
|
|
3588
|
-
* @param command
|
|
3589
|
-
* @returns true/false
|
|
3590
|
-
*/
|
|
3591
2646
|
IsSameElement(command) {
|
|
3592
2647
|
let line = command.line;
|
|
3593
2648
|
if (this.task.isTableControl(command.CtrlName))
|
|
@@ -3596,17 +2651,9 @@ class MagicDirective {
|
|
|
3596
2651
|
(line === +this.rowId ||
|
|
3597
2652
|
(line === 0 && isNullOrUndefined(this.rowId))));
|
|
3598
2653
|
}
|
|
3599
|
-
/**
|
|
3600
|
-
* Is the command's element the same as this directive's component
|
|
3601
|
-
* @param command
|
|
3602
|
-
* @returns true/false
|
|
3603
|
-
*/
|
|
3604
2654
|
IsSameComponent(command) {
|
|
3605
2655
|
return (command.controlName === this.id);
|
|
3606
2656
|
}
|
|
3607
|
-
/**
|
|
3608
|
-
* @ignore
|
|
3609
|
-
*/
|
|
3610
2657
|
regUpdatesUI() {
|
|
3611
2658
|
this.subscribeRefreshDom = this.task
|
|
3612
2659
|
.refreshDom.pipe(filter(c => this.IsSameElement(c)))
|
|
@@ -3628,17 +2675,10 @@ class MagicDirective {
|
|
|
3628
2675
|
this.handleInteractiveCommands(command);
|
|
3629
2676
|
});
|
|
3630
2677
|
}
|
|
3631
|
-
/**
|
|
3632
|
-
* Initializes this object
|
|
3633
|
-
*/
|
|
3634
2678
|
ngOnInit() {
|
|
3635
2679
|
this.regEvents();
|
|
3636
2680
|
this.regUpdatesUI();
|
|
3637
2681
|
}
|
|
3638
|
-
/**
|
|
3639
|
-
* Handles the commands received from the Magic WebClient engine
|
|
3640
|
-
* @param command
|
|
3641
|
-
*/
|
|
3642
2682
|
handleCommand(command) {
|
|
3643
2683
|
switch (command.CommandType) {
|
|
3644
2684
|
case CommandType.SET_PROPERTY:
|
|
@@ -3646,16 +2686,12 @@ class MagicDirective {
|
|
|
3646
2686
|
break;
|
|
3647
2687
|
case CommandType.SET_FOCUS:
|
|
3648
2688
|
this.focusUnlistener();
|
|
3649
|
-
// Do not set focus on connected zoom button
|
|
3650
2689
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
|
3651
2690
|
this.htmlElement.focus();
|
|
3652
2691
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
|
|
3653
2692
|
break;
|
|
3654
2693
|
}
|
|
3655
2694
|
}
|
|
3656
|
-
/**
|
|
3657
|
-
* handle the interactive commands like CallJS
|
|
3658
|
-
*/
|
|
3659
2695
|
handleInteractiveCommands(command) {
|
|
3660
2696
|
switch (command._commandType) {
|
|
3661
2697
|
case InteractiveCommandType.CALL_JS:
|
|
@@ -3665,24 +2701,18 @@ class MagicDirective {
|
|
|
3665
2701
|
let resultString = '';
|
|
3666
2702
|
try {
|
|
3667
2703
|
if (!isNullOrUndefined(magicComponent[methodName])) {
|
|
3668
|
-
// invoke the method on instance of magic componenet
|
|
3669
2704
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
|
3670
2705
|
}
|
|
3671
2706
|
else
|
|
3672
|
-
console.error('Instance method ' + methodName + ' does not exists');
|
|
2707
|
+
console.error('Instance method ' + methodName + ' does not exists');
|
|
3673
2708
|
}
|
|
3674
2709
|
catch (e) {
|
|
3675
|
-
// any other exception
|
|
3676
2710
|
console.error(e.message);
|
|
3677
2711
|
}
|
|
3678
|
-
command.resultString = resultString;
|
|
2712
|
+
command.resultString = resultString;
|
|
3679
2713
|
break;
|
|
3680
2714
|
}
|
|
3681
2715
|
}
|
|
3682
|
-
/**
|
|
3683
|
-
* Handle the Magic set-property command
|
|
3684
|
-
* @param command
|
|
3685
|
-
*/
|
|
3686
2716
|
handleSetProperty(command) {
|
|
3687
2717
|
switch (command.Operation) {
|
|
3688
2718
|
case HtmlProperties.ReadOnly:
|
|
@@ -3693,17 +2723,14 @@ class MagicDirective {
|
|
|
3693
2723
|
break;
|
|
3694
2724
|
}
|
|
3695
2725
|
}
|
|
3696
|
-
/**
|
|
3697
|
-
* Cleanup
|
|
3698
|
-
*/
|
|
3699
2726
|
ngOnDestroy() {
|
|
3700
2727
|
this.subscribeRefreshDom.unsubscribe();
|
|
3701
2728
|
}
|
|
3702
2729
|
}
|
|
3703
2730
|
MagicDirective.opened = false;
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
2731
|
+
MagicDirective.ɵfac = function MagicDirective_Factory(t) { return new (t || MagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
2732
|
+
MagicDirective.ɵdir = ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", rowId: "rowId" } });
|
|
2733
|
+
(function () { ɵsetClassMetadata(MagicDirective, [{
|
|
3707
2734
|
type: Directive,
|
|
3708
2735
|
args: [{
|
|
3709
2736
|
selector: '[magic]'
|
|
@@ -3720,9 +2747,6 @@ MagicDirective.opened = false;
|
|
|
3720
2747
|
type: Input
|
|
3721
2748
|
}] }); })();
|
|
3722
2749
|
|
|
3723
|
-
/**
|
|
3724
|
-
* @ignore
|
|
3725
|
-
*/
|
|
3726
2750
|
class NoControlMagicDirective extends MagicDirective {
|
|
3727
2751
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
|
3728
2752
|
super(_task, element, renderer, vcRef, magicRow);
|
|
@@ -3757,12 +2781,10 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3757
2781
|
}
|
|
3758
2782
|
}
|
|
3759
2783
|
}
|
|
3760
|
-
// is the div a tab control
|
|
3761
2784
|
isTabControl() {
|
|
3762
2785
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
3763
2786
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
|
3764
2787
|
}
|
|
3765
|
-
// is the div a radio buttons wrapper
|
|
3766
2788
|
isRadio() {
|
|
3767
2789
|
return this.htmlElement instanceof HTMLDivElement &&
|
|
3768
2790
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
|
@@ -3771,7 +2793,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3771
2793
|
super.handleCommand(command);
|
|
3772
2794
|
switch (command.CommandType) {
|
|
3773
2795
|
case CommandType.SET_CLASS:
|
|
3774
|
-
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
|
3775
2796
|
const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
|
3776
2797
|
if (controlMetadata.removedClass != '') {
|
|
3777
2798
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
|
@@ -3784,7 +2805,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3784
2805
|
this.htmlElement.innerText = command.value;
|
|
3785
2806
|
if (this.htmlElement instanceof HTMLSelectElement)
|
|
3786
2807
|
this.htmlElement.value = command.value;
|
|
3787
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
2808
|
+
if (this.htmlElement instanceof HTMLAnchorElement)
|
|
3788
2809
|
this.htmlElement.text = command.value;
|
|
3789
2810
|
if (this.htmlElement instanceof HTMLInputElement) {
|
|
3790
2811
|
if (this.htmlElement.type === "checkbox") {
|
|
@@ -3808,7 +2829,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3808
2829
|
break;
|
|
3809
2830
|
}
|
|
3810
2831
|
}
|
|
3811
|
-
// handle set-property commands
|
|
3812
2832
|
handleSetProperty(command) {
|
|
3813
2833
|
super.handleSetProperty(command);
|
|
3814
2834
|
switch (command.Operation) {
|
|
@@ -3824,7 +2844,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3824
2844
|
break;
|
|
3825
2845
|
case HtmlProperties.ItemsList:
|
|
3826
2846
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
|
3827
|
-
// clear the list
|
|
3828
2847
|
var len = this.htmlElement.length;
|
|
3829
2848
|
for (var i = len - 1; i >= 0; i--) {
|
|
3830
2849
|
this.htmlElement.remove(i);
|
|
@@ -3866,8 +2885,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3866
2885
|
let child = tabControl.children[i];
|
|
3867
2886
|
const layer = child.getAttribute('layer') - 1;
|
|
3868
2887
|
if (child instanceof HTMLButtonElement) {
|
|
3869
|
-
|
|
3870
|
-
if (layer == command.obj1) { // compare int to string
|
|
2888
|
+
if (layer == command.obj1) {
|
|
3871
2889
|
child.classList.add('tab_button_active');
|
|
3872
2890
|
}
|
|
3873
2891
|
else {
|
|
@@ -3875,7 +2893,6 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3875
2893
|
}
|
|
3876
2894
|
}
|
|
3877
2895
|
else {
|
|
3878
|
-
// not a buton - hide unselected tabpages
|
|
3879
2896
|
let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
|
3880
2897
|
child.setAttribute('style', style);
|
|
3881
2898
|
}
|
|
@@ -3897,9 +2914,9 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3897
2914
|
}
|
|
3898
2915
|
}
|
|
3899
2916
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
2917
|
+
NoControlMagicDirective.ɵfac = function NoControlMagicDirective_Factory(t) { return new (t || NoControlMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
|
2918
|
+
NoControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: ["magicnc", "magic"] }, features: [ɵɵInheritDefinitionFeature] });
|
|
2919
|
+
(function () { ɵsetClassMetadata(NoControlMagicDirective, [{
|
|
3903
2920
|
type: Directive,
|
|
3904
2921
|
args: [{
|
|
3905
2922
|
selector: '[magicnc]'
|
|
@@ -3911,20 +2928,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
|
3911
2928
|
args: ['magicnc']
|
|
3912
2929
|
}] }); })();
|
|
3913
2930
|
|
|
3914
|
-
/**
|
|
3915
|
-
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
|
3916
|
-
*/
|
|
3917
2931
|
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
2932
|
constructor(activatedRoute, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
|
3929
2933
|
this.activatedRoute = activatedRoute;
|
|
3930
2934
|
this.magic = magic;
|
|
@@ -3937,9 +2941,6 @@ class RouterContainerMagicComponent {
|
|
|
3937
2941
|
this.componentRef = null;
|
|
3938
2942
|
this.parentMgSubformService = null;
|
|
3939
2943
|
}
|
|
3940
|
-
/**
|
|
3941
|
-
* Initialization
|
|
3942
|
-
*/
|
|
3943
2944
|
ngOnInit() {
|
|
3944
2945
|
let outletname = this.activatedRoute.outlet;
|
|
3945
2946
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
@@ -3957,10 +2958,7 @@ class RouterContainerMagicComponent {
|
|
|
3957
2958
|
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
|
3958
2959
|
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
|
3959
2960
|
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
2961
|
let calcRouterPath = currentActiveRoute.routeConfig.path;
|
|
3963
|
-
// add the RouterPath only if exist
|
|
3964
2962
|
if (calcRouterPath.length > 0) {
|
|
3965
2963
|
let routerPath = calcRouterPath;
|
|
3966
2964
|
let tokens = StrUtil.tokenize(routerPath, "/:");
|
|
@@ -3973,7 +2971,6 @@ class RouterContainerMagicComponent {
|
|
|
3973
2971
|
this.containerTaskService.insertEvent(guiEvent);
|
|
3974
2972
|
}
|
|
3975
2973
|
initializeComponent() {
|
|
3976
|
-
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
|
3977
2974
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
|
3978
2975
|
if (subformMagicService.currentRouteDefinition !== null) {
|
|
3979
2976
|
let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
|
@@ -3986,9 +2983,6 @@ class RouterContainerMagicComponent {
|
|
|
3986
2983
|
this.parentMgSubformService = subformMagicService;
|
|
3987
2984
|
subformMagicService.currentRouteDefinition = null;
|
|
3988
2985
|
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
2986
|
let ignoreParamChange = true;
|
|
3993
2987
|
myActiveRoute.paramMap.subscribe(params => {
|
|
3994
2988
|
if (!ignoreParamChange)
|
|
@@ -3999,12 +2993,7 @@ class RouterContainerMagicComponent {
|
|
|
3999
2993
|
this.routerCommandsMagicService.ExecuteNextCommand();
|
|
4000
2994
|
}
|
|
4001
2995
|
}
|
|
4002
|
-
/**
|
|
4003
|
-
* Cleanup
|
|
4004
|
-
*/
|
|
4005
2996
|
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
2997
|
if (this.componentRef != null) {
|
|
4009
2998
|
this.componentRef.instance.task.close();
|
|
4010
2999
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
|
@@ -4012,9 +3001,9 @@ class RouterContainerMagicComponent {
|
|
|
4012
3001
|
}
|
|
4013
3002
|
}
|
|
4014
3003
|
}
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
3004
|
+
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)); };
|
|
3005
|
+
RouterContainerMagicComponent.ɵcmp = ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
|
3006
|
+
(function () { ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
|
4018
3007
|
type: Component,
|
|
4019
3008
|
args: [{
|
|
4020
3009
|
selector: 'magic-route-outlet',
|
|
@@ -4023,15 +3012,9 @@ class RouterContainerMagicComponent {
|
|
|
4023
3012
|
}]
|
|
4024
3013
|
}], function () { return [{ type: ActivatedRoute }, { type: EngineMagicService }, { type: TaskMagicService }, { type: ComponentFactoryResolver }, { type: ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }]; }, null); })();
|
|
4025
3014
|
|
|
4026
|
-
/**
|
|
4027
|
-
* @ignore
|
|
4028
|
-
*/
|
|
4029
3015
|
class Constants {
|
|
4030
3016
|
}
|
|
4031
3017
|
Constants.DATE_FMT = 'dd/MMM/yyyy';
|
|
4032
|
-
/**
|
|
4033
|
-
* @ignore
|
|
4034
|
-
*/
|
|
4035
3018
|
class DateMagicPipe extends DatePipe {
|
|
4036
3019
|
constructor(_task) {
|
|
4037
3020
|
super('en-US');
|
|
@@ -4043,7 +3026,6 @@ class DateMagicPipe extends DatePipe {
|
|
|
4043
3026
|
let mgDateFormatter = new MgDateFormatter();
|
|
4044
3027
|
if (!isNullOrUndefined(value) && mask !== null) {
|
|
4045
3028
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
|
4046
|
-
// If control is label control of table, due to query mode, then save the format here.
|
|
4047
3029
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
|
4048
3030
|
if (this._task.mgInputDateFormat == null)
|
|
4049
3031
|
this._task.mgInputDateFormat = formatStr;
|
|
@@ -4057,9 +3039,9 @@ class DateMagicPipe extends DatePipe {
|
|
|
4057
3039
|
return value;
|
|
4058
3040
|
}
|
|
4059
3041
|
}
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
3042
|
+
DateMagicPipe.ɵfac = function DateMagicPipe_Factory(t) { return new (t || DateMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
|
|
3043
|
+
DateMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
|
3044
|
+
(function () { ɵsetClassMetadata(DateMagicPipe, [{
|
|
4063
3045
|
type: Pipe,
|
|
4064
3046
|
args: [{
|
|
4065
3047
|
name: 'magicDate'
|
|
@@ -4124,17 +3106,11 @@ class MgDateFormatter {
|
|
|
4124
3106
|
return formatStr.ToString();
|
|
4125
3107
|
}
|
|
4126
3108
|
else
|
|
4127
|
-
return "dd-mm-yyyy";
|
|
3109
|
+
return "dd-mm-yyyy";
|
|
4128
3110
|
}
|
|
4129
3111
|
}
|
|
4130
3112
|
|
|
4131
|
-
/**
|
|
4132
|
-
* Perform Magic validation on input controls which hold alphanumeric strings
|
|
4133
|
-
*/
|
|
4134
3113
|
class MgformatMagicDirective {
|
|
4135
|
-
/**
|
|
4136
|
-
* @ignore
|
|
4137
|
-
*/
|
|
4138
3114
|
constructor(magicDir, _task) {
|
|
4139
3115
|
this.magicDir = magicDir;
|
|
4140
3116
|
this._task = _task;
|
|
@@ -4142,20 +3118,12 @@ class MgformatMagicDirective {
|
|
|
4142
3118
|
ngAfterViewInit() {
|
|
4143
3119
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4144
3120
|
if (control != null && this._task.mgInputDateFormat == null) {
|
|
4145
|
-
// get the first date control's format.
|
|
4146
3121
|
let pic = this._task.GetControlPictureMask(this.magicDir.id);
|
|
4147
3122
|
if (pic.getAttr() == StorageAttribute.DATE) {
|
|
4148
3123
|
this.formatDate(pic);
|
|
4149
3124
|
}
|
|
4150
3125
|
}
|
|
4151
3126
|
}
|
|
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
3127
|
onFocusEvent($event) {
|
|
4160
3128
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4161
3129
|
if (control != null) {
|
|
@@ -4180,10 +3148,6 @@ class MgformatMagicDirective {
|
|
|
4180
3148
|
}
|
|
4181
3149
|
}
|
|
4182
3150
|
}
|
|
4183
|
-
/**
|
|
4184
|
-
* @ignore
|
|
4185
|
-
*/
|
|
4186
|
-
// This can be used to implement uppercase/lower case
|
|
4187
3151
|
onChangeEvent($event) {
|
|
4188
3152
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
|
4189
3153
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
|
@@ -4201,9 +3165,6 @@ class MgformatMagicDirective {
|
|
|
4201
3165
|
let mgDateFormatter = new MgDateFormatter();
|
|
4202
3166
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
|
4203
3167
|
}
|
|
4204
|
-
/**
|
|
4205
|
-
* @ignore
|
|
4206
|
-
*/
|
|
4207
3168
|
formatAlphaUnicode(control) {
|
|
4208
3169
|
let value = control.value;
|
|
4209
3170
|
if (value !== null && value.length > 0) {
|
|
@@ -4229,9 +3190,6 @@ class MgformatMagicDirective {
|
|
|
4229
3190
|
control.setValue(valueStr.ToString());
|
|
4230
3191
|
}
|
|
4231
3192
|
}
|
|
4232
|
-
/**
|
|
4233
|
-
* @ignore
|
|
4234
|
-
*/
|
|
4235
3193
|
formatBoolean(control) {
|
|
4236
3194
|
let value = control.value;
|
|
4237
3195
|
if (value !== null && value.length > 0) {
|
|
@@ -4244,12 +3202,6 @@ class MgformatMagicDirective {
|
|
|
4244
3202
|
}
|
|
4245
3203
|
}
|
|
4246
3204
|
}
|
|
4247
|
-
/**
|
|
4248
|
-
* @ignore
|
|
4249
|
-
*/
|
|
4250
|
-
/// <summary>
|
|
4251
|
-
/// generate pattern from fld's format
|
|
4252
|
-
/// </summary>
|
|
4253
3205
|
generatePattern(attribute, pic) {
|
|
4254
3206
|
let pattern = "";
|
|
4255
3207
|
switch (attribute) {
|
|
@@ -4263,12 +3215,6 @@ class MgformatMagicDirective {
|
|
|
4263
3215
|
}
|
|
4264
3216
|
return pattern;
|
|
4265
3217
|
}
|
|
4266
|
-
/**
|
|
4267
|
-
* @ignore
|
|
4268
|
-
*/
|
|
4269
|
-
/// <summary>
|
|
4270
|
-
/// generate pattern for Alpha
|
|
4271
|
-
/// </summary>
|
|
4272
3218
|
generatePatternForNumber(pic) {
|
|
4273
3219
|
let patternStr = new StringBuilder();
|
|
4274
3220
|
patternStr.Append("^");
|
|
@@ -4281,9 +3227,6 @@ class MgformatMagicDirective {
|
|
|
4281
3227
|
patternStr.Append("$");
|
|
4282
3228
|
return patternStr.ToString();
|
|
4283
3229
|
}
|
|
4284
|
-
/**
|
|
4285
|
-
* @ignore
|
|
4286
|
-
*/
|
|
4287
3230
|
isPatternGenerationNeeded(attr, pic) {
|
|
4288
3231
|
switch (attr) {
|
|
4289
3232
|
case StorageAttribute.NUMERIC:
|
|
@@ -4293,12 +3236,6 @@ class MgformatMagicDirective {
|
|
|
4293
3236
|
return (pic.getMaskChars() > 0) ? true : false;
|
|
4294
3237
|
}
|
|
4295
3238
|
}
|
|
4296
|
-
/**
|
|
4297
|
-
* @ignore
|
|
4298
|
-
*/
|
|
4299
|
-
/// <summary>
|
|
4300
|
-
/// generate pattern for Alpha
|
|
4301
|
-
/// </summary>
|
|
4302
3239
|
generatePatternForAlpha(pic) {
|
|
4303
3240
|
let cnt = 0;
|
|
4304
3241
|
let inputAllChars = false;
|
|
@@ -4309,7 +3246,6 @@ class MgformatMagicDirective {
|
|
|
4309
3246
|
let pattern = new StringBuilder();
|
|
4310
3247
|
pattern.Append("^");
|
|
4311
3248
|
for (let i = 0; i < mask.length;) {
|
|
4312
|
-
//start new subset , if mask[i] is one of these.
|
|
4313
3249
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
|
4314
3250
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
|
4315
3251
|
pattern.Append("(");
|
|
@@ -4355,13 +3291,9 @@ class MgformatMagicDirective {
|
|
|
4355
3291
|
pattern.Append("$");
|
|
4356
3292
|
return pattern.ToString();
|
|
4357
3293
|
}
|
|
4358
|
-
/**
|
|
4359
|
-
* @ignore
|
|
4360
|
-
*/
|
|
4361
3294
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
|
4362
3295
|
changeInPattern.value = false;
|
|
4363
3296
|
let patternCount = 0;
|
|
4364
|
-
// find max chars
|
|
4365
3297
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
|
4366
3298
|
patternCount++;
|
|
4367
3299
|
idx++;
|
|
@@ -4370,9 +3302,6 @@ class MgformatMagicDirective {
|
|
|
4370
3302
|
changeInPattern.value = true;
|
|
4371
3303
|
return patternCount;
|
|
4372
3304
|
}
|
|
4373
|
-
/**
|
|
4374
|
-
* @ignore
|
|
4375
|
-
*/
|
|
4376
3305
|
IsPatternMatches(mask, pattern) {
|
|
4377
3306
|
for (let i = 0; i < pattern.length; i++)
|
|
4378
3307
|
if (mask == pattern[i])
|
|
@@ -4380,11 +3309,11 @@ class MgformatMagicDirective {
|
|
|
4380
3309
|
return false;
|
|
4381
3310
|
}
|
|
4382
3311
|
}
|
|
4383
|
-
|
|
4384
|
-
|
|
3312
|
+
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(ɵɵdirectiveInject(MagicDirective), ɵɵdirectiveInject(TaskMagicService)); };
|
|
3313
|
+
MgformatMagicDirective.ɵdir = ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4385
3314
|
ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
|
4386
3315
|
} } });
|
|
4387
|
-
|
|
3316
|
+
(function () { ɵsetClassMetadata(MgformatMagicDirective, [{
|
|
4388
3317
|
type: Directive,
|
|
4389
3318
|
args: [{
|
|
4390
3319
|
selector: '[mgFormat]'
|
|
@@ -4397,9 +3326,6 @@ class MgformatMagicDirective {
|
|
|
4397
3326
|
args: ['change', ['$event']]
|
|
4398
3327
|
}] }); })();
|
|
4399
3328
|
|
|
4400
|
-
/**
|
|
4401
|
-
* @ignore
|
|
4402
|
-
*/
|
|
4403
3329
|
class TimeMagicPipe extends DatePipe {
|
|
4404
3330
|
constructor(_task) {
|
|
4405
3331
|
super('en-US');
|
|
@@ -4435,33 +3361,20 @@ class TimeMagicPipe extends DatePipe {
|
|
|
4435
3361
|
return value;
|
|
4436
3362
|
}
|
|
4437
3363
|
}
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
3364
|
+
TimeMagicPipe.ɵfac = function TimeMagicPipe_Factory(t) { return new (t || TimeMagicPipe)(ɵɵdirectiveInject(TaskMagicService)); };
|
|
3365
|
+
TimeMagicPipe.ɵpipe = ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
|
3366
|
+
(function () { ɵsetClassMetadata(TimeMagicPipe, [{
|
|
4441
3367
|
type: Pipe,
|
|
4442
3368
|
args: [{
|
|
4443
3369
|
name: 'magicTime'
|
|
4444
3370
|
}]
|
|
4445
3371
|
}], function () { return [{ type: TaskMagicService }]; }, null); })();
|
|
4446
3372
|
|
|
4447
|
-
/**
|
|
4448
|
-
* Validates the field range.
|
|
4449
|
-
*/
|
|
4450
3373
|
class RangeValidatorMagicDirective {
|
|
4451
|
-
/**
|
|
4452
|
-
*
|
|
4453
|
-
* @param _task The task service
|
|
4454
|
-
* @param vcRef
|
|
4455
|
-
*/
|
|
4456
3374
|
constructor(_task, vcRef) {
|
|
4457
3375
|
this._task = _task;
|
|
4458
3376
|
this.vcRef = vcRef;
|
|
4459
3377
|
}
|
|
4460
|
-
/**
|
|
4461
|
-
* Validation method
|
|
4462
|
-
* @param c FormControl to validate
|
|
4463
|
-
* @returns If validation fails, return error message, else returns null
|
|
4464
|
-
*/
|
|
4465
3378
|
validate(c) {
|
|
4466
3379
|
let controlName;
|
|
4467
3380
|
controlName = this.getControlName(c);
|
|
@@ -4483,23 +3396,20 @@ class RangeValidatorMagicDirective {
|
|
|
4483
3396
|
};
|
|
4484
3397
|
}
|
|
4485
3398
|
}
|
|
4486
|
-
/**
|
|
4487
|
-
* @ignore
|
|
4488
|
-
*/
|
|
4489
3399
|
getControlName(c) {
|
|
4490
3400
|
const formGroup = c.parent.controls;
|
|
4491
3401
|
return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
|
|
4492
3402
|
}
|
|
4493
3403
|
}
|
|
4494
|
-
|
|
4495
|
-
|
|
3404
|
+
RangeValidatorMagicDirective.ɵfac = function RangeValidatorMagicDirective_Factory(t) { return new (t || RangeValidatorMagicDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ViewContainerRef)); };
|
|
3405
|
+
RangeValidatorMagicDirective.ɵdir = ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [ɵɵProvidersFeature([
|
|
4496
3406
|
{
|
|
4497
3407
|
provide: NG_VALIDATORS,
|
|
4498
3408
|
useExisting: RangeValidatorMagicDirective,
|
|
4499
3409
|
multi: true,
|
|
4500
3410
|
}
|
|
4501
3411
|
])] });
|
|
4502
|
-
|
|
3412
|
+
(function () { ɵsetClassMetadata(RangeValidatorMagicDirective, [{
|
|
4503
3413
|
type: Directive,
|
|
4504
3414
|
args: [{
|
|
4505
3415
|
selector: '[rangevalidator] ',
|
|
@@ -4519,48 +3429,29 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
4519
3429
|
const ctx_r0 = ɵɵnextContext();
|
|
4520
3430
|
ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
|
4521
3431
|
} }
|
|
4522
|
-
/**
|
|
4523
|
-
* Represents a Magic subform
|
|
4524
|
-
*/
|
|
4525
3432
|
class SubformMagicComponent {
|
|
4526
|
-
/**
|
|
4527
|
-
* @ignore
|
|
4528
|
-
*/
|
|
4529
3433
|
constructor(vcRef, mgSub) {
|
|
4530
3434
|
this.vcRef = vcRef;
|
|
4531
3435
|
this.mgSub = mgSub;
|
|
4532
|
-
/**
|
|
4533
|
-
* @ignore
|
|
4534
|
-
*/
|
|
4535
3436
|
this.component = null;
|
|
4536
|
-
// For angular 10 - find the component from views
|
|
4537
3437
|
this.component = (this.vcRef._hostView).find(v => !isNullOrUndefined(v));
|
|
4538
3438
|
}
|
|
4539
|
-
/**
|
|
4540
|
-
* @ignore
|
|
4541
|
-
*/
|
|
4542
3439
|
set magic(val) { this.id = val; }
|
|
4543
3440
|
;
|
|
4544
|
-
/**
|
|
4545
|
-
* @ignore
|
|
4546
|
-
*/
|
|
4547
3441
|
get Component() {
|
|
4548
3442
|
return this.mgSub.mgGetComp(this.id);
|
|
4549
3443
|
}
|
|
4550
|
-
/**
|
|
4551
|
-
* @ignore
|
|
4552
|
-
*/
|
|
4553
3444
|
get Parameters() {
|
|
4554
3445
|
return this.mgSub.mgGetParameters(this.id);
|
|
4555
3446
|
}
|
|
4556
3447
|
}
|
|
4557
|
-
|
|
4558
|
-
|
|
3448
|
+
SubformMagicComponent.ɵfac = function SubformMagicComponent_Factory(t) { return new (t || SubformMagicComponent)(ɵɵdirectiveInject(ViewContainerRef), ɵɵdirectiveInject(SubformMagicService)); };
|
|
3449
|
+
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
3450
|
ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
|
4560
3451
|
} if (rf & 2) {
|
|
4561
3452
|
ɵɵproperty("ngIf", ctx.Component);
|
|
4562
3453
|
} }, directives: [NgIf, DynamicComponent, DynamicIoDirective], encapsulation: 2 });
|
|
4563
|
-
|
|
3454
|
+
(function () { ɵsetClassMetadata(SubformMagicComponent, [{
|
|
4564
3455
|
type: Component,
|
|
4565
3456
|
args: [{
|
|
4566
3457
|
selector: 'magic-subform',
|
|
@@ -4600,24 +3491,14 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
4600
3491
|
ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
|
|
4601
3492
|
} }
|
|
4602
3493
|
const _c1$1 = ["*"];
|
|
4603
|
-
/**
|
|
4604
|
-
* Represents a Magic subform
|
|
4605
|
-
*/
|
|
4606
3494
|
class ErrorMagicComponent {
|
|
4607
|
-
/**
|
|
4608
|
-
* @ignore
|
|
4609
|
-
*/
|
|
4610
3495
|
constructor(_task, mgService, changeDetectorRef) {
|
|
4611
3496
|
this._task = _task;
|
|
4612
3497
|
this.mgService = mgService;
|
|
4613
3498
|
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
3499
|
this.defaultDisplay = true;
|
|
4616
3500
|
this.rowId = "0";
|
|
4617
3501
|
}
|
|
4618
|
-
/**
|
|
4619
|
-
* @ignore
|
|
4620
|
-
*/
|
|
4621
3502
|
set magic(val) {
|
|
4622
3503
|
this.id = val;
|
|
4623
3504
|
}
|
|
@@ -4631,10 +3512,6 @@ class ErrorMagicComponent {
|
|
|
4631
3512
|
this.changeDetectorRef.detectChanges();
|
|
4632
3513
|
}
|
|
4633
3514
|
;
|
|
4634
|
-
/**
|
|
4635
|
-
* returns true if the html element has no children
|
|
4636
|
-
* @param element
|
|
4637
|
-
*/
|
|
4638
3515
|
isEmpty(element) {
|
|
4639
3516
|
const nodes = element.childNodes;
|
|
4640
3517
|
for (let i = 0; i < nodes.length; i++) {
|
|
@@ -4645,9 +3522,6 @@ class ErrorMagicComponent {
|
|
|
4645
3522
|
}
|
|
4646
3523
|
return true;
|
|
4647
3524
|
}
|
|
4648
|
-
/**
|
|
4649
|
-
* @ignore
|
|
4650
|
-
*/
|
|
4651
3525
|
HasErrors(id) {
|
|
4652
3526
|
if (!isUndefined(id)) {
|
|
4653
3527
|
let control = this._task.getFormControl(this.rowId, id);
|
|
@@ -4669,8 +3543,8 @@ class ErrorMagicComponent {
|
|
|
4669
3543
|
return false;
|
|
4670
3544
|
}
|
|
4671
3545
|
}
|
|
4672
|
-
|
|
4673
|
-
|
|
3546
|
+
ErrorMagicComponent.ɵfac = function ErrorMagicComponent_Factory(t) { return new (t || ErrorMagicComponent)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(AccessorMagicService), ɵɵdirectiveInject(ChangeDetectorRef)); };
|
|
3547
|
+
ErrorMagicComponent.ɵcmp = ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
|
4674
3548
|
ɵɵviewQuery(_c0$2, true);
|
|
4675
3549
|
} if (rf & 2) {
|
|
4676
3550
|
var _t;
|
|
@@ -4681,7 +3555,7 @@ class ErrorMagicComponent {
|
|
|
4681
3555
|
} if (rf & 2) {
|
|
4682
3556
|
ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
|
4683
3557
|
} }, directives: [NgIf], encapsulation: 2 });
|
|
4684
|
-
|
|
3558
|
+
(function () { ɵsetClassMetadata(ErrorMagicComponent, [{
|
|
4685
3559
|
type: Component,
|
|
4686
3560
|
args: [{
|
|
4687
3561
|
selector: 'mgError',
|
|
@@ -4706,28 +3580,19 @@ class ErrorMagicComponent {
|
|
|
4706
3580
|
args: ['customContent', { static: false }]
|
|
4707
3581
|
}] }); })();
|
|
4708
3582
|
|
|
4709
|
-
/**
|
|
4710
|
-
* Directive for checkboxes, to handle the 'change' event
|
|
4711
|
-
*/
|
|
4712
3583
|
class CheckboxMagicDirective {
|
|
4713
|
-
/**
|
|
4714
|
-
* @ignore
|
|
4715
|
-
*/
|
|
4716
3584
|
constructor(magicDirective) {
|
|
4717
3585
|
this.magicDirective = magicDirective;
|
|
4718
3586
|
}
|
|
4719
|
-
/**
|
|
4720
|
-
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
|
4721
|
-
*/
|
|
4722
3587
|
onChange($event) {
|
|
4723
3588
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
4724
3589
|
}
|
|
4725
3590
|
}
|
|
4726
|
-
|
|
4727
|
-
|
|
3591
|
+
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3592
|
+
CheckboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4728
3593
|
ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
4729
3594
|
} } });
|
|
4730
|
-
|
|
3595
|
+
(function () { ɵsetClassMetadata(CheckboxMagicDirective, [{
|
|
4731
3596
|
type: Directive,
|
|
4732
3597
|
args: [{
|
|
4733
3598
|
selector: `
|
|
@@ -4739,25 +3604,19 @@ class CheckboxMagicDirective {
|
|
|
4739
3604
|
args: ['change', ['$event']]
|
|
4740
3605
|
}] }); })();
|
|
4741
3606
|
|
|
4742
|
-
/**
|
|
4743
|
-
* Directive for comboboxes, to handle the 'change' event
|
|
4744
|
-
*/
|
|
4745
3607
|
class ComboboxMagicDirective {
|
|
4746
3608
|
constructor(magicDirective) {
|
|
4747
3609
|
this.magicDirective = magicDirective;
|
|
4748
3610
|
}
|
|
4749
|
-
/**
|
|
4750
|
-
* Handles the Combobox 'change' event - pass it to the Magic engine
|
|
4751
|
-
*/
|
|
4752
3611
|
onChange($event) {
|
|
4753
3612
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
4754
3613
|
}
|
|
4755
3614
|
}
|
|
4756
|
-
|
|
4757
|
-
|
|
3615
|
+
ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3616
|
+
ComboboxMagicDirective.ɵdir = ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4758
3617
|
ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
4759
3618
|
} } });
|
|
4760
|
-
|
|
3619
|
+
(function () { ɵsetClassMetadata(ComboboxMagicDirective, [{
|
|
4761
3620
|
type: Directive,
|
|
4762
3621
|
args: [{
|
|
4763
3622
|
selector: `select[magic]:not([multiple])`,
|
|
@@ -4767,20 +3626,14 @@ class ComboboxMagicDirective {
|
|
|
4767
3626
|
args: ['change', ['$event']]
|
|
4768
3627
|
}] }); })();
|
|
4769
3628
|
|
|
4770
|
-
/**
|
|
4771
|
-
* This service supports custom actions on magic exit
|
|
4772
|
-
*/
|
|
4773
3629
|
class ExitMagicService {
|
|
4774
|
-
/**
|
|
4775
|
-
* Override this method to implement custom logic on magic exit
|
|
4776
|
-
*/
|
|
4777
3630
|
exitMagic() {
|
|
4778
3631
|
console.log("Magic application terminated");
|
|
4779
3632
|
}
|
|
4780
3633
|
}
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
3634
|
+
ExitMagicService.ɵfac = function ExitMagicService_Factory(t) { return new (t || ExitMagicService)(); };
|
|
3635
|
+
ExitMagicService.ɵprov = ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
|
3636
|
+
(function () { ɵsetClassMetadata(ExitMagicService, [{
|
|
4784
3637
|
type: Injectable
|
|
4785
3638
|
}], null, null); })();
|
|
4786
3639
|
|
|
@@ -4804,19 +3657,7 @@ function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
4804
3657
|
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
4805
3658
|
ɵɵelement(0, "div", 9);
|
|
4806
3659
|
} }
|
|
4807
|
-
/**
|
|
4808
|
-
* Root Magic component
|
|
4809
|
-
*/
|
|
4810
3660
|
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
3661
|
constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, exitMagicService) {
|
|
4821
3662
|
this.engineMagicService = engineMagicService;
|
|
4822
3663
|
this.componentList = componentList;
|
|
@@ -4826,32 +3667,22 @@ class MagicShellComponent {
|
|
|
4826
3667
|
this.httpClient = httpClient;
|
|
4827
3668
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
|
4828
3669
|
this.exitMagicService = exitMagicService;
|
|
4829
|
-
/**
|
|
4830
|
-
* Root component to be displayed in the window
|
|
4831
|
-
*/
|
|
4832
3670
|
this.RootComponent = null;
|
|
4833
3671
|
this.magicEngineTerminated = false;
|
|
4834
3672
|
this.initialize();
|
|
4835
3673
|
this.setTitle();
|
|
4836
3674
|
}
|
|
4837
|
-
/**
|
|
4838
|
-
* Before-unload event listener
|
|
4839
|
-
* @param event
|
|
4840
|
-
*/
|
|
4841
3675
|
onBeforeUnload(event) {
|
|
4842
3676
|
if (this.engineMagicService.TransCacheExists()) {
|
|
4843
|
-
// Show the confirmation box before unloading the browser
|
|
4844
3677
|
event.returnValue = 'Are you sure?';
|
|
4845
3678
|
return 'Are you sure?';
|
|
4846
3679
|
}
|
|
4847
3680
|
else {
|
|
4848
|
-
// terminate the magic server context using fetch API with keep-alive
|
|
4849
3681
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
4850
3682
|
this.magicEngineTerminated = true;
|
|
4851
3683
|
}
|
|
4852
3684
|
}
|
|
4853
3685
|
onUnload(event) {
|
|
4854
|
-
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
|
4855
3686
|
if (!this.magicEngineTerminated)
|
|
4856
3687
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
|
4857
3688
|
}
|
|
@@ -4862,26 +3693,13 @@ class MagicShellComponent {
|
|
|
4862
3693
|
setViewContainerRef(vcRef) {
|
|
4863
3694
|
this.overlayWindowsContainerViewRef = vcRef;
|
|
4864
3695
|
}
|
|
4865
|
-
/**
|
|
4866
|
-
* Initialization of Magic mechanisms
|
|
4867
|
-
*/
|
|
4868
3696
|
initialize() {
|
|
4869
3697
|
this.registerUICommands();
|
|
4870
3698
|
}
|
|
4871
|
-
/**
|
|
4872
|
-
* Set the title
|
|
4873
|
-
*/
|
|
4874
3699
|
setTitle() {
|
|
4875
3700
|
const newTitle = this.componentList.title;
|
|
4876
3701
|
this.titleService.setTitle(newTitle);
|
|
4877
3702
|
}
|
|
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
3703
|
setComponent(formName, taskId, taskDescription, isModal) {
|
|
4886
3704
|
this.pendingCommandsCollector.startCollecting();
|
|
4887
3705
|
if (isModal) {
|
|
@@ -4893,9 +3711,6 @@ class MagicShellComponent {
|
|
|
4893
3711
|
}
|
|
4894
3712
|
this.changeDetectorRef.detectChanges();
|
|
4895
3713
|
}
|
|
4896
|
-
/**
|
|
4897
|
-
* @ignore
|
|
4898
|
-
*/
|
|
4899
3714
|
registerUICommands() {
|
|
4900
3715
|
this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
|
|
4901
3716
|
.subscribe(command => {
|
|
@@ -4907,10 +3722,6 @@ class MagicShellComponent {
|
|
|
4907
3722
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
|
|
4908
3723
|
});
|
|
4909
3724
|
}
|
|
4910
|
-
/**
|
|
4911
|
-
* Execute commands received from the Magic WebClient engine
|
|
4912
|
-
* @param command
|
|
4913
|
-
*/
|
|
4914
3725
|
executeCommand(command) {
|
|
4915
3726
|
switch (command.CommandType) {
|
|
4916
3727
|
case CommandType.OPEN_FORM:
|
|
@@ -4925,7 +3736,7 @@ class MagicShellComponent {
|
|
|
4925
3736
|
this.RootComponentParameters = {};
|
|
4926
3737
|
this.changeDetectorRef.detectChanges();
|
|
4927
3738
|
}
|
|
4928
|
-
else {
|
|
3739
|
+
else {
|
|
4929
3740
|
this.overlayWindowService.close(command.str);
|
|
4930
3741
|
this.changeDetectorRef.detectChanges();
|
|
4931
3742
|
}
|
|
@@ -4943,20 +3754,21 @@ class MagicShellComponent {
|
|
|
4943
3754
|
if (this.exitMagicService)
|
|
4944
3755
|
this.exitMagicService.exitMagic();
|
|
4945
3756
|
break;
|
|
3757
|
+
case CommandType.SHOW_HTML_ERROR:
|
|
3758
|
+
window.document.write(command.str);
|
|
3759
|
+
break;
|
|
4946
3760
|
}
|
|
4947
3761
|
}
|
|
4948
3762
|
}
|
|
4949
|
-
|
|
4950
|
-
|
|
3763
|
+
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)); };
|
|
3764
|
+
MagicShellComponent.ɵcmp = ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
|
4951
3765
|
ɵɵstaticViewQuery(_c0$3, true);
|
|
4952
3766
|
} if (rf & 2) {
|
|
4953
3767
|
var _t;
|
|
4954
3768
|
ɵɵqueryRefresh(_t = ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
|
4955
3769
|
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
4956
3770
|
ɵɵ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) {
|
|
3771
|
+
} }, 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
3772
|
ɵɵelementStart(0, "div", null, 0);
|
|
4961
3773
|
ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 1);
|
|
4962
3774
|
ɵɵelement(3, "div", 2, 3);
|
|
@@ -4969,13 +3781,11 @@ class MagicShellComponent {
|
|
|
4969
3781
|
ɵɵadvance(3);
|
|
4970
3782
|
ɵɵproperty("ngIf", ctx.showSpinner);
|
|
4971
3783
|
} }, 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
|
-
|
|
3784
|
+
(function () { ɵsetClassMetadata(MagicShellComponent, [{
|
|
4973
3785
|
type: Component,
|
|
4974
3786
|
args: [{
|
|
4975
3787
|
selector: 'magic-root',
|
|
4976
|
-
providers: [
|
|
4977
|
-
// ExitMagicService
|
|
4978
|
-
],
|
|
3788
|
+
providers: [],
|
|
4979
3789
|
template: `
|
|
4980
3790
|
<div #magicRoot>
|
|
4981
3791
|
<ndc-dynamic
|
|
@@ -5042,25 +3852,19 @@ class MagicShellComponent {
|
|
|
5042
3852
|
args: ['window:unload', ['$event']]
|
|
5043
3853
|
}] }); })();
|
|
5044
3854
|
|
|
5045
|
-
/**
|
|
5046
|
-
* @ignore
|
|
5047
|
-
*/
|
|
5048
3855
|
const CHECKBOX_VALUE_ACCESSOR = {
|
|
5049
3856
|
provide: NG_VALUE_ACCESSOR,
|
|
5050
3857
|
useExisting: forwardRef(() => MagicCheckboxControlValueAccessor),
|
|
5051
3858
|
multi: true,
|
|
5052
3859
|
};
|
|
5053
|
-
/**
|
|
5054
|
-
* Value accessor for Checkbox without a FormControl
|
|
5055
|
-
*/
|
|
5056
3860
|
class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
|
5057
3861
|
}
|
|
5058
|
-
|
|
5059
|
-
|
|
3862
|
+
MagicCheckboxControlValueAccessor.ɵfac = function MagicCheckboxControlValueAccessor_Factory(t) { return ɵMagicCheckboxControlValueAccessor_BaseFactory(t || MagicCheckboxControlValueAccessor); };
|
|
3863
|
+
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
3864
|
ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5061
3865
|
} }, features: [ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
|
|
5062
|
-
const ɵMagicCheckboxControlValueAccessor_BaseFactory =
|
|
5063
|
-
|
|
3866
|
+
const ɵMagicCheckboxControlValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor);
|
|
3867
|
+
(function () { ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
|
5064
3868
|
type: Directive,
|
|
5065
3869
|
args: [{
|
|
5066
3870
|
selector: `
|
|
@@ -5073,25 +3877,19 @@ const ɵMagicCheckboxControlValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInh
|
|
|
5073
3877
|
}]
|
|
5074
3878
|
}], null, null); })();
|
|
5075
3879
|
|
|
5076
|
-
/**
|
|
5077
|
-
* @ignore
|
|
5078
|
-
*/
|
|
5079
3880
|
const MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
|
5080
3881
|
provide: NG_VALUE_ACCESSOR,
|
|
5081
3882
|
useExisting: forwardRef(() => MagicDefaultValueAccessor),
|
|
5082
3883
|
multi: true
|
|
5083
3884
|
};
|
|
5084
|
-
/**
|
|
5085
|
-
* @ignore
|
|
5086
|
-
*/
|
|
5087
3885
|
class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
5088
3886
|
}
|
|
5089
|
-
|
|
5090
|
-
|
|
3887
|
+
MagicDefaultValueAccessor.ɵfac = function MagicDefaultValueAccessor_Factory(t) { return ɵMagicDefaultValueAccessor_BaseFactory(t || MagicDefaultValueAccessor); };
|
|
3888
|
+
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
3889
|
ɵɵ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
3890
|
} }, exportAs: ["magic"], features: [ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), ɵɵInheritDefinitionFeature] });
|
|
5093
|
-
const ɵMagicDefaultValueAccessor_BaseFactory =
|
|
5094
|
-
|
|
3891
|
+
const ɵMagicDefaultValueAccessor_BaseFactory = ɵɵgetInheritedFactory(MagicDefaultValueAccessor);
|
|
3892
|
+
(function () { ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
|
5095
3893
|
type: Directive,
|
|
5096
3894
|
args: [{
|
|
5097
3895
|
selector: `
|
|
@@ -5109,25 +3907,19 @@ const ɵMagicDefaultValueAccessor_BaseFactory = /*@__PURE__*/ ɵɵgetInheritedFa
|
|
|
5109
3907
|
}]
|
|
5110
3908
|
}], null, null); })();
|
|
5111
3909
|
|
|
5112
|
-
/**
|
|
5113
|
-
* Directive for checkboxes which should not have a form control
|
|
5114
|
-
*/
|
|
5115
3910
|
class CheckboxNoFormControlMagicDirective {
|
|
5116
3911
|
constructor(magicDirective) {
|
|
5117
3912
|
this.magicDirective = magicDirective;
|
|
5118
3913
|
}
|
|
5119
|
-
/**
|
|
5120
|
-
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
|
5121
|
-
*/
|
|
5122
3914
|
onChange($event) {
|
|
5123
3915
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
|
5124
3916
|
}
|
|
5125
3917
|
}
|
|
5126
|
-
|
|
5127
|
-
|
|
3918
|
+
CheckboxNoFormControlMagicDirective.ɵfac = function CheckboxNoFormControlMagicDirective_Factory(t) { return new (t || CheckboxNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3919
|
+
CheckboxNoFormControlMagicDirective.ɵdir = ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5128
3920
|
ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5129
3921
|
} } });
|
|
5130
|
-
|
|
3922
|
+
(function () { ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
|
5131
3923
|
type: Directive,
|
|
5132
3924
|
args: [{
|
|
5133
3925
|
selector: `
|
|
@@ -5139,25 +3931,19 @@ class CheckboxNoFormControlMagicDirective {
|
|
|
5139
3931
|
args: ['change', ['$event']]
|
|
5140
3932
|
}] }); })();
|
|
5141
3933
|
|
|
5142
|
-
/**
|
|
5143
|
-
* Directive for non-checkbox input controls which do not have a form control
|
|
5144
|
-
*/
|
|
5145
3934
|
class InputNoFormControlMagicDirective {
|
|
5146
3935
|
constructor(magicDirective) {
|
|
5147
3936
|
this.magicDirective = magicDirective;
|
|
5148
3937
|
}
|
|
5149
|
-
/**
|
|
5150
|
-
* Handles the 'change' event - pass it to the Magic engine
|
|
5151
|
-
*/
|
|
5152
3938
|
onChange($event) {
|
|
5153
3939
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
|
5154
3940
|
}
|
|
5155
3941
|
}
|
|
5156
|
-
|
|
5157
|
-
|
|
3942
|
+
InputNoFormControlMagicDirective.ɵfac = function InputNoFormControlMagicDirective_Factory(t) { return new (t || InputNoFormControlMagicDirective)(ɵɵdirectiveInject(MagicDirective)); };
|
|
3943
|
+
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
3944
|
ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
|
5159
3945
|
} } });
|
|
5160
|
-
|
|
3946
|
+
(function () { ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
|
5161
3947
|
type: Directive,
|
|
5162
3948
|
args: [{
|
|
5163
3949
|
selector: `input[magic]:([noFormControl]):not([type=checkbox]),
|
|
@@ -5173,14 +3959,6 @@ const DATE_VALUE_ACCESSOR = {
|
|
|
5173
3959
|
useExisting: forwardRef(() => DateValueAccessor),
|
|
5174
3960
|
multi: true
|
|
5175
3961
|
};
|
|
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
3962
|
class DateValueAccessor {
|
|
5185
3963
|
constructor(renderer, elementRef) {
|
|
5186
3964
|
this.renderer = renderer;
|
|
@@ -5188,7 +3966,6 @@ class DateValueAccessor {
|
|
|
5188
3966
|
this.onChange = (_) => { };
|
|
5189
3967
|
this.onTouched = () => { };
|
|
5190
3968
|
}
|
|
5191
|
-
/** Writes a new value to the element (model -> view) */
|
|
5192
3969
|
writeValue(value) {
|
|
5193
3970
|
if (!value) {
|
|
5194
3971
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
|
@@ -5196,26 +3973,23 @@ class DateValueAccessor {
|
|
|
5196
3973
|
}
|
|
5197
3974
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
|
5198
3975
|
}
|
|
5199
|
-
/** Registers a callback function, called when value changes (view -> model) */
|
|
5200
3976
|
registerOnChange(fn) {
|
|
5201
3977
|
this.onChange = v => fn(v instanceof Date
|
|
5202
3978
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
|
5203
3979
|
: v);
|
|
5204
3980
|
}
|
|
5205
|
-
/** Registers a callback function, called when the control is blurred */
|
|
5206
3981
|
registerOnTouched(fn) {
|
|
5207
3982
|
this.onTouched = fn;
|
|
5208
3983
|
}
|
|
5209
|
-
/** Enables or disables the element when the control status changes */
|
|
5210
3984
|
setDisabledState(isDisabled) {
|
|
5211
3985
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
|
5212
3986
|
}
|
|
5213
3987
|
}
|
|
5214
|
-
|
|
5215
|
-
|
|
3988
|
+
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ElementRef)); };
|
|
3989
|
+
DateValueAccessor.ɵdir = ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
|
5216
3990
|
ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
|
5217
3991
|
} }, features: [ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
|
5218
|
-
|
|
3992
|
+
(function () { ɵsetClassMetadata(DateValueAccessor, [{
|
|
5219
3993
|
type: Directive,
|
|
5220
3994
|
args: [{
|
|
5221
3995
|
selector: "[dateInput]",
|
|
@@ -5229,25 +4003,12 @@ class DateValueAccessor {
|
|
|
5229
4003
|
args: ["blur", []]
|
|
5230
4004
|
}] }); })();
|
|
5231
4005
|
|
|
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
4006
|
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
4007
|
constructor(_task, element, renderer, vcRef) {
|
|
5244
4008
|
this._task = _task;
|
|
5245
4009
|
this.element = element;
|
|
5246
4010
|
this.renderer = renderer;
|
|
5247
4011
|
this.vcRef = vcRef;
|
|
5248
|
-
/**
|
|
5249
|
-
* Collection of event handlers for this element
|
|
5250
|
-
*/
|
|
5251
4012
|
this.eventHandlers = {};
|
|
5252
4013
|
this.eventsOnlyVal = false;
|
|
5253
4014
|
this.htmlElement = this.element.nativeElement;
|
|
@@ -5257,40 +4018,26 @@ class NonMagicControlDirective {
|
|
|
5257
4018
|
this.selector = 'NonMagicControl';
|
|
5258
4019
|
}
|
|
5259
4020
|
;
|
|
5260
|
-
/**
|
|
5261
|
-
* Get the task service
|
|
5262
|
-
* @returns
|
|
5263
|
-
*/
|
|
5264
4021
|
get task() {
|
|
5265
4022
|
return this._task;
|
|
5266
4023
|
}
|
|
5267
|
-
/**
|
|
5268
|
-
* Register to the events this element may need to handle
|
|
5269
|
-
*/
|
|
5270
4024
|
regEvents() {
|
|
5271
|
-
// Handle events for which event handler may be removed and restored
|
|
5272
4025
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
|
5273
4026
|
Object.keys(this.eventHandlers).forEach((key) => {
|
|
5274
4027
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
|
5275
4028
|
});
|
|
5276
4029
|
}
|
|
5277
|
-
/**
|
|
5278
|
-
* Handle focus event
|
|
5279
|
-
*/
|
|
5280
4030
|
OnFocus() {
|
|
5281
4031
|
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', "", -1));
|
|
5282
4032
|
event.cancelBubble = true;
|
|
5283
4033
|
}
|
|
5284
|
-
/**
|
|
5285
|
-
* Initialize this object
|
|
5286
|
-
*/
|
|
5287
4034
|
ngOnInit() {
|
|
5288
4035
|
this.regEvents();
|
|
5289
4036
|
}
|
|
5290
4037
|
}
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
4038
|
+
NonMagicControlDirective.ɵfac = function NonMagicControlDirective_Factory(t) { return new (t || NonMagicControlDirective)(ɵɵdirectiveInject(TaskMagicService), ɵɵdirectiveInject(ElementRef), ɵɵdirectiveInject(Renderer2), ɵɵdirectiveInject(ViewContainerRef)); };
|
|
4039
|
+
NonMagicControlDirective.ɵdir = ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: ["NonMagicControl", "magic"] } });
|
|
4040
|
+
(function () { ɵsetClassMetadata(NonMagicControlDirective, [{
|
|
5294
4041
|
type: Directive,
|
|
5295
4042
|
args: [{
|
|
5296
4043
|
selector: '[NonMagicControl]'
|
|
@@ -5300,9 +4047,6 @@ class NonMagicControlDirective {
|
|
|
5300
4047
|
args: ['NonMagicControl']
|
|
5301
4048
|
}] }); })();
|
|
5302
4049
|
|
|
5303
|
-
/**
|
|
5304
|
-
* @ignore
|
|
5305
|
-
*/
|
|
5306
4050
|
const decs = [
|
|
5307
4051
|
MagicDirective,
|
|
5308
4052
|
CheckboxMagicDirective,
|
|
@@ -5333,9 +4077,6 @@ const decs = [
|
|
|
5333
4077
|
MagicFocusDirective,
|
|
5334
4078
|
MagicViewContainerRef
|
|
5335
4079
|
];
|
|
5336
|
-
/**
|
|
5337
|
-
* @ignore
|
|
5338
|
-
*/
|
|
5339
4080
|
class MagicModule {
|
|
5340
4081
|
static forRoot() {
|
|
5341
4082
|
return {
|
|
@@ -5350,12 +4091,11 @@ class MagicModule {
|
|
|
5350
4091
|
};
|
|
5351
4092
|
}
|
|
5352
4093
|
}
|
|
5353
|
-
|
|
5354
|
-
|
|
4094
|
+
MagicModule.ɵmod = ɵɵdefineNgModule({ type: MagicModule });
|
|
4095
|
+
MagicModule.ɵinj = ɵɵdefineInjector({ factory: function MagicModule_Factory(t) { return new (t || MagicModule)(); }, providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
|
|
5355
4096
|
CommonModule,
|
|
5356
4097
|
FormsModule,
|
|
5357
4098
|
ReactiveFormsModule,
|
|
5358
|
-
//ThemeModule,
|
|
5359
4099
|
RouterModule,
|
|
5360
4100
|
DynamicModule,
|
|
5361
4101
|
HttpClientModule
|
|
@@ -5390,7 +4130,6 @@ class MagicModule {
|
|
|
5390
4130
|
MagicViewContainerRef], imports: [CommonModule,
|
|
5391
4131
|
FormsModule,
|
|
5392
4132
|
ReactiveFormsModule,
|
|
5393
|
-
//ThemeModule,
|
|
5394
4133
|
RouterModule,
|
|
5395
4134
|
DynamicModule,
|
|
5396
4135
|
HttpClientModule], exports: [MagicDirective,
|
|
@@ -5421,7 +4160,7 @@ class MagicModule {
|
|
|
5421
4160
|
NonMagicControlDirective,
|
|
5422
4161
|
MagicFocusDirective,
|
|
5423
4162
|
MagicViewContainerRef] }); })();
|
|
5424
|
-
|
|
4163
|
+
(function () { ɵsetClassMetadata(MagicModule, [{
|
|
5425
4164
|
type: NgModule,
|
|
5426
4165
|
args: [{
|
|
5427
4166
|
declarations: [...decs],
|
|
@@ -5431,12 +4170,10 @@ class MagicModule {
|
|
|
5431
4170
|
CommonModule,
|
|
5432
4171
|
FormsModule,
|
|
5433
4172
|
ReactiveFormsModule,
|
|
5434
|
-
//ThemeModule,
|
|
5435
4173
|
RouterModule,
|
|
5436
4174
|
DynamicModule,
|
|
5437
4175
|
HttpClientModule
|
|
5438
4176
|
],
|
|
5439
|
-
//Customizable providers
|
|
5440
4177
|
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider]
|
|
5441
4178
|
}]
|
|
5442
4179
|
}], null, null); })();
|
|
@@ -5524,7 +4261,7 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
5524
4261
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
|
5525
4262
|
if (displayFormat === 'input') {
|
|
5526
4263
|
if (this.mgdtfmt == null)
|
|
5527
|
-
this.mgdtfmt = 'M/d/yyyy';
|
|
4264
|
+
this.mgdtfmt = 'M/d/yyyy';
|
|
5528
4265
|
return formatDate(date, this.mgdtfmt, this.locale);
|
|
5529
4266
|
}
|
|
5530
4267
|
else {
|
|
@@ -5532,9 +4269,9 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
|
5532
4269
|
}
|
|
5533
4270
|
}
|
|
5534
4271
|
}
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
4272
|
+
MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(ɵɵinject(Platform), ɵɵinject(TaskMagicService)); };
|
|
4273
|
+
MgDateAdapter.ɵprov = ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
|
4274
|
+
(function () { ɵsetClassMetadata(MgDateAdapter, [{
|
|
5538
4275
|
type: Injectable
|
|
5539
4276
|
}], function () { return [{ type: Platform }, { type: TaskMagicService }]; }, null); })();
|
|
5540
4277
|
|
|
@@ -5542,9 +4279,6 @@ const matDateProviders = [
|
|
|
5542
4279
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
|
5543
4280
|
{ provide: MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
|
5544
4281
|
];
|
|
5545
|
-
/**
|
|
5546
|
-
* Magic service providers
|
|
5547
|
-
*/
|
|
5548
4282
|
const basicMagicProviders = [
|
|
5549
4283
|
MagicServices,
|
|
5550
4284
|
TaskMagicService,
|
|
@@ -5558,18 +4292,7 @@ const magicProviders = [
|
|
|
5558
4292
|
TableMagicService
|
|
5559
4293
|
];
|
|
5560
4294
|
|
|
5561
|
-
/**
|
|
5562
|
-
* @ignore
|
|
5563
|
-
*/
|
|
5564
|
-
///////////////////////////////////////////////////////////
|
|
5565
|
-
// class to hold gui-related helper methods
|
|
5566
|
-
///////////////////////////////////////////////////////////
|
|
5567
4295
|
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
4296
|
static addChildren(parent, children, selector) {
|
|
5574
4297
|
for (var i = 0; i < parent.children.length; i++) {
|
|
5575
4298
|
if (typeof parent.children[i].attributes[selector] !== "undefined") {
|
|
@@ -5578,9 +4301,6 @@ class utils {
|
|
|
5578
4301
|
this.addChildren(parent.children[i], children, selector);
|
|
5579
4302
|
}
|
|
5580
4303
|
}
|
|
5581
|
-
///////////////////////////////////////////////////////////
|
|
5582
|
-
// Calculate the distance between the control and the supplied x,y coordinates
|
|
5583
|
-
///////////////////////////////////////////////////////////
|
|
5584
4304
|
static getDistance(control, x, y) {
|
|
5585
4305
|
let left = control.clientLeft, top = control.clientTop;
|
|
5586
4306
|
let dx, dy;
|
|
@@ -5607,9 +4327,6 @@ class utils {
|
|
|
5607
4327
|
const ret = (dx * dx + dy * dy);
|
|
5608
4328
|
return ret;
|
|
5609
4329
|
}
|
|
5610
|
-
///////////////////////////////////////////////////////////
|
|
5611
|
-
//
|
|
5612
|
-
///////////////////////////////////////////////////////////
|
|
5613
4330
|
static getDimentions(el) {
|
|
5614
4331
|
let xPos = 0;
|
|
5615
4332
|
let yPos = 0;
|
|
@@ -5617,14 +4334,12 @@ class utils {
|
|
|
5617
4334
|
let height = el.height;
|
|
5618
4335
|
while (el) {
|
|
5619
4336
|
if (el.tagName == "BODY") {
|
|
5620
|
-
// deal with browser quirks with body/window/document and page scroll
|
|
5621
4337
|
let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
|
5622
4338
|
let yScroll = el.scrollTop || document.documentElement.scrollTop;
|
|
5623
4339
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
|
5624
4340
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
|
5625
4341
|
}
|
|
5626
4342
|
else {
|
|
5627
|
-
// for all other non-BODY elements
|
|
5628
4343
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
|
5629
4344
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
|
5630
4345
|
}
|
|
@@ -5639,9 +4354,6 @@ class utils {
|
|
|
5639
4354
|
}
|
|
5640
4355
|
}
|
|
5641
4356
|
|
|
5642
|
-
/**
|
|
5643
|
-
* @ignore
|
|
5644
|
-
*/
|
|
5645
4357
|
class ModalFormDefinition {
|
|
5646
4358
|
constructor() {
|
|
5647
4359
|
this.taskId = "";
|
|
@@ -5650,9 +4362,5 @@ class ModalFormDefinition {
|
|
|
5650
4362
|
}
|
|
5651
4363
|
}
|
|
5652
4364
|
|
|
5653
|
-
/**
|
|
5654
|
-
* Generated bundle index. Do not edit.
|
|
5655
|
-
*/
|
|
5656
|
-
|
|
5657
4365
|
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
4366
|
//# sourceMappingURL=magic-xpa-angular.js.map
|