@magic-xpa/angular 4.1200.0-dev4120.18 → 4.1200.0-dev4120.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/magic-xpa-angular.mjs +1990 -212
- package/fesm2022/magic-xpa-angular.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/package.json +6 -8
- package/src/controls.metadata.model.d.ts +16 -0
- package/src/interfaces/sub-form-definition.iterface.d.ts +6 -0
- package/src/magic.core.module.d.ts +5 -2
- package/src/services/OverlayWindowService.d.ts +19 -0
- package/src/services/StylesMapManager.d.ts +3 -0
- package/src/services/accessor.magic.service.d.ts +245 -3
- package/src/services/commands-collector.magic.service.d.ts +3 -0
- package/src/services/component-list.magic.service.d.ts +27 -0
- package/src/services/confirmation.components.magic.provider.d.ts +16 -0
- package/src/services/engine.magic.service.d.ts +5 -0
- package/src/services/exit.magic.service.d.ts +6 -0
- package/src/services/magic-color.service.d.ts +6 -0
- package/src/services/magic.providers.d.ts +3 -0
- package/src/services/magic.services.d.ts +6 -0
- package/src/services/router-commands.magic.service.d.ts +6 -0
- package/src/services/subform.magic.service.d.ts +28 -0
- package/src/services/table.magic.service.d.ts +56 -0
- package/src/services/task.magics.service.d.ts +305 -0
- package/src/services/title.magic.service.d.ts +11 -0
- package/src/ui/GuiInteractiveExecutor.d.ts +3 -0
- package/src/ui/components/base-magic-alert.component.d.ts +16 -0
- package/src/ui/components/base-magic-confirm.component.d.ts +18 -0
- package/src/ui/components/magic-alert.component.d.ts +3 -0
- package/src/ui/components/magic-confirmation-box.component.d.ts +3 -0
- package/src/ui/directives/NonMagicControlDirective.d.ts +41 -0
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +6 -0
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +12 -0
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +9 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +6 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +13 -0
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +6 -0
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +6 -0
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +3 -0
- package/src/ui/directives/magic/row.magic.directive.d.ts +15 -0
- package/src/ui/directives/magic-focus.directive.d.ts +3 -0
- package/src/ui/directives/magic.directive.d.ts +82 -0
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +3 -0
- package/src/ui/directives/mgformat.magic.directive.d.ts +44 -0
- package/src/ui/directives/range-validator.magic.directive.d.ts +16 -0
- package/src/ui/magic-confirmationBox.d.ts +19 -0
- package/src/ui/magic-modal/base-magic-overlay-container.d.ts +9 -0
- package/src/ui/magic-modal/magic-modal-form.d.ts +3 -0
- package/src/ui/magic-modal/magic-modal-interface.d.ts +35 -0
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +20 -0
- package/src/ui/magic-modal/magic-overlay-container.d.ts +87 -0
- package/src/ui/magic-root.component.d.ts +42 -0
- package/src/ui/mgerror.magic.component.d.ts +19 -0
- package/src/ui/pipes/date.magic.pipe.d.ts +6 -0
- package/src/ui/pipes/time.magic.pipe.d.ts +3 -0
- package/src/ui/router-container.magic.component.d.ts +21 -0
- package/src/ui/subform.magic.component.d.ts +21 -0
- package/src/ui/task-base.magic.component.d.ts +78 -0
- package/src/ui/utils.d.ts +3 -0
- package/esm2022/index.mjs +0 -59
- package/esm2022/magic-xpa-angular.mjs +0 -2
- package/esm2022/src/controls.metadata.model.mjs +0 -183
- package/esm2022/src/interfaces/sub-form-definition.iterface.mjs +0 -2
- package/esm2022/src/magic.core.module.mjs +0 -159
- package/esm2022/src/services/ISubformMagicService.mjs +0 -2
- package/esm2022/src/services/OverlayWindowService.mjs +0 -245
- package/esm2022/src/services/StylesMapManager.mjs +0 -28
- package/esm2022/src/services/accessor.magic.service.mjs +0 -358
- package/esm2022/src/services/commands-collector.magic.service.mjs +0 -47
- package/esm2022/src/services/component-list.magic.service.mjs +0 -45
- package/esm2022/src/services/confirmation.components.magic.provider.mjs +0 -21
- package/esm2022/src/services/engine.magic.service.mjs +0 -80
- package/esm2022/src/services/exit.magic.service.mjs +0 -13
- package/esm2022/src/services/magic-color.service.mjs +0 -101
- package/esm2022/src/services/magic.lazy.loader.service.mjs +0 -16
- package/esm2022/src/services/magic.providers.mjs +0 -25
- package/esm2022/src/services/magic.services.mjs +0 -36
- package/esm2022/src/services/mg-date-adapter.mjs +0 -108
- package/esm2022/src/services/overlay.conainer.magic.provider.mjs +0 -14
- package/esm2022/src/services/router-commands.magic.service.mjs +0 -31
- package/esm2022/src/services/subform.magic.service.mjs +0 -195
- package/esm2022/src/services/table.magic.service.mjs +0 -81
- package/esm2022/src/services/task.magics.service.mjs +0 -648
- package/esm2022/src/services/title.magic.service.mjs +0 -19
- package/esm2022/src/ui/GuiInteractiveExecutor.mjs +0 -114
- package/esm2022/src/ui/components/base-magic-alert.component.mjs +0 -24
- package/esm2022/src/ui/components/base-magic-confirm.component.mjs +0 -24
- package/esm2022/src/ui/components/magic-alert.component.mjs +0 -36
- package/esm2022/src/ui/components/magic-confirmation-box.component.mjs +0 -42
- package/esm2022/src/ui/directives/NonMagicControlDirective.mjs +0 -58
- package/esm2022/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.mjs +0 -29
- package/esm2022/src/ui/directives/magic/checkbox.magic.directive.mjs +0 -100
- package/esm2022/src/ui/directives/magic/combobox.magic.directive.mjs +0 -37
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.mjs +0 -27
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +0 -85
- package/esm2022/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.mjs +0 -32
- package/esm2022/src/ui/directives/magic/input.noformcontrol.magic.directive.mjs +0 -28
- package/esm2022/src/ui/directives/magic/nocontrol.magic.directive.mjs +0 -193
- package/esm2022/src/ui/directives/magic/row.magic.directive.mjs +0 -62
- package/esm2022/src/ui/directives/magic-focus.directive.mjs +0 -20
- package/esm2022/src/ui/directives/magic.directive.mjs +0 -232
- package/esm2022/src/ui/directives/magicViewContainerRef.directive.mjs +0 -20
- package/esm2022/src/ui/directives/mgformat.magic.directive.mjs +0 -579
- package/esm2022/src/ui/directives/range-validator.magic.directive.mjs +0 -60
- package/esm2022/src/ui/magic-confirmationBox.mjs +0 -42
- package/esm2022/src/ui/magic-modal/base-magic-overlay-container.mjs +0 -22
- package/esm2022/src/ui/magic-modal/magic-modal-form.mjs +0 -6
- package/esm2022/src/ui/magic-modal/magic-modal-interface.mjs +0 -2
- package/esm2022/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +0 -125
- package/esm2022/src/ui/magic-modal/magic-overlay-container.mjs +0 -162
- package/esm2022/src/ui/magic-root.component.mjs +0 -236
- package/esm2022/src/ui/mgerror.magic.component.mjs +0 -125
- package/esm2022/src/ui/pipes/date.magic.pipe.mjs +0 -106
- package/esm2022/src/ui/pipes/time.magic.pipe.mjs +0 -52
- package/esm2022/src/ui/pipes/time24.magic.pipe.mjs +0 -35
- package/esm2022/src/ui/router-container.magic.component.mjs +0 -115
- package/esm2022/src/ui/subform.magic.component.mjs +0 -56
- package/esm2022/src/ui/task-base.magic.component.mjs +0 -91
- package/esm2022/src/ui/utils.mjs +0 -54
@@ -1,6 +1,6 @@
|
|
1
1
|
import { isNullOrUndefined, NString, List, isUndefined, StringBuilder, RefParam } from '@magic-xpa/mscorelib';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { Injectable, Component, Input, Output, Directive, EventEmitter, ViewChild, InjectionToken, Inject,
|
3
|
+
import { Injectable, Component, Input, Output, Directive, EventEmitter, HostListener, ViewChild, InjectionToken, Inject, Optional, Pipe, forwardRef, NgModule } from '@angular/core';
|
4
4
|
import * as i1 from '@angular/common';
|
5
5
|
import { DatePipe, CommonModule, formatDate } from '@angular/common';
|
6
6
|
import * as i2 from '@angular/router';
|
@@ -8,20 +8,25 @@ import { NavigationEnd, RouterModule } from '@angular/router';
|
|
8
8
|
import { FormGroup, FormControl, Validators, NG_VALIDATORS, NG_VALUE_ACCESSOR, CheckboxControlValueAccessor, DefaultValueAccessor, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
9
9
|
import * as i3 from 'ng-dynamic-component';
|
10
10
|
import { DynamicModule } from 'ng-dynamic-component';
|
11
|
-
import { InteractiveCommandType, HtmlProperties, OverlayType, Styles, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
|
11
|
+
import { InteractiveCommandType, HtmlProperties, OverlayType, Styles, GuiConstants, CommandType, PIC, GuiEnvironment, Events, Modifiers } from '@magic-xpa/gui';
|
12
12
|
import { MagicBridge, getGuiEventObj, CookieService, Environment, LastFocusedManager } from '@magic-xpa/engine';
|
13
|
-
import { MagicProperties, Logger, StrUtil, StorageAttribute, PICInterface, BindingLevel, StorageAttributeType, MgControlType } from '@magic-xpa/utils';
|
13
|
+
import { MagicProperties, Logger, StrUtil, StorageAttribute, PICInterface, MsgInterface, BindingLevel, StorageAttributeType, MgControlType } from '@magic-xpa/utils';
|
14
14
|
import { filter, map, debounceTime } from 'rxjs/operators';
|
15
15
|
import { Subject, EMPTY, fromEvent } from 'rxjs';
|
16
16
|
import { __decorate, __metadata } from 'tslib';
|
17
|
+
import * as i2$1 from '@angular/cdk/drag-drop';
|
18
|
+
import { DragDropModule, CdkDragHandle, CdkDrag } from '@angular/cdk/drag-drop';
|
17
19
|
import * as i1$1 from '@angular/platform-browser';
|
18
20
|
import * as i1$2 from '@angular/common/http';
|
19
|
-
import {
|
21
|
+
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
20
22
|
import { maskitoTimeOptionsGenerator } from '@maskito/kit';
|
21
|
-
import * as i2$
|
23
|
+
import * as i2$2 from '@angular/cdk/platform';
|
22
24
|
import { MaskitoModule } from '@maskito/angular';
|
23
25
|
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
24
26
|
|
27
|
+
/**
|
28
|
+
* @ignore
|
29
|
+
*/
|
25
30
|
class ControlMetadata {
|
26
31
|
controlType;
|
27
32
|
dataType;
|
@@ -31,9 +36,11 @@ class ControlMetadata {
|
|
31
36
|
removedClass;
|
32
37
|
classes;
|
33
38
|
rangeValidator;
|
39
|
+
// user properties
|
34
40
|
userProperties = new Map();
|
35
41
|
customValidators = new Map();
|
36
42
|
setClass(key, value) {
|
43
|
+
// for no-control - hold the name of the class to be removed later
|
37
44
|
if (this.classesMap.has(key)) {
|
38
45
|
this.removedClass = this.classesMap.get(key);
|
39
46
|
}
|
@@ -48,8 +55,13 @@ class ControlMetadata {
|
|
48
55
|
this.stylesMap.set(key, value);
|
49
56
|
}
|
50
57
|
}
|
58
|
+
/**
|
59
|
+
* @ignore
|
60
|
+
*/
|
51
61
|
class ControlsMetadata {
|
62
|
+
//values of control
|
52
63
|
values = new Map();
|
64
|
+
// dictionary of controls with there properties
|
53
65
|
ControlsProperties = new Map();
|
54
66
|
rowId;
|
55
67
|
isCreated = false;
|
@@ -63,6 +75,8 @@ class ControlsMetadata {
|
|
63
75
|
return this.ControlsProperties.get(controlId);
|
64
76
|
}
|
65
77
|
update(obj) {
|
78
|
+
//should we keep the values here ?
|
79
|
+
//this.values = obj.ControlsValues;
|
66
80
|
let props = obj.ControlsMetaData;
|
67
81
|
for (let controlName in props) {
|
68
82
|
if (!this.ControlsProperties.has(controlName))
|
@@ -91,15 +105,18 @@ class ControlsMetadata {
|
|
91
105
|
return this.values.get(controlName);
|
92
106
|
}
|
93
107
|
}
|
108
|
+
/**
|
109
|
+
* @ignore
|
110
|
+
*/
|
94
111
|
class Records {
|
95
112
|
data = new Map();
|
96
|
-
list = [];
|
113
|
+
list = []; //used for sequential access in table
|
97
114
|
includesFirst;
|
98
115
|
includesLast;
|
99
116
|
guiTopIndex;
|
100
117
|
recordsBeforeCurrentView = 0;
|
101
118
|
isEmptyDataView = false;
|
102
|
-
sizeUpdated = false;
|
119
|
+
sizeUpdated = false; //used for evaluating the RecordsSizeChange.
|
103
120
|
getRow(dvRowId) {
|
104
121
|
return this.list[dvRowId + this.recordsBeforeCurrentView];
|
105
122
|
}
|
@@ -122,14 +139,24 @@ class Records {
|
|
122
139
|
}
|
123
140
|
return false;
|
124
141
|
}
|
142
|
+
/*
|
143
|
+
* for row editing
|
144
|
+
* */
|
125
145
|
startRowEditing(guiRowId) {
|
126
146
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
127
147
|
this.data.get(guiRowId).isEditing = true;
|
128
148
|
}
|
149
|
+
/*
|
150
|
+
* stop row editing on row Id
|
151
|
+
* */
|
129
152
|
stopRowEditing(guiRowId) {
|
130
153
|
if (guiRowId < this.list.length && this.data.has(guiRowId))
|
131
154
|
this.data.get(guiRowId).isEditing = false;
|
132
155
|
}
|
156
|
+
/*
|
157
|
+
* return if row is in editing
|
158
|
+
* Called by the HTML code, so parameter is a string, not a numebr
|
159
|
+
* */
|
133
160
|
isRowInRowEditing(guiRowId) {
|
134
161
|
if (+guiRowId < this.list.length) {
|
135
162
|
if (!this.data.has(+guiRowId) || isNullOrUndefined(this.data.get(+guiRowId)))
|
@@ -158,6 +185,7 @@ class Records {
|
|
158
185
|
updateSize(len) {
|
159
186
|
if (this.list.length != len) {
|
160
187
|
if (len < this.list.length) {
|
188
|
+
//remove rows
|
161
189
|
for (let i = len; i < this.list.length; i++) {
|
162
190
|
this.data.delete(i);
|
163
191
|
}
|
@@ -166,6 +194,10 @@ class Records {
|
|
166
194
|
this.sizeUpdated = true;
|
167
195
|
}
|
168
196
|
}
|
197
|
+
/**
|
198
|
+
* crears data for the first record
|
199
|
+
* @param template
|
200
|
+
*/
|
169
201
|
clearFirstTableRecord(template) {
|
170
202
|
if (this.list.length >= 1) {
|
171
203
|
for (const key in template) {
|
@@ -196,6 +228,9 @@ class Records {
|
|
196
228
|
return this.guiTopIndex;
|
197
229
|
}
|
198
230
|
}
|
231
|
+
/**
|
232
|
+
* @ignore
|
233
|
+
*/
|
199
234
|
var HtmlClasses;
|
200
235
|
(function (HtmlClasses) {
|
201
236
|
HtmlClasses["Color"] = "color";
|
@@ -204,6 +239,9 @@ var HtmlClasses;
|
|
204
239
|
HtmlClasses["HintColor"] = "hintcolor";
|
205
240
|
})(HtmlClasses || (HtmlClasses = {}));
|
206
241
|
|
242
|
+
/**
|
243
|
+
* @ignore
|
244
|
+
*/
|
207
245
|
class StylesMapManager {
|
208
246
|
static StylesMap = new Map([
|
209
247
|
[MagicProperties.LineDivider, new Map([[true, "solid"], [false, "hidden"]])],
|
@@ -230,10 +268,15 @@ class StylesMapManager {
|
|
230
268
|
}
|
231
269
|
}
|
232
270
|
|
271
|
+
/**
|
272
|
+
* @ignore
|
273
|
+
*/
|
233
274
|
class EngineMagicService {
|
234
275
|
magicBridge = MagicBridge;
|
235
276
|
isStub = false;
|
277
|
+
// true when user is logged in magic
|
236
278
|
isLoggedIn = false;
|
279
|
+
//TODO - unregister
|
237
280
|
refreshDom = new Subject();
|
238
281
|
interactiveCommands = new Subject();
|
239
282
|
startMagicEngine(httpClient, args) {
|
@@ -273,6 +316,12 @@ class EngineMagicService {
|
|
273
316
|
GetControlPictureMask(taskId, controlName) {
|
274
317
|
return this.magicBridge.GetControlPictureMask(taskId, controlName);
|
275
318
|
}
|
319
|
+
UploadFileToServer(fileContent, serverFileName) {
|
320
|
+
return this.magicBridge.UploadFileToServer(fileContent, serverFileName);
|
321
|
+
}
|
322
|
+
async DownloadFileFromServer(serverFileName) {
|
323
|
+
return await this.magicBridge.DownloadFileFromServer(serverFileName);
|
324
|
+
}
|
276
325
|
GetFormattedValue(taskId, controlName, value, rowId) {
|
277
326
|
return this.magicBridge.GetFormattedValue(taskId, controlName, value, rowId);
|
278
327
|
}
|
@@ -283,6 +332,7 @@ class EngineMagicService {
|
|
283
332
|
return this.magicBridge.GetFldRanges(taskId, controlName);
|
284
333
|
}
|
285
334
|
saveData(data) {
|
335
|
+
//this.magicBridge.saveData(data);
|
286
336
|
}
|
287
337
|
getIsLoggedIn() {
|
288
338
|
return this.isLoggedIn;
|
@@ -296,8 +346,8 @@ class EngineMagicService {
|
|
296
346
|
TerminateContextUsingFetchAPI() {
|
297
347
|
this.magicBridge.TerminateContextUsingFetchAPI();
|
298
348
|
}
|
299
|
-
static ɵfac = function EngineMagicService_Factory(
|
300
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac, providedIn: 'root' });
|
349
|
+
/** @nocollapse */ static ɵfac = function EngineMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EngineMagicService)(); };
|
350
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: EngineMagicService, factory: EngineMagicService.ɵfac, providedIn: 'root' });
|
301
351
|
}
|
302
352
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EngineMagicService, [{
|
303
353
|
type: Injectable,
|
@@ -306,8 +356,17 @@ class EngineMagicService {
|
|
306
356
|
}]
|
307
357
|
}], null, null); })();
|
308
358
|
|
359
|
+
/**
|
360
|
+
* Manages the list of components in a project, and the project title
|
361
|
+
*/
|
309
362
|
class ComponentListMagicService {
|
363
|
+
/**
|
364
|
+
* Map of project components
|
365
|
+
*/
|
310
366
|
components = new Map();
|
367
|
+
/**
|
368
|
+
* Map of project dialogs
|
369
|
+
*/
|
311
370
|
dialogs = new Map();
|
312
371
|
lazyLoadModulesMap = null;
|
313
372
|
getData(name, mustHaveData) {
|
@@ -320,6 +379,11 @@ class ComponentListMagicService {
|
|
320
379
|
data = this.components.get(name);
|
321
380
|
return data;
|
322
381
|
}
|
382
|
+
/**
|
383
|
+
* Return a component according to name
|
384
|
+
* @param name Name of requested component
|
385
|
+
* @returns The requested component
|
386
|
+
*/
|
323
387
|
getComponent(name, mustHaveData = true) {
|
324
388
|
let data = this.getData(name, mustHaveData);
|
325
389
|
return data ? data.component : null;
|
@@ -330,17 +394,30 @@ class ComponentListMagicService {
|
|
330
394
|
this.components.set(key, data);
|
331
395
|
}
|
332
396
|
}
|
397
|
+
/**
|
398
|
+
* Return a component according to name
|
399
|
+
* @param name Name of requested component
|
400
|
+
* @returns The requested component
|
401
|
+
*/
|
333
402
|
getModuleRef(name) {
|
334
403
|
let data = this.getData(name, false);
|
335
404
|
return data ? data.moduleRef : null;
|
336
405
|
;
|
337
406
|
}
|
407
|
+
/**
|
408
|
+
* Return the lazy load module details of the specified component
|
409
|
+
* @param name: Name of requested component
|
410
|
+
* @returns: lazy load module details
|
411
|
+
*/
|
338
412
|
getLazyLoadModuleData(name) {
|
339
413
|
return (this.lazyLoadModulesMap != null && this.lazyLoadModulesMap.hasOwnProperty(name)) ? this.lazyLoadModulesMap[name] : null;
|
340
414
|
}
|
415
|
+
/**
|
416
|
+
* Project title
|
417
|
+
*/
|
341
418
|
title;
|
342
|
-
static ɵfac = function ComponentListMagicService_Factory(
|
343
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ComponentListMagicService, factory: ComponentListMagicService.ɵfac, providedIn: 'root' });
|
419
|
+
/** @nocollapse */ static ɵfac = function ComponentListMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComponentListMagicService)(); };
|
420
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ComponentListMagicService, factory: ComponentListMagicService.ɵfac, providedIn: 'root' });
|
344
421
|
}
|
345
422
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComponentListMagicService, [{
|
346
423
|
type: Injectable,
|
@@ -349,6 +426,9 @@ class ComponentListMagicService {
|
|
349
426
|
}]
|
350
427
|
}], null, null); })();
|
351
428
|
|
429
|
+
/**
|
430
|
+
* @ignore
|
431
|
+
*/
|
352
432
|
class CommandsCollectorMagicService {
|
353
433
|
magic;
|
354
434
|
count = 0;
|
@@ -380,8 +460,8 @@ class CommandsCollectorMagicService {
|
|
380
460
|
commands.forEach(command => { this.commands.Remove(command); });
|
381
461
|
return commands;
|
382
462
|
}
|
383
|
-
static ɵfac = function CommandsCollectorMagicService_Factory(
|
384
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
|
463
|
+
/** @nocollapse */ static ɵfac = function CommandsCollectorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommandsCollectorMagicService)(i0.ɵɵinject(EngineMagicService)); };
|
464
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: CommandsCollectorMagicService, factory: CommandsCollectorMagicService.ɵfac, providedIn: 'root' });
|
385
465
|
}
|
386
466
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommandsCollectorMagicService, [{
|
387
467
|
type: Injectable,
|
@@ -390,6 +470,9 @@ class CommandsCollectorMagicService {
|
|
390
470
|
}]
|
391
471
|
}], () => [{ type: EngineMagicService }], null); })();
|
392
472
|
|
473
|
+
/**
|
474
|
+
* @ignore
|
475
|
+
*/
|
393
476
|
class RouteCommand {
|
394
477
|
callerMgSubformServiceRef;
|
395
478
|
routerOutletName;
|
@@ -397,6 +480,9 @@ class RouteCommand {
|
|
397
480
|
parameters;
|
398
481
|
routeParams;
|
399
482
|
}
|
483
|
+
/**
|
484
|
+
* @ignore
|
485
|
+
*/
|
400
486
|
class RouterCommandsMagicService {
|
401
487
|
pendingRouteCommands = [];
|
402
488
|
AddRouteCommand(routeCommand) {
|
@@ -408,8 +494,8 @@ class RouterCommandsMagicService {
|
|
408
494
|
pendingRouteCommand.callerMgSubformServiceRef.ExecuteRouteCommand(pendingRouteCommand);
|
409
495
|
}
|
410
496
|
}
|
411
|
-
static ɵfac = function RouterCommandsMagicService_Factory(
|
412
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac, providedIn: 'root' });
|
497
|
+
/** @nocollapse */ static ɵfac = function RouterCommandsMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterCommandsMagicService)(); };
|
498
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: RouterCommandsMagicService, factory: RouterCommandsMagicService.ɵfac, providedIn: 'root' });
|
413
499
|
}
|
414
500
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterCommandsMagicService, [{
|
415
501
|
type: Injectable,
|
@@ -422,8 +508,8 @@ class MagicLazyLoaderService {
|
|
422
508
|
Load(path) {
|
423
509
|
return Promise.reject('error in loading module :' + path);
|
424
510
|
}
|
425
|
-
static ɵfac = function MagicLazyLoaderService_Factory(
|
426
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicLazyLoaderService, factory: MagicLazyLoaderService.ɵfac, providedIn: 'root' });
|
511
|
+
/** @nocollapse */ static ɵfac = function MagicLazyLoaderService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicLazyLoaderService)(); };
|
512
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicLazyLoaderService, factory: MagicLazyLoaderService.ɵfac, providedIn: 'root' });
|
427
513
|
}
|
428
514
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicLazyLoaderService, [{
|
429
515
|
type: Injectable,
|
@@ -432,6 +518,9 @@ class MagicLazyLoaderService {
|
|
432
518
|
}]
|
433
519
|
}], null, null); })();
|
434
520
|
|
521
|
+
/**
|
522
|
+
* Service for managing subforms and routing
|
523
|
+
*/
|
435
524
|
class SubformMagicService {
|
436
525
|
task;
|
437
526
|
activatedRoute;
|
@@ -443,8 +532,8 @@ class SubformMagicService {
|
|
443
532
|
loader;
|
444
533
|
injector;
|
445
534
|
compiler;
|
446
|
-
subformsDict = {};
|
447
|
-
routesDict = {};
|
535
|
+
subformsDict /*:{ [x: string]: SubformDefinition }*/ = {};
|
536
|
+
routesDict = {}; // dictionary of router outlet to router path
|
448
537
|
currentRouteDefinition = null;
|
449
538
|
static currentCallerMgSubformServiceRef = null;
|
450
539
|
static routerContainers = new Array();
|
@@ -460,6 +549,11 @@ class SubformMagicService {
|
|
460
549
|
this.injector = injector;
|
461
550
|
this.compiler = compiler;
|
462
551
|
}
|
552
|
+
/**
|
553
|
+
* Finds and returns the component according to the subform name
|
554
|
+
* @param subformName
|
555
|
+
* @returns
|
556
|
+
*/
|
463
557
|
mgGetComp(subformName) {
|
464
558
|
if (subformName in this.subformsDict) {
|
465
559
|
let formName = this.subformsDict[subformName].formName;
|
@@ -468,6 +562,11 @@ class SubformMagicService {
|
|
468
562
|
}
|
469
563
|
return null;
|
470
564
|
}
|
565
|
+
/**
|
566
|
+
* Returns the parameters of the subform
|
567
|
+
* @param subformName
|
568
|
+
* @returns
|
569
|
+
*/
|
471
570
|
mgGetParameters(subformName) {
|
472
571
|
if (subformName in this.subformsDict) {
|
473
572
|
return this.subformsDict[subformName].parameters;
|
@@ -475,6 +574,9 @@ class SubformMagicService {
|
|
475
574
|
else
|
476
575
|
return '';
|
477
576
|
}
|
577
|
+
/**
|
578
|
+
* @ignore
|
579
|
+
*/
|
478
580
|
deleteSubformComp(subformControlName, formName) {
|
479
581
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
480
582
|
if (this.subformsDict[subformControlName].formName === formName) {
|
@@ -483,22 +585,27 @@ class SubformMagicService {
|
|
483
585
|
}
|
484
586
|
}
|
485
587
|
}
|
588
|
+
/**
|
589
|
+
* @ignore
|
590
|
+
*/
|
486
591
|
addSubformComp(subformControlName, formName, taskId, taskDescription, routerPath, params, inDefaultOutlet) {
|
487
592
|
this.pendingCommandsCollector.startCollecting();
|
488
593
|
let refreshNeeded = false;
|
489
|
-
if (isNullOrUndefined(routerPath)) {
|
594
|
+
if (isNullOrUndefined(routerPath)) { // call in destination subform
|
490
595
|
if (Object.keys(this.subformsDict).indexOf(subformControlName) >= 0) {
|
491
596
|
if (this.subformsDict[subformControlName].formName === formName) {
|
492
597
|
this.subformsDict[subformControlName] = {};
|
493
598
|
this.task.refreshView();
|
494
599
|
}
|
495
600
|
}
|
601
|
+
// Load the lazy load module, if needed
|
496
602
|
let moduleRef = this.componentListMagicService.getModuleRef(formName);
|
497
603
|
if (moduleRef == null) {
|
498
604
|
let lazyLoadModule = this.componentListMagicService.getLazyLoadModuleData(formName);
|
499
605
|
if (lazyLoadModule != null) {
|
500
606
|
const Magic = 'Magic';
|
501
607
|
const Module = 'Module';
|
608
|
+
// extract name of module(XX) from 'MagicXXModule'
|
502
609
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
503
610
|
this.loader.Load(moduleName).then(m => {
|
504
611
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -516,10 +623,11 @@ class SubformMagicService {
|
|
516
623
|
formName,
|
517
624
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription }
|
518
625
|
};
|
626
|
+
//this.ref.detectChanges();
|
519
627
|
refreshNeeded = true;
|
520
628
|
}
|
521
629
|
}
|
522
|
-
else {
|
630
|
+
else { // call route
|
523
631
|
if (inDefaultOutlet)
|
524
632
|
subformControlName = 'primary';
|
525
633
|
let routeParams = new List();
|
@@ -534,6 +642,10 @@ class SubformMagicService {
|
|
534
642
|
parameters: { taskIdParam: taskId, taskDescription: taskDescription },
|
535
643
|
routeParams: routeParams
|
536
644
|
};
|
645
|
+
// If SubformMagicService.currentCallerMgSubformServiceRef !== null means that router.navigate() is already
|
646
|
+
// called once, but angular has not yet executed it (ngOnInit of the new component is not called).
|
647
|
+
// In such a case, do not executed router.navigate() again. Because, angular ignores the previous one.
|
648
|
+
// So, put a command in the queue which will be executed after the first one is executed.
|
537
649
|
if (SubformMagicService.currentCallerMgSubformServiceRef === null)
|
538
650
|
this.ExecuteRouteCommand(routeCommand);
|
539
651
|
else
|
@@ -542,10 +654,15 @@ class SubformMagicService {
|
|
542
654
|
if (refreshNeeded)
|
543
655
|
this.task.refreshView();
|
544
656
|
}
|
657
|
+
/**
|
658
|
+
* Open the subform using a route command
|
659
|
+
*/
|
545
660
|
ExecuteRouteCommand(routeCommand) {
|
546
661
|
let currentSubformMagicService = routeCommand.callerMgSubformServiceRef;
|
547
662
|
let relativeRoute = SubformMagicService.getRelativeRoute(currentSubformMagicService.activatedRoute);
|
548
663
|
if (currentSubformMagicService.routesDict[routeCommand.routerOutletName] === routeCommand.routeParams[0]) {
|
664
|
+
// If the specified router outlet already hosts the same router path, router.navigate() doesn't actually navigate.
|
665
|
+
// So, first clear the outlet (passing null route params, clears the outlet) and then navigate again.
|
549
666
|
currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
|
550
667
|
.then((result) => {
|
551
668
|
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
@@ -565,7 +682,23 @@ class SubformMagicService {
|
|
565
682
|
if (SubformMagicService.routerContainers.length > 0) {
|
566
683
|
let routeContainer = SubformMagicService.routerContainers[0];
|
567
684
|
SubformMagicService.routerContainers.shift();
|
568
|
-
|
685
|
+
// If the route path is not same, it means that the original route is not available
|
686
|
+
// and the default route is invoked.
|
687
|
+
if (routeContainer.getRouterPath() === routeCommand.routeParams[0])
|
688
|
+
routeContainer.initializeComponent();
|
689
|
+
else {
|
690
|
+
// If the specified router outlet id referring to a different route path, then first clear
|
691
|
+
// the outlet (passing null route params, clears the outlet) and then navigate again.
|
692
|
+
currentSubformMagicService.router.navigate([{ outlets: { [routeCommand.routerOutletName]: null } }], { relativeTo: relativeRoute })
|
693
|
+
.then((result) => {
|
694
|
+
SubformMagicService.currentCallerMgSubformServiceRef = currentSubformMagicService;
|
695
|
+
currentSubformMagicService.currentRouteDefinition = {
|
696
|
+
formName: routeCommand.formName,
|
697
|
+
parameters: routeCommand.parameters
|
698
|
+
};
|
699
|
+
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
700
|
+
});
|
701
|
+
}
|
569
702
|
}
|
570
703
|
else {
|
571
704
|
currentSubformMagicService.PerformRouterNavigate(routeCommand.routerOutletName, routeCommand.routeParams);
|
@@ -585,7 +718,12 @@ class SubformMagicService {
|
|
585
718
|
}
|
586
719
|
});
|
587
720
|
}
|
721
|
+
/**
|
722
|
+
* @ignore
|
723
|
+
*/
|
588
724
|
init() {
|
725
|
+
// If commands were issued for this task before ngOnInit(), they were not executed because task had not registered for them.
|
726
|
+
// So, execute them now.
|
589
727
|
const pendingCommands = this.pendingCommandsCollector.GetCommands(this.task.taskId);
|
590
728
|
if (pendingCommands.length > 0) {
|
591
729
|
pendingCommands.forEach(command => { this.task.executeCommand(command); });
|
@@ -593,9 +731,15 @@ class SubformMagicService {
|
|
593
731
|
}
|
594
732
|
this.pendingCommandsCollector.stopCollecting();
|
595
733
|
}
|
734
|
+
/**
|
735
|
+
* @ignore
|
736
|
+
*/
|
596
737
|
refreshView() {
|
597
738
|
this.task.refreshView();
|
598
739
|
}
|
740
|
+
///
|
741
|
+
// return the relative route
|
742
|
+
//
|
599
743
|
static getRelativeRoute(sendActivatedRoute) {
|
600
744
|
let currentActiveRoute = sendActivatedRoute;
|
601
745
|
if (currentActiveRoute.snapshot.routeConfig !== null && currentActiveRoute.snapshot.routeConfig.path === '') {
|
@@ -605,13 +749,16 @@ class SubformMagicService {
|
|
605
749
|
}
|
606
750
|
return currentActiveRoute;
|
607
751
|
}
|
608
|
-
static ɵfac = function SubformMagicService_Factory(
|
609
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
752
|
+
/** @nocollapse */ static ɵfac = function SubformMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(i2.ActivatedRoute), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(CommandsCollectorMagicService), i0.ɵɵinject(i2.Router), i0.ɵɵinject(RouterCommandsMagicService), i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler)); };
|
753
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: SubformMagicService, factory: SubformMagicService.ɵfac });
|
610
754
|
}
|
611
755
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicService, [{
|
612
756
|
type: Injectable
|
613
757
|
}], () => [{ type: TaskMagicService }, { type: i2.ActivatedRoute }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: i2.Router }, { type: RouterCommandsMagicService }, { type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.Compiler }], null); })();
|
614
758
|
|
759
|
+
/**
|
760
|
+
* Mock component, implements routing by connecting the requested URL with the appropriate Magic task
|
761
|
+
*/
|
615
762
|
class RouterContainerMagicComponent {
|
616
763
|
activatedRoute;
|
617
764
|
router;
|
@@ -624,9 +771,20 @@ class RouterContainerMagicComponent {
|
|
624
771
|
componentRef = null;
|
625
772
|
parentMgSubformService = null;
|
626
773
|
static lastRoute = "/";
|
774
|
+
routePath = null;
|
627
775
|
static get LastRoute() {
|
628
776
|
return RouterContainerMagicComponent.lastRoute;
|
629
777
|
}
|
778
|
+
/**
|
779
|
+
*
|
780
|
+
* @param changeDetectorRef
|
781
|
+
* @param activatedRoute
|
782
|
+
* @param magic
|
783
|
+
* @param componentFactoryResolver
|
784
|
+
* @param viewContainerRef
|
785
|
+
* @param componentList
|
786
|
+
* @param pendingCommandsCollector
|
787
|
+
*/
|
630
788
|
constructor(activatedRoute, router, magic, containerTaskService, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
631
789
|
this.activatedRoute = activatedRoute;
|
632
790
|
this.router = router;
|
@@ -637,6 +795,9 @@ class RouterContainerMagicComponent {
|
|
637
795
|
this.pendingCommandsCollector = pendingCommandsCollector;
|
638
796
|
this.routerCommandsMagicService = routerCommandsMagicService;
|
639
797
|
}
|
798
|
+
/**
|
799
|
+
* Initialization
|
800
|
+
*/
|
640
801
|
ngOnInit() {
|
641
802
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
642
803
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
@@ -654,11 +815,14 @@ class RouterContainerMagicComponent {
|
|
654
815
|
guiEvent.RouterPath = currentActiveRoute.snapshot.routeConfig.path;
|
655
816
|
if (currentActiveRoute.snapshot.outlet !== 'primary')
|
656
817
|
guiEvent.RouterOutletName = currentActiveRoute.snapshot.outlet;
|
818
|
+
// if this is LoadOnDemandModuleMagicComponent it's mean that this is load on demand module and we
|
819
|
+
// need to take the path form routeConfig.path
|
657
820
|
let calcRouterPath = currentActiveRoute.routeConfig.path;
|
821
|
+
// add the RouterPath only if exist
|
658
822
|
if (calcRouterPath.length > 0) {
|
659
823
|
let routerPath = calcRouterPath;
|
660
824
|
let tokens = StrUtil.tokenize(routerPath, "/:");
|
661
|
-
guiEvent.RouterPath = tokens[0];
|
825
|
+
this.routePath = guiEvent.RouterPath = tokens[0];
|
662
826
|
guiEvent.RouterParams = new List();
|
663
827
|
for (let i = 1; i < tokens.length; i++) {
|
664
828
|
guiEvent.RouterParams.push(currentActiveRoute.snapshot.params[tokens[i]]);
|
@@ -667,6 +831,7 @@ class RouterContainerMagicComponent {
|
|
667
831
|
this.containerTaskService.insertEvent(guiEvent);
|
668
832
|
}
|
669
833
|
initializeComponent() {
|
834
|
+
// re-init subformMagicService since it may change after executing "RouterNavigate" event.
|
670
835
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
671
836
|
if (subformMagicService.currentRouteDefinition !== null) {
|
672
837
|
let comp = this.componentList.getComponent(subformMagicService.currentRouteDefinition.formName);
|
@@ -678,6 +843,9 @@ class RouterContainerMagicComponent {
|
|
678
843
|
this.parentMgSubformService = subformMagicService;
|
679
844
|
subformMagicService.currentRouteDefinition = null;
|
680
845
|
SubformMagicService.currentCallerMgSubformServiceRef = null;
|
846
|
+
//When the component is initialized, then also we get the notification for paramMap subscription.
|
847
|
+
//But in this case, we do not have to raise the event, because magic engine itself has initiated the route with the same parameters.
|
848
|
+
//So, control it via ignoreParamChange flag.
|
681
849
|
let ignoreParamChange = true;
|
682
850
|
myActiveRoute.paramMap.subscribe(params => {
|
683
851
|
if (!ignoreParamChange)
|
@@ -688,7 +856,12 @@ class RouterContainerMagicComponent {
|
|
688
856
|
this.routerCommandsMagicService.ExecuteNextCommand();
|
689
857
|
}
|
690
858
|
}
|
859
|
+
/**
|
860
|
+
* Cleanup
|
861
|
+
*/
|
691
862
|
ngOnDestroy() {
|
863
|
+
// TODO Routing: Call close() only if the task is not already closed.
|
864
|
+
// Task can be closed when a router is overlayed by another task via call operation.
|
692
865
|
if (this.componentRef != null) {
|
693
866
|
this.componentRef.instance.task.close();
|
694
867
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
@@ -696,25 +869,33 @@ class RouterContainerMagicComponent {
|
|
696
869
|
RouterContainerMagicComponent.lastRoute = this.router.url;
|
697
870
|
}
|
698
871
|
}
|
699
|
-
|
700
|
-
|
872
|
+
getRouterPath() {
|
873
|
+
return this.routePath;
|
874
|
+
}
|
875
|
+
/** @nocollapse */ static ɵfac = function RouterContainerMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RouterContainerMagicComponent)(i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(RouterCommandsMagicService)); };
|
876
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: RouterContainerMagicComponent, selectors: [["magic-route-outlet"]], standalone: false, decls: 0, vars: 0, template: function RouterContainerMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
701
877
|
}
|
702
878
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RouterContainerMagicComponent, [{
|
703
879
|
type: Component,
|
704
880
|
args: [{
|
705
881
|
selector: 'magic-route-outlet',
|
706
882
|
template: `
|
707
|
-
|
883
|
+
`,
|
884
|
+
standalone: false
|
708
885
|
}]
|
709
886
|
}], () => [{ type: i2.ActivatedRoute }, { type: i2.Router }, { type: EngineMagicService }, { type: TaskMagicService }, { type: i0.ViewContainerRef }, { type: ComponentListMagicService }, { type: CommandsCollectorMagicService }, { type: RouterCommandsMagicService }], null); })();
|
710
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src
|
887
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(RouterContainerMagicComponent, { className: "RouterContainerMagicComponent", filePath: "src/ui/router-container.magic.component.ts", lineNumber: 23 }); })();
|
711
888
|
|
889
|
+
/**
|
890
|
+
* @ignore
|
891
|
+
*/
|
712
892
|
class GuiInteractiveExecutor {
|
713
893
|
command;
|
714
894
|
component;
|
715
895
|
task;
|
716
896
|
overlayService;
|
717
897
|
Run() {
|
898
|
+
// Sets the currentContextID
|
718
899
|
try {
|
719
900
|
switch (this.command._commandType) {
|
720
901
|
case InteractiveCommandType.GET_VALUE:
|
@@ -751,6 +932,7 @@ class GuiInteractiveExecutor {
|
|
751
932
|
}
|
752
933
|
catch (ex) {
|
753
934
|
throw ex;
|
935
|
+
//want to see all the exceptions for now
|
754
936
|
}
|
755
937
|
}
|
756
938
|
static executeInteractiveCommand(task, guiIntactiveCommand, overlayService) {
|
@@ -769,6 +951,7 @@ class GuiInteractiveExecutor {
|
|
769
951
|
}
|
770
952
|
else if (this.task.isTableControl(this.command.controlName))
|
771
953
|
val = this.task.getValue(this.command.controlName, guiRowId.toString());
|
954
|
+
// If this is Three State Checkbox, then check if value is indeterminate.
|
772
955
|
if (this.command._boolVal) {
|
773
956
|
const indeterminate = this.task.getProperty(this.command.controlName, HtmlProperties.CheckBoxIndeterminate, guiRowId.toString());
|
774
957
|
if (indeterminate)
|
@@ -839,20 +1022,25 @@ BaseMagicOverlayContainer = __decorate([
|
|
839
1022
|
Output()
|
840
1023
|
], BaseMagicOverlayContainer);
|
841
1024
|
|
1025
|
+
/**
|
1026
|
+
* Directive for setting ViewContainerRef on element
|
1027
|
+
*/
|
842
1028
|
class MagicViewContainerRef {
|
843
1029
|
vcRef;
|
844
1030
|
constructor(vcRef) {
|
845
1031
|
this.vcRef = vcRef;
|
1032
|
+
// For angular 10 - find the component from the views
|
846
1033
|
let comp = (this.vcRef._hostLView).find(v => v != null && !isNullOrUndefined(v.setViewContainerRef));
|
847
1034
|
comp.setViewContainerRef(vcRef);
|
848
1035
|
}
|
849
|
-
static ɵfac = function MagicViewContainerRef_Factory(
|
850
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]] });
|
1036
|
+
/** @nocollapse */ static ɵfac = function MagicViewContainerRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicViewContainerRef)(i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
1037
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicViewContainerRef, selectors: [["", "magicViewContainerRef", ""]], standalone: false });
|
851
1038
|
}
|
852
1039
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicViewContainerRef, [{
|
853
1040
|
type: Directive,
|
854
1041
|
args: [{
|
855
1042
|
selector: '[magicViewContainerRef]',
|
1043
|
+
standalone: false
|
856
1044
|
}]
|
857
1045
|
}], () => [{ type: i0.ViewContainerRef }], null); })();
|
858
1046
|
|
@@ -860,42 +1048,103 @@ const _c0$3 = ["modalheader"];
|
|
860
1048
|
const _c1$1 = ["modalForeground"];
|
861
1049
|
function MagicOverlayContainer_button_2_Template(rf, ctx) { if (rf & 1) {
|
862
1050
|
const _r2 = i0.ɵɵgetCurrentView();
|
863
|
-
i0.ɵɵelementStart(0, "button",
|
1051
|
+
i0.ɵɵelementStart(0, "button", 16);
|
864
1052
|
i0.ɵɵlistener("click", function MagicOverlayContainer_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnClose()); });
|
865
1053
|
i0.ɵɵtext(1, "X");
|
866
1054
|
i0.ɵɵelementEnd();
|
867
1055
|
} }
|
868
|
-
function
|
1056
|
+
function MagicOverlayContainer_span_5_Template(rf, ctx) { if (rf & 1) {
|
869
1057
|
const _r4 = i0.ɵɵgetCurrentView();
|
870
|
-
i0.ɵɵelementStart(0, "
|
1058
|
+
i0.ɵɵelementStart(0, "span", 17, 2);
|
1059
|
+
i0.ɵɵlistener("mousedown", function MagicOverlayContainer_span_5_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "corner")); });
|
1060
|
+
i0.ɵɵelementEnd();
|
1061
|
+
} }
|
1062
|
+
function MagicOverlayContainer_span_6_Template(rf, ctx) { if (rf & 1) {
|
1063
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
1064
|
+
i0.ɵɵelementStart(0, "span", 18, 3);
|
1065
|
+
i0.ɵɵlistener("mousedown", function MagicOverlayContainer_span_6_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "right")); });
|
1066
|
+
i0.ɵɵelementEnd();
|
1067
|
+
} }
|
1068
|
+
function MagicOverlayContainer_span_7_Template(rf, ctx) { if (rf & 1) {
|
1069
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
1070
|
+
i0.ɵɵelementStart(0, "span", 19, 4);
|
1071
|
+
i0.ɵɵlistener("mousedown", function MagicOverlayContainer_span_7_Template_span_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onResizeStart($event, "bottom")); });
|
1072
|
+
i0.ɵɵelementEnd();
|
1073
|
+
} }
|
1074
|
+
function MagicOverlayContainer_div_8_Template(rf, ctx) { if (rf & 1) {
|
1075
|
+
const _r7 = i0.ɵɵgetCurrentView();
|
1076
|
+
i0.ɵɵelementStart(0, "div", 20, 5);
|
871
1077
|
i0.ɵɵtext(2);
|
872
|
-
i0.ɵɵelementStart(3, "button",
|
873
|
-
i0.ɵɵlistener("click", function
|
1078
|
+
i0.ɵɵelementStart(3, "button", 21);
|
1079
|
+
i0.ɵɵlistener("click", function MagicOverlayContainer_div_8_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r7); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnClose()); });
|
874
1080
|
i0.ɵɵtext(4, "X");
|
875
1081
|
i0.ɵɵelementEnd()();
|
876
1082
|
} if (rf & 2) {
|
877
1083
|
const ctx_r2 = i0.ɵɵnextContext();
|
1084
|
+
i0.ɵɵclassProp("movable", ctx_r2.IsMovable());
|
878
1085
|
i0.ɵɵadvance(2);
|
879
1086
|
i0.ɵɵtextInterpolate1(" ", ctx_r2.getText(), " ");
|
880
1087
|
} }
|
1088
|
+
/**
|
1089
|
+
* Creates a modal window for Magic modal window components
|
1090
|
+
*/
|
881
1091
|
class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
1092
|
+
/**
|
1093
|
+
* HTML to be displayed in the modal window
|
1094
|
+
*/
|
882
1095
|
modalbodyViewContainerRef;
|
1096
|
+
/**
|
1097
|
+
* Header of the modal window
|
1098
|
+
*/
|
883
1099
|
headerElementRef;
|
1100
|
+
/**
|
1101
|
+
* Foreground of the modal window
|
1102
|
+
*/
|
884
1103
|
foregroundElementRef;
|
1104
|
+
/**
|
1105
|
+
*
|
1106
|
+
*/
|
885
1107
|
ModalComp = null;
|
1108
|
+
/**
|
1109
|
+
*
|
1110
|
+
*/
|
886
1111
|
ModalCompParameters = {};
|
887
1112
|
onClose = new EventEmitter();
|
1113
|
+
/**
|
1114
|
+
*
|
1115
|
+
*/
|
888
1116
|
componentRef = null;
|
1117
|
+
resizing = false;
|
1118
|
+
resizeDirection = null;
|
1119
|
+
originalWidth = 0;
|
1120
|
+
originalHeight = 0;
|
1121
|
+
originalMouseX = 0;
|
1122
|
+
originalMouseY = 0;
|
1123
|
+
isCenteredToWindow = true;
|
1124
|
+
static minAllowedWidth = 30;
|
1125
|
+
static minAllowedHeight = 30;
|
1126
|
+
/**
|
1127
|
+
*
|
1128
|
+
*/
|
889
1129
|
constructor() {
|
890
1130
|
super();
|
891
1131
|
}
|
1132
|
+
/**
|
1133
|
+
*
|
1134
|
+
*/
|
892
1135
|
ngOnInit() {
|
893
1136
|
this.componentRef = this.modalbodyViewContainerRef.createComponent(this.ModalComp);
|
894
1137
|
Object.assign(this.componentRef.instance, this.ModalCompParameters);
|
1138
|
+
let comp = this.componentRef.instance;
|
1139
|
+
this.isCenteredToWindow = comp.IsCenteredToWindow();
|
895
1140
|
}
|
896
1141
|
setViewContainerRef(vcRef) {
|
897
1142
|
this.modalbodyViewContainerRef = vcRef;
|
898
1143
|
}
|
1144
|
+
/**
|
1145
|
+
* Returns the form name
|
1146
|
+
* @returns
|
1147
|
+
*/
|
899
1148
|
getText() {
|
900
1149
|
if (this.componentRef !== null) {
|
901
1150
|
let comp = this.componentRef.instance;
|
@@ -904,13 +1153,17 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
904
1153
|
else
|
905
1154
|
return '';
|
906
1155
|
}
|
1156
|
+
/**
|
1157
|
+
* Returns CSS styles for the window
|
1158
|
+
* @returns
|
1159
|
+
*/
|
907
1160
|
getStyle() {
|
908
1161
|
let styles = {};
|
909
1162
|
if (this.componentRef != undefined) {
|
910
1163
|
let comp = this.componentRef.instance;
|
911
1164
|
styles['width'] = comp.Width();
|
912
1165
|
styles['height'] = comp.Height();
|
913
|
-
if (
|
1166
|
+
if (this.isCenteredToWindow) {
|
914
1167
|
styles['margin'] = 'auto';
|
915
1168
|
}
|
916
1169
|
else {
|
@@ -920,6 +1173,10 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
920
1173
|
}
|
921
1174
|
return styles;
|
922
1175
|
}
|
1176
|
+
/**
|
1177
|
+
* Returns the CSS styles for the client area
|
1178
|
+
* @returns
|
1179
|
+
*/
|
923
1180
|
getClientAreaStyles() {
|
924
1181
|
let styles = {};
|
925
1182
|
if (this.componentRef != undefined) {
|
@@ -934,69 +1191,182 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
934
1191
|
}
|
935
1192
|
return styles;
|
936
1193
|
}
|
1194
|
+
/**
|
1195
|
+
* Should the title bar be displayed
|
1196
|
+
* @returns
|
1197
|
+
*/
|
937
1198
|
getShowTitleBar() {
|
938
1199
|
if (this.componentRef != undefined) {
|
939
1200
|
let comp = this.componentRef.instance;
|
940
1201
|
return comp.ShowTitleBar();
|
941
1202
|
}
|
942
1203
|
}
|
1204
|
+
/**
|
1205
|
+
*
|
1206
|
+
*/
|
943
1207
|
OnClose() {
|
944
1208
|
this.onClose.emit();
|
945
1209
|
}
|
1210
|
+
/**
|
1211
|
+
* Handles click in the background window
|
1212
|
+
*/
|
946
1213
|
OnBackgroundClick() {
|
947
1214
|
let comp = this.componentRef.instance;
|
948
1215
|
if (comp.ShouldCloseOnBackgroundClick())
|
949
1216
|
this.OnClose();
|
950
1217
|
}
|
951
|
-
|
952
|
-
|
1218
|
+
/**
|
1219
|
+
* Checks if the overlay component allows to be resized.
|
1220
|
+
* @returns {boolean} True if the overlay is resizable, false otherwise.
|
1221
|
+
*/
|
1222
|
+
IsResizable() {
|
1223
|
+
let comp = this.componentRef.instance;
|
1224
|
+
return comp.IsResizable();
|
1225
|
+
}
|
1226
|
+
/**
|
1227
|
+
* Checks if the overlay component allows to be moved (dragged).
|
1228
|
+
* @returns {boolean} True if the overlay is movable, false otherwise.
|
1229
|
+
*/
|
1230
|
+
IsMovable() {
|
1231
|
+
let comp = this.componentRef.instance;
|
1232
|
+
return comp.IsMovable();
|
1233
|
+
}
|
1234
|
+
/**
|
1235
|
+
* Initiates the resize process when a mousedown event occurs on a resize handle.
|
1236
|
+
* Stores the initial state (dimensions, mouse position) and sets flags.
|
1237
|
+
* @param {MouseEvent} event - The mousedown event triggering the resize.
|
1238
|
+
* @param {'right' | 'bottom' | 'corner'} direction - Indicates which resize handle was activated.
|
1239
|
+
*/
|
1240
|
+
onResizeStart(event, direction) {
|
1241
|
+
this.resizing = true;
|
1242
|
+
this.resizeDirection = direction;
|
1243
|
+
const element = this.foregroundElementRef.nativeElement;
|
1244
|
+
this.originalWidth = element.offsetWidth;
|
1245
|
+
this.originalHeight = element.offsetHeight;
|
1246
|
+
this.originalMouseX = event.clientX;
|
1247
|
+
this.originalMouseY = event.clientY;
|
1248
|
+
// Removes auto margin and set left and top style
|
1249
|
+
if (this.isCenteredToWindow) {
|
1250
|
+
element.style.left = element.offsetLeft + 'px';
|
1251
|
+
element.style.top = element.offsetTop + 'px';
|
1252
|
+
element.style.margin = '';
|
1253
|
+
this.isCenteredToWindow = false;
|
1254
|
+
}
|
1255
|
+
event.preventDefault();
|
1256
|
+
event.stopPropagation();
|
1257
|
+
}
|
1258
|
+
/**
|
1259
|
+
* Handles the resizing logic as the mouse moves across the window.
|
1260
|
+
* This listener is active globally on the window during a resize operation via @HostListener.
|
1261
|
+
* Calculates and applies the new dimensions to the element based on mouse movement.
|
1262
|
+
* @param {MouseEvent} event - The mousemove event passed by the HostListener.
|
1263
|
+
*/
|
1264
|
+
onResize(event) {
|
1265
|
+
if (!this.resizing)
|
1266
|
+
return;
|
1267
|
+
const element = this.foregroundElementRef.nativeElement;
|
1268
|
+
const parentElement = element.parentNode;
|
1269
|
+
const parentWidth = parentElement.offsetWidth;
|
1270
|
+
const parentHeight = parentElement.offsetHeight;
|
1271
|
+
const rect = element.getBoundingClientRect();
|
1272
|
+
const left = rect.left;
|
1273
|
+
const top = rect.top;
|
1274
|
+
// When the user extends the overlay window to its edge, it becomes hard to grab the border for resizing.
|
1275
|
+
// To improve this, 2px are subtracted from maxAllowedWidth and maxAllowedHeight, making it easier to grab the overlay's border for resizing.
|
1276
|
+
const maxAllowedWidth = parentWidth - left - 2;
|
1277
|
+
const maxAllowedHeight = parentHeight - top - 2;
|
1278
|
+
let dx = (event.clientX - this.originalMouseX);
|
1279
|
+
let dy = (event.clientY - this.originalMouseY);
|
1280
|
+
if (this.resizeDirection === 'right' || this.resizeDirection === 'corner') {
|
1281
|
+
let newWidth = this.originalWidth + dx;
|
1282
|
+
if (newWidth > maxAllowedWidth)
|
1283
|
+
newWidth = maxAllowedWidth;
|
1284
|
+
else if (newWidth < MagicOverlayContainer.minAllowedWidth)
|
1285
|
+
newWidth = MagicOverlayContainer.minAllowedWidth;
|
1286
|
+
element.style.width = `${newWidth}px`;
|
1287
|
+
}
|
1288
|
+
if (this.resizeDirection === 'bottom' || this.resizeDirection === 'corner') {
|
1289
|
+
let newHeight = this.originalHeight + dy;
|
1290
|
+
if (newHeight > maxAllowedHeight)
|
1291
|
+
newHeight = maxAllowedHeight;
|
1292
|
+
else if (newHeight < MagicOverlayContainer.minAllowedHeight)
|
1293
|
+
newHeight = MagicOverlayContainer.minAllowedHeight;
|
1294
|
+
element.style.height = `${newHeight}px`;
|
1295
|
+
}
|
1296
|
+
}
|
1297
|
+
/**
|
1298
|
+
* Finalizes the resize operation when the mouse button is released anywhere on the window.
|
1299
|
+
* Resets the resizing state flags. Triggered globally via @HostListener.
|
1300
|
+
*/
|
1301
|
+
onResizeEnd() {
|
1302
|
+
this.resizing = false;
|
1303
|
+
this.resizeDirection = null;
|
1304
|
+
}
|
1305
|
+
/** @nocollapse */ static ɵfac = function MagicOverlayContainer_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainer)(); };
|
1306
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainer, selectors: [["app-magic-overlay-container"]], viewQuery: function MagicOverlayContainer_Query(rf, ctx) { if (rf & 1) {
|
953
1307
|
i0.ɵɵviewQuery(_c0$3, 5);
|
954
1308
|
i0.ɵɵviewQuery(_c1$1, 5);
|
955
1309
|
} if (rf & 2) {
|
956
1310
|
let _t;
|
957
1311
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.headerElementRef = _t.first);
|
958
1312
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.foregroundElementRef = _t.first);
|
959
|
-
} },
|
1313
|
+
} }, hostBindings: function MagicOverlayContainer_HostBindings(rf, ctx) { if (rf & 1) {
|
1314
|
+
i0.ɵɵlistener("mousemove", function MagicOverlayContainer_mousemove_HostBindingHandler($event) { return ctx.onResize($event); }, false, i0.ɵɵresolveWindow)("mouseup", function MagicOverlayContainer_mouseup_HostBindingHandler() { return ctx.onResizeEnd(); }, false, i0.ɵɵresolveWindow);
|
1315
|
+
} }, inputs: { ModalComp: "ModalComp", ModalCompParameters: "ModalCompParameters" }, outputs: { onClose: "onClose" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 12, vars: 8, consts: [["modalForeground", ""], ["modalbody", ""], ["dragHandleCorner", ""], ["dragHandleRight", ""], ["dragHandleBottom", ""], ["modalheader", ""], [1, "boundary-line"], [1, "modal-background", 3, "click"], ["tabindex", "-1", "style", "float:right; border: none; background-color: transparent; outline: none; color: white", 3, "click", 4, "ngIf"], ["cdkDragBoundary", ".boundary-line", "cdkDrag", "", 1, "modal-foreground", 3, "ngStyle", "cdkDragDisabled"], ["class", "dragHandle corner", 3, "mousedown", 4, "ngIf"], ["class", "dragHandle right", 3, "mousedown", 4, "ngIf"], ["class", "dragHandle bottom", 3, "mousedown", 4, "ngIf"], ["class", "modal-header", "cdkDragHandle", "", 3, "movable", 4, "ngIf"], [3, "ngStyle"], ["magicViewContainerRef", ""], ["tabindex", "-1", 2, "float", "right", "border", "none", "background-color", "transparent", "outline", "none", "color", "white", 3, "click"], [1, "dragHandle", "corner", 3, "mousedown"], [1, "dragHandle", "right", 3, "mousedown"], [1, "dragHandle", "bottom", 3, "mousedown"], ["cdkDragHandle", "", 1, "modal-header"], ["tabindex", "-1", 2, "float", "right", 3, "click"]], template: function MagicOverlayContainer_Template(rf, ctx) { if (rf & 1) {
|
960
1316
|
const _r1 = i0.ɵɵgetCurrentView();
|
961
|
-
i0.ɵɵelementStart(0, "div")(1, "div",
|
1317
|
+
i0.ɵɵelementStart(0, "div", 6)(1, "div", 7);
|
962
1318
|
i0.ɵɵlistener("click", function MagicOverlayContainer_Template_div_click_1_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnBackgroundClick()); });
|
963
|
-
i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button",
|
1319
|
+
i0.ɵɵtemplate(2, MagicOverlayContainer_button_2_Template, 2, 0, "button", 8);
|
964
1320
|
i0.ɵɵelementEnd();
|
965
|
-
i0.ɵɵelementStart(3, "div",
|
966
|
-
i0.ɵɵtemplate(5,
|
967
|
-
i0.ɵɵelementStart(
|
968
|
-
i0.ɵɵelement(
|
1321
|
+
i0.ɵɵelementStart(3, "div", 9, 0);
|
1322
|
+
i0.ɵɵtemplate(5, MagicOverlayContainer_span_5_Template, 2, 0, "span", 10)(6, MagicOverlayContainer_span_6_Template, 2, 0, "span", 11)(7, MagicOverlayContainer_span_7_Template, 2, 0, "span", 12)(8, MagicOverlayContainer_div_8_Template, 5, 3, "div", 13);
|
1323
|
+
i0.ɵɵelementStart(9, "div", 14);
|
1324
|
+
i0.ɵɵelement(10, "div", 15, 1);
|
969
1325
|
i0.ɵɵelementEnd()()();
|
970
1326
|
} if (rf & 2) {
|
971
1327
|
i0.ɵɵadvance(2);
|
972
1328
|
i0.ɵɵproperty("ngIf", !ctx.getShowTitleBar());
|
973
1329
|
i0.ɵɵadvance();
|
974
|
-
i0.ɵɵproperty("ngStyle", ctx.getStyle());
|
1330
|
+
i0.ɵɵproperty("ngStyle", ctx.getStyle())("cdkDragDisabled", !ctx.IsMovable());
|
975
1331
|
i0.ɵɵadvance(2);
|
1332
|
+
i0.ɵɵproperty("ngIf", ctx.IsResizable());
|
1333
|
+
i0.ɵɵadvance();
|
1334
|
+
i0.ɵɵproperty("ngIf", ctx.IsResizable());
|
1335
|
+
i0.ɵɵadvance();
|
1336
|
+
i0.ɵɵproperty("ngIf", ctx.IsResizable());
|
1337
|
+
i0.ɵɵadvance();
|
976
1338
|
i0.ɵɵproperty("ngIf", ctx.getShowTitleBar());
|
977
1339
|
i0.ɵɵadvance();
|
978
1340
|
i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
979
|
-
} }, dependencies: [i1.NgIf, i1.NgStyle, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#fff}.modal-background[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"] });
|
1341
|
+
} }, dependencies: [i1.NgIf, i1.NgStyle, i2$1.CdkDragHandle, i2$1.CdkDrag, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#fff}.modal-background[_ngcontent-%COMP%]{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}.modal-header.movable[_ngcontent-%COMP%]:active{cursor:move}.container[_ngcontent-%COMP%]{position:relative}.dragHandle[_ngcontent-%COMP%]{position:absolute}.dragHandle.corner[_ngcontent-%COMP%]{width:10px;right:0;bottom:0;height:10px;cursor:nwse-resize;background:linear-gradient(135deg,rgba(0,0,0,.4) 50%,transparent 50%)}.dragHandle.right[_ngcontent-%COMP%]{width:2px;right:-2px;height:100%;cursor:ew-resize}.dragHandle.bottom[_ngcontent-%COMP%]{height:2px;bottom:-2px;width:100%;cursor:ns-resize}.boundary-line[_ngcontent-%COMP%]{width:100%;height:100%;max-width:100%}"] });
|
980
1342
|
}
|
981
1343
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
|
982
1344
|
type: Component,
|
983
1345
|
args: [{ selector: 'app-magic-overlay-container', template: `
|
984
|
-
<div>
|
1346
|
+
<div class="boundary-line">
|
1347
|
+
|
985
1348
|
<div class="modal-background" (click)="OnBackgroundClick()">
|
986
1349
|
<button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white" *ngIf="!getShowTitleBar()">X</button>
|
987
1350
|
</div>
|
988
|
-
|
989
|
-
|
1351
|
+
|
1352
|
+
<div #modalForeground class="modal-foreground" [ngStyle]="getStyle()" cdkDragBoundary=".boundary-line" cdkDrag [cdkDragDisabled]="!IsMovable()">
|
1353
|
+
|
1354
|
+
<span #dragHandleCorner *ngIf="IsResizable()" class="dragHandle corner" (mousedown)="onResizeStart($event, 'corner')"></span>
|
1355
|
+
<span #dragHandleRight *ngIf="IsResizable()" class="dragHandle right" (mousedown)="onResizeStart($event, 'right')"></span>
|
1356
|
+
<span #dragHandleBottom *ngIf="IsResizable()" class="dragHandle bottom" (mousedown)="onResizeStart($event, 'bottom')"></span>
|
1357
|
+
|
1358
|
+
<div #modalheader class="modal-header" *ngIf="getShowTitleBar()" cdkDragHandle [class.movable]="IsMovable()">
|
990
1359
|
{{getText()}}
|
991
1360
|
<button (click)="OnClose()" style="float:right" tabindex="-1">X</button>
|
992
1361
|
</div>
|
1362
|
+
|
993
1363
|
<div [ngStyle]="getClientAreaStyles()">
|
994
1364
|
<div #modalbody magicViewContainerRef>
|
995
1365
|
</div>
|
996
1366
|
</div>
|
997
1367
|
</div>
|
998
1368
|
</div>
|
999
|
-
`, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
|
1369
|
+
`, standalone: false, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}.modal-header.movable:active{cursor:move}.container{position:relative}.dragHandle{position:absolute}.dragHandle.corner{width:10px;right:0;bottom:0;height:10px;cursor:nwse-resize;background:linear-gradient(135deg,rgba(0,0,0,.4) 50%,transparent 50%)}.dragHandle.right{width:2px;right:-2px;height:100%;cursor:ew-resize}.dragHandle.bottom{height:2px;bottom:-2px;width:100%;cursor:ns-resize}.boundary-line{width:100%;height:100%;max-width:100%}\n"] }]
|
1000
1370
|
}], () => [], { headerElementRef: [{
|
1001
1371
|
type: ViewChild,
|
1002
1372
|
args: ['modalheader', { static: false }]
|
@@ -1009,33 +1379,61 @@ class MagicOverlayContainer extends BaseMagicOverlayContainer {
|
|
1009
1379
|
type: Input
|
1010
1380
|
}], onClose: [{
|
1011
1381
|
type: Output
|
1382
|
+
}], onResize: [{
|
1383
|
+
type: HostListener,
|
1384
|
+
args: ['window:mousemove', ['$event']]
|
1385
|
+
}], onResizeEnd: [{
|
1386
|
+
type: HostListener,
|
1387
|
+
args: ['window:mouseup']
|
1012
1388
|
}] }); })();
|
1013
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src
|
1389
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainer, { className: "MagicOverlayContainer", filePath: "src/ui/magic-modal/magic-overlay-container.ts", lineNumber: 50 }); })();
|
1014
1390
|
|
1391
|
+
/**
|
1392
|
+
* Service managing overlay windows
|
1393
|
+
* This is Magic's default provider
|
1394
|
+
*/
|
1015
1395
|
class OverlayContainerMagicProvider {
|
1016
1396
|
getComponent() {
|
1017
1397
|
return MagicOverlayContainer;
|
1018
1398
|
}
|
1019
|
-
static ɵfac = function OverlayContainerMagicProvider_Factory(
|
1020
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
1399
|
+
/** @nocollapse */ static ɵfac = function OverlayContainerMagicProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayContainerMagicProvider)(); };
|
1400
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayContainerMagicProvider, factory: OverlayContainerMagicProvider.ɵfac });
|
1021
1401
|
}
|
1022
1402
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayContainerMagicProvider, [{
|
1023
1403
|
type: Injectable
|
1024
1404
|
}], null, null); })();
|
1025
1405
|
|
1406
|
+
/**
|
1407
|
+
* This is a base class for the magic confirm components
|
1408
|
+
*/
|
1026
1409
|
class BaseMagicConfirmComponent {
|
1410
|
+
/**
|
1411
|
+
* title of the component
|
1412
|
+
*/
|
1027
1413
|
title;
|
1414
|
+
/**
|
1415
|
+
* message of the component
|
1416
|
+
*/
|
1028
1417
|
message;
|
1418
|
+
/**
|
1419
|
+
* onClose Event - to be raised when the component is closed
|
1420
|
+
* should pass true when OK is pressed and false when cancel is pressed
|
1421
|
+
*/
|
1029
1422
|
onClose = new EventEmitter();
|
1423
|
+
/**
|
1424
|
+
* raises close Event
|
1425
|
+
* @param result true when OK is pressed and false when cancel is pressed
|
1426
|
+
*
|
1427
|
+
*/
|
1030
1428
|
OnClose(result) {
|
1031
1429
|
this.onClose.emit(result);
|
1032
1430
|
}
|
1033
|
-
static ɵfac = function BaseMagicConfirmComponent_Factory(
|
1034
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { } });
|
1431
|
+
/** @nocollapse */ static ɵfac = function BaseMagicConfirmComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicConfirmComponent)(); };
|
1432
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-confirm"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
1035
1433
|
}
|
1036
1434
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
1037
1435
|
type: Component,
|
1038
|
-
args: [{ selector: 'mg-base-confirm', template: '' }]
|
1436
|
+
args: [{ selector: 'mg-base-confirm', template: '', standalone: false }]
|
1039
1437
|
}], null, { title: [{
|
1040
1438
|
type: Input
|
1041
1439
|
}], message: [{
|
@@ -1043,21 +1441,37 @@ class BaseMagicConfirmComponent {
|
|
1043
1441
|
}], onClose: [{
|
1044
1442
|
type: Output
|
1045
1443
|
}] }); })();
|
1046
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src
|
1444
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicConfirmComponent, { className: "BaseMagicConfirmComponent", filePath: "src/ui/components/base-magic-confirm.component.ts", lineNumber: 13 }); })();
|
1047
1445
|
|
1446
|
+
/**
|
1447
|
+
* This is a base class for the magic alert components
|
1448
|
+
*/
|
1048
1449
|
class BaseMagicAlertComponent {
|
1450
|
+
/**
|
1451
|
+
* title of the component
|
1452
|
+
*/
|
1049
1453
|
title;
|
1454
|
+
/**
|
1455
|
+
* message of the component
|
1456
|
+
*/
|
1050
1457
|
message;
|
1458
|
+
/**
|
1459
|
+
* onClose Event - to be raised when the component is closed
|
1460
|
+
|
1461
|
+
*/
|
1051
1462
|
onClose = new EventEmitter();
|
1463
|
+
/**
|
1464
|
+
* close magic alert
|
1465
|
+
*/
|
1052
1466
|
OnClose() {
|
1053
1467
|
this.onClose.emit();
|
1054
1468
|
}
|
1055
|
-
static ɵfac = function BaseMagicAlertComponent_Factory(
|
1056
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { } });
|
1469
|
+
/** @nocollapse */ static ɵfac = function BaseMagicAlertComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BaseMagicAlertComponent)(); };
|
1470
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, standalone: false, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
1057
1471
|
}
|
1058
1472
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
1059
1473
|
type: Component,
|
1060
|
-
args: [{ selector: 'mg-base-alert', template: '' }]
|
1474
|
+
args: [{ selector: 'mg-base-alert', template: '', standalone: false }]
|
1061
1475
|
}], null, { title: [{
|
1062
1476
|
type: Input
|
1063
1477
|
}], message: [{
|
@@ -1065,8 +1479,11 @@ class BaseMagicAlertComponent {
|
|
1065
1479
|
}], onClose: [{
|
1066
1480
|
type: Output
|
1067
1481
|
}] }); })();
|
1068
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src
|
1482
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMagicAlertComponent, { className: "BaseMagicAlertComponent", filePath: "src/ui/components/base-magic-alert.component.ts", lineNumber: 14 }); })();
|
1069
1483
|
|
1484
|
+
/**
|
1485
|
+
* Directive for setting focus on element
|
1486
|
+
*/
|
1070
1487
|
class MagicFocusDirective {
|
1071
1488
|
hostElement;
|
1072
1489
|
constructor(hostElement) {
|
@@ -1075,13 +1492,14 @@ class MagicFocusDirective {
|
|
1075
1492
|
ngAfterViewInit() {
|
1076
1493
|
this.hostElement.nativeElement.focus();
|
1077
1494
|
}
|
1078
|
-
static ɵfac = function MagicFocusDirective_Factory(
|
1079
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]] });
|
1495
|
+
/** @nocollapse */ static ɵfac = function MagicFocusDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicFocusDirective)(i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
1496
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicFocusDirective, selectors: [["", "magicFocus", ""]], standalone: false });
|
1080
1497
|
}
|
1081
1498
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicFocusDirective, [{
|
1082
1499
|
type: Directive,
|
1083
1500
|
args: [{
|
1084
|
-
selector: '[magicFocus]'
|
1501
|
+
selector: '[magicFocus]',
|
1502
|
+
standalone: false
|
1085
1503
|
}]
|
1086
1504
|
}], () => [{ type: i0.ElementRef }], null); })();
|
1087
1505
|
|
@@ -1092,17 +1510,34 @@ class MagicOverlayContainerWrapper {
|
|
1092
1510
|
injector;
|
1093
1511
|
changeDetectorRef;
|
1094
1512
|
compiler;
|
1513
|
+
/**
|
1514
|
+
*
|
1515
|
+
*/
|
1095
1516
|
Component = null;
|
1517
|
+
/**
|
1518
|
+
*
|
1519
|
+
*/
|
1096
1520
|
Parameters = {};
|
1097
1521
|
OverlayTypeParam;
|
1098
1522
|
onClose = new EventEmitter();
|
1523
|
+
/**
|
1524
|
+
* HTML to be displayed in the modal window
|
1525
|
+
*/
|
1099
1526
|
overlayContentViewContainerRef;
|
1100
1527
|
overlayContainerWrapperElementRef;
|
1528
|
+
/**
|
1529
|
+
* @ignore
|
1530
|
+
* contais data of allowed base components to use
|
1531
|
+
*/
|
1101
1532
|
static allowedBaseComps = new Map([
|
1102
1533
|
[OverlayType.Overlay, { comp: BaseMagicOverlayContainer, error: 'BaseMagicOverlayContainer . Overlay ' }],
|
1103
1534
|
[OverlayType.Alert, { comp: BaseMagicAlertComponent, error: 'BaseMagicAlertComponent. Alert ' }],
|
1104
1535
|
[OverlayType.ConfirmationBox, { comp: BaseMagicConfirmComponent, error: 'BaseMagicConfirmComponent. Confirmation ' }]
|
1105
1536
|
]);
|
1537
|
+
/**
|
1538
|
+
*
|
1539
|
+
* @param componentFactoryResolver
|
1540
|
+
*/
|
1106
1541
|
constructor(componentListMagicService, magicLazyModuleLoader, injector, changeDetectorRef, compiler) {
|
1107
1542
|
this.componentListMagicService = componentListMagicService;
|
1108
1543
|
this.magicLazyModuleLoader = magicLazyModuleLoader;
|
@@ -1110,6 +1545,9 @@ class MagicOverlayContainerWrapper {
|
|
1110
1545
|
this.changeDetectorRef = changeDetectorRef;
|
1111
1546
|
this.compiler = compiler;
|
1112
1547
|
}
|
1548
|
+
/**
|
1549
|
+
*
|
1550
|
+
*/
|
1113
1551
|
ngOnInit() {
|
1114
1552
|
let moduleRef = this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);
|
1115
1553
|
if (moduleRef == null) {
|
@@ -1117,6 +1555,7 @@ class MagicOverlayContainerWrapper {
|
|
1117
1555
|
if (lazyLoadModule != null) {
|
1118
1556
|
const Magic = 'Magic';
|
1119
1557
|
const Module = 'Module';
|
1558
|
+
// extract name of module(XX) from 'MagicXXModule'
|
1120
1559
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
1121
1560
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
1122
1561
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -1155,13 +1594,13 @@ class MagicOverlayContainerWrapper {
|
|
1155
1594
|
DetectChanges() {
|
1156
1595
|
this.changeDetectorRef.detectChanges();
|
1157
1596
|
}
|
1158
|
-
static ɵfac = function MagicOverlayContainerWrapper_Factory(
|
1159
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
1597
|
+
/** @nocollapse */ static ɵfac = function MagicOverlayContainerWrapper_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicOverlayContainerWrapper)(i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(MagicLazyLoaderService), i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Compiler)); };
|
1598
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicOverlayContainerWrapper, selectors: [["app-magic-overlay-container-wrapper"]], viewQuery: function MagicOverlayContainerWrapper_Query(rf, ctx) { if (rf & 1) {
|
1160
1599
|
i0.ɵɵviewQuery(_c0$2, 7);
|
1161
1600
|
} if (rf & 2) {
|
1162
1601
|
let _t;
|
1163
1602
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.overlayContainerWrapperElementRef = _t.first);
|
1164
|
-
} }, inputs: { Component: "Component", Parameters: "Parameters", OverlayTypeParam: "OverlayTypeParam" }, outputs: { onClose: "onClose" }, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
|
1603
|
+
} }, inputs: { Component: "Component", Parameters: "Parameters", OverlayTypeParam: "OverlayTypeParam" }, outputs: { onClose: "onClose" }, standalone: false, decls: 7, vars: 0, consts: [["overlayContainerWrapper", ""], ["overlayContent", ""], ["tabIndex", "0", "magicFocus", "", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"], [1, "overlay-container-wrapper-background"], ["magicViewContainerRef", ""], ["tabIndex", "0", 1, "overlay-container-wrapper-background", 2, "width", "0px", "height", "0px"]], template: function MagicOverlayContainerWrapper_Template(rf, ctx) { if (rf & 1) {
|
1165
1604
|
i0.ɵɵelementStart(0, "div");
|
1166
1605
|
i0.ɵɵelement(1, "div", 2);
|
1167
1606
|
i0.ɵɵelementStart(2, "div", 3, 0);
|
@@ -1182,7 +1621,7 @@ class MagicOverlayContainerWrapper {
|
|
1182
1621
|
</div>
|
1183
1622
|
<div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
|
1184
1623
|
</div>
|
1185
|
-
`, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
1624
|
+
`, standalone: false, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
1186
1625
|
}], () => [{ type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.ChangeDetectorRef }, { type: i0.Compiler }], { Component: [{
|
1187
1626
|
type: Input
|
1188
1627
|
}], Parameters: [{
|
@@ -1195,11 +1634,14 @@ class MagicOverlayContainerWrapper {
|
|
1195
1634
|
type: ViewChild,
|
1196
1635
|
args: ['overlayContainerWrapper', { static: true }]
|
1197
1636
|
}] }); })();
|
1198
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src
|
1637
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicOverlayContainerWrapper, { className: "MagicOverlayContainerWrapper", filePath: "src/ui/magic-modal/magic-overlay-container-wrapper.ts", lineNumber: 46 }); })();
|
1199
1638
|
|
1639
|
+
/***
|
1640
|
+
* This is sample component for the alert message
|
1641
|
+
*/
|
1200
1642
|
class MagicAlertComponent extends BaseMagicAlertComponent {
|
1201
|
-
static ɵfac = (() => { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(
|
1202
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
1643
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicAlertComponent_BaseFactory; return function MagicAlertComponent_Factory(__ngFactoryType__) { return (ɵMagicAlertComponent_BaseFactory || (ɵMagicAlertComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicAlertComponent)))(__ngFactoryType__ || MagicAlertComponent); }; })();
|
1644
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicAlertComponent, selectors: [["sample-magic-alert-component"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 2, consts: [[1, "mg-message-background"], [3, "click"]], template: function MagicAlertComponent_Template(rf, ctx) { if (rf & 1) {
|
1203
1645
|
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
1204
1646
|
i0.ɵɵtext(3);
|
1205
1647
|
i0.ɵɵelementEnd();
|
@@ -1226,13 +1668,16 @@ class MagicAlertComponent extends BaseMagicAlertComponent {
|
|
1226
1668
|
|
1227
1669
|
<button (click)="OnClose()">OK</button>
|
1228
1670
|
</div>
|
1229
|
-
</div>`, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}\n"] }]
|
1671
|
+
</div>`, standalone: false, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}\n"] }]
|
1230
1672
|
}], null, null); })();
|
1231
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicAlertComponent, { className: "MagicAlertComponent", filePath: "src
|
1673
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicAlertComponent, { className: "MagicAlertComponent", filePath: "src/ui/components/magic-alert.component.ts", lineNumber: 49 }); })();
|
1232
1674
|
|
1675
|
+
/***
|
1676
|
+
* This is sample component for the confirmation box
|
1677
|
+
*/
|
1233
1678
|
class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
1234
|
-
static ɵfac = (() => { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(
|
1235
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) { if (rf & 1) {
|
1679
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicConfirmationBoxComponent_BaseFactory; return function MagicConfirmationBoxComponent_Factory(__ngFactoryType__) { return (ɵMagicConfirmationBoxComponent_BaseFactory || (ɵMagicConfirmationBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MagicConfirmationBoxComponent)))(__ngFactoryType__ || MagicConfirmationBoxComponent); }; })();
|
1680
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicConfirmationBoxComponent, selectors: [["sample-magic-confirmation-box"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 11, vars: 2, consts: [[1, "mg-message-background"], [3, "click"], [1, "cancel", 3, "click"]], template: function MagicConfirmationBoxComponent_Template(rf, ctx) { if (rf & 1) {
|
1236
1681
|
i0.ɵɵelementStart(0, "div")(1, "div", 0)(2, "h2");
|
1237
1682
|
i0.ɵɵtext(3);
|
1238
1683
|
i0.ɵɵelementEnd();
|
@@ -1265,29 +1710,56 @@ class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
|
|
1265
1710
|
<button (click)="OnClose(true)">OK</button>
|
1266
1711
|
<button class="cancel" (click)="OnClose(false)">Cancel</button>
|
1267
1712
|
</div>
|
1268
|
-
</div>`, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel{background-color:#c1c1c1}\n"] }]
|
1713
|
+
</div>`, standalone: false, styles: [".mg-message-background{background-color:#f5f5f5;width:40%;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif;padding:17px;border-radius:5px;text-align:center;margin-top:10%;margin-left:auto;margin-right:auto;border:1px solid gray}button{background-color:#8cd4f5;color:#fff;border:none;box-shadow:none;font-size:17px;font-weight:500;-webkit-border-radius:4px;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel{background-color:#c1c1c1}\n"] }]
|
1269
1714
|
}], null, null); })();
|
1270
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicConfirmationBoxComponent, { className: "MagicConfirmationBoxComponent", filePath: "src
|
1715
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicConfirmationBoxComponent, { className: "MagicConfirmationBoxComponent", filePath: "src/ui/components/magic-confirmation-box.component.ts", lineNumber: 55 }); })();
|
1271
1716
|
|
1717
|
+
/**
|
1718
|
+
* Service managing overlay windows
|
1719
|
+
* This is Magic's default provider
|
1720
|
+
*/
|
1721
|
+
/**
|
1722
|
+
* Service managing alert and confirmation windows
|
1723
|
+
* This is Magic's default provider
|
1724
|
+
*/
|
1272
1725
|
class ConfirmationComponentsMagicProvider {
|
1726
|
+
/**
|
1727
|
+
* Return true when use default javascript alert and confirmation or return false to provide custom components
|
1728
|
+
* @returns true is we want to use default javascript alert and confirmation
|
1729
|
+
*/
|
1273
1730
|
showDefaultConfirmations() {
|
1274
1731
|
return true;
|
1275
1732
|
}
|
1733
|
+
/**
|
1734
|
+
* Returns component that will replace javascript alert. The component will be used only if showDefaultConfirmations = false
|
1735
|
+
* @returns component that will replace javascript Alert
|
1736
|
+
*/
|
1276
1737
|
getAlertComponent() {
|
1277
1738
|
return MagicAlertComponent;
|
1278
1739
|
}
|
1740
|
+
/**
|
1741
|
+
* Returns component that will replace javascript confirmation box. The component will be used only if showDefaultConfirmations = false
|
1742
|
+
* @returns component that will replace javascript confirmation box
|
1743
|
+
*/
|
1279
1744
|
getConfirmtionComponent() {
|
1280
1745
|
return MagicConfirmationBoxComponent;
|
1281
1746
|
}
|
1282
|
-
static ɵfac = function ConfirmationComponentsMagicProvider_Factory(
|
1283
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
1747
|
+
/** @nocollapse */ static ɵfac = function ConfirmationComponentsMagicProvider_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ConfirmationComponentsMagicProvider)(); };
|
1748
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ConfirmationComponentsMagicProvider, factory: ConfirmationComponentsMagicProvider.ɵfac });
|
1284
1749
|
}
|
1285
1750
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfirmationComponentsMagicProvider, [{
|
1286
1751
|
type: Injectable
|
1287
1752
|
}], null, null); })();
|
1288
1753
|
|
1754
|
+
/**
|
1755
|
+
* Displays a message-box
|
1756
|
+
*/
|
1289
1757
|
class confirmationBox {
|
1758
|
+
/**
|
1759
|
+
* @ignore
|
1760
|
+
*/
|
1290
1761
|
static isConfirmBox(style) {
|
1762
|
+
// button format mask is in first nibble from right
|
1291
1763
|
let buttonMode = style & 0x0F;
|
1292
1764
|
var isConfirm = (buttonMode === Styles.MSGBOX_BUTTON_OK_CANCEL) ||
|
1293
1765
|
(buttonMode === Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE) ||
|
@@ -1296,7 +1768,14 @@ class confirmationBox {
|
|
1296
1768
|
(buttonMode === Styles.MSGBOX_BUTTON_RETRY_CANCEL);
|
1297
1769
|
return (isConfirm);
|
1298
1770
|
}
|
1771
|
+
/**
|
1772
|
+
* Converts the result from the HTML window to the expected result type
|
1773
|
+
* @param style Result received from HTML window
|
1774
|
+
* @param okWasPressed Was the "OK" pressed
|
1775
|
+
* @returns MessageBox result type
|
1776
|
+
*/
|
1299
1777
|
static convertToExcpectedResultBox(style, okWasPressed) {
|
1778
|
+
// button format mask is in first nibble from right
|
1300
1779
|
let buttonMode = style & 0x0F;
|
1301
1780
|
let retValue = Styles.MSGBOX_RESULT_OK;
|
1302
1781
|
if (buttonMode === Styles.MSGBOX_BUTTON_OK)
|
@@ -1313,9 +1792,18 @@ class confirmationBox {
|
|
1313
1792
|
retValue = okWasPressed ? Styles.MSGBOX_RESULT_RETRY : Styles.MSGBOX_RESULT_CANCEL;
|
1314
1793
|
return retValue;
|
1315
1794
|
}
|
1795
|
+
/**
|
1796
|
+
* Show a message box as an HTML window
|
1797
|
+
* @param title Title of the message box
|
1798
|
+
* @param message Message that will be display in the message box
|
1799
|
+
* @param style Style that include buttons \ Icons
|
1800
|
+
* @returns MessageBox result
|
1801
|
+
*/
|
1316
1802
|
static showConfirmationBox(title, message, style) {
|
1317
1803
|
let okWasPressed = false;
|
1804
|
+
// check if it is confirmation box
|
1318
1805
|
let isConfirm = this.isConfirmBox(style);
|
1806
|
+
// the title will be added to the string and we will add new line after the title
|
1319
1807
|
let titleAndString = title + '\n' + '\n' + message;
|
1320
1808
|
if (isConfirm)
|
1321
1809
|
okWasPressed = confirm(titleAndString);
|
@@ -1323,10 +1811,14 @@ class confirmationBox {
|
|
1323
1811
|
alert(titleAndString);
|
1324
1812
|
okWasPressed = true;
|
1325
1813
|
}
|
1814
|
+
// return the result from the user
|
1326
1815
|
return okWasPressed;
|
1327
1816
|
}
|
1328
1817
|
}
|
1329
1818
|
|
1819
|
+
/**
|
1820
|
+
* Service managing overlay windows
|
1821
|
+
*/
|
1330
1822
|
class OverlayWindowService {
|
1331
1823
|
componentList;
|
1332
1824
|
engineMagicService;
|
@@ -1344,6 +1836,7 @@ class OverlayWindowService {
|
|
1344
1836
|
this.overlayContainerMagicProvider = overlayContainerMagicProvider;
|
1345
1837
|
this.confirmationComponentsMagicProvider = confirmationComponentsMagicProvider;
|
1346
1838
|
}
|
1839
|
+
// The view reference of container of overlay window
|
1347
1840
|
overlayWindowsContainerViewRef;
|
1348
1841
|
overlayWindowFocusManager = null;
|
1349
1842
|
changeDetectorRef = null;
|
@@ -1359,6 +1852,7 @@ class OverlayWindowService {
|
|
1359
1852
|
if (lazyLoadModule != null) {
|
1360
1853
|
const Magic = 'Magic';
|
1361
1854
|
const Module = 'Module';
|
1855
|
+
// extract name of module(XX) from 'MagicXXModule'
|
1362
1856
|
const moduleName = lazyLoadModule.moduleName.slice(Magic.length, -Module.length);
|
1363
1857
|
this.magicLazyModuleLoader.Load(moduleName).then(m => {
|
1364
1858
|
const compiled = this.compiler.compileModuleAndAllComponentsSync(m[lazyLoadModule.moduleName]);
|
@@ -1374,6 +1868,7 @@ class OverlayWindowService {
|
|
1374
1868
|
}
|
1375
1869
|
}
|
1376
1870
|
open(formName, taskId, taskDescription) {
|
1871
|
+
// for overlay which are lazy loaded don't find data in component-list
|
1377
1872
|
let comp = this.componentList.lazyLoadModulesMap != null && this.componentList.lazyLoadModulesMap.hasOwnProperty(formName) ? null : this.componentList.getComponent(formName);
|
1378
1873
|
let parameters = { taskIdParam: taskId, taskDescription: taskDescription };
|
1379
1874
|
let componentRef = this.createModalComponent({ MagicFormName: formName, ModalComp: comp, ModalCompParameters: parameters }, this.overlayContainerMagicProvider.getComponent(), OverlayType.Overlay);
|
@@ -1382,21 +1877,31 @@ class OverlayWindowService {
|
|
1382
1877
|
guiEvent.TaskID = taskId;
|
1383
1878
|
this.engineMagicService.insertEvent(guiEvent);
|
1384
1879
|
});
|
1880
|
+
//using the same changeDetectorRef from root-component
|
1385
1881
|
this.changeDetectorRef.detectChanges();
|
1386
1882
|
}
|
1387
1883
|
close(commandStr) {
|
1884
|
+
// Close the overlay by removing the overlay window from its container
|
1388
1885
|
this.overlayWindowsContainerViewRef.remove();
|
1389
1886
|
this.overlayWindowFocusManager.popDialog();
|
1390
1887
|
let guiEvent1 = getGuiEventObj("dispose", null, 0);
|
1391
1888
|
guiEvent1.TaskID = commandStr;
|
1392
1889
|
this.engineMagicService.insertEvent(guiEvent1);
|
1393
1890
|
}
|
1891
|
+
/**
|
1892
|
+
* Open Confirmation box
|
1893
|
+
* @param title title of the box
|
1894
|
+
* @param msg message
|
1895
|
+
* @param style Magic style
|
1896
|
+
*/
|
1394
1897
|
openConfirmationBox(title, msg, style) {
|
1898
|
+
//show default confirmations
|
1395
1899
|
if (this.confirmationComponentsMagicProvider.showDefaultConfirmations()) {
|
1396
1900
|
let res = confirmationBox.showConfirmationBox(title, msg, style);
|
1397
1901
|
this.finishConfirmation(style, res);
|
1398
1902
|
}
|
1399
1903
|
else {
|
1904
|
+
//show custom confirmations
|
1400
1905
|
let comp = confirmationBox.isConfirmBox(style) ? this.confirmationComponentsMagicProvider.getConfirmtionComponent() : this.confirmationComponentsMagicProvider.getAlertComponent();
|
1401
1906
|
let overlayType = confirmationBox.isConfirmBox(style) ? OverlayType.ConfirmationBox : OverlayType.Alert;
|
1402
1907
|
let componentRef = this.createModalComponent({ title: title, message: msg }, comp, overlayType);
|
@@ -1407,11 +1912,21 @@ class OverlayWindowService {
|
|
1407
1912
|
});
|
1408
1913
|
}
|
1409
1914
|
}
|
1915
|
+
/**
|
1916
|
+
* This method is called on close of the confirmation
|
1917
|
+
* @param style Magic style
|
1918
|
+
* @param result
|
1919
|
+
*/
|
1410
1920
|
finishConfirmation(style, result) {
|
1411
1921
|
let guiEvent = getGuiEventObj("confirmationClosed", null, 0);
|
1412
1922
|
guiEvent.keyCode = confirmationBox.convertToExcpectedResultBox(style, result);
|
1413
1923
|
this.engineMagicService.insertEvent(guiEvent);
|
1414
1924
|
}
|
1925
|
+
/**
|
1926
|
+
* creates a modal component. Can be used for overlay, message box or confirmation box
|
1927
|
+
* @param parameters component's parameters
|
1928
|
+
* @param component components to create
|
1929
|
+
*/
|
1415
1930
|
createModalComponent(parameters, component, overlayType) {
|
1416
1931
|
let componentRef;
|
1417
1932
|
let magicModalContainerParameters = {
|
@@ -1419,15 +1934,17 @@ class OverlayWindowService {
|
|
1419
1934
|
Parameters: parameters,
|
1420
1935
|
OverlayTypeParam: overlayType
|
1421
1936
|
};
|
1937
|
+
// Create the UI component of modal window
|
1422
1938
|
let viewCRef = this.overlayWindowsContainerViewRef;
|
1423
1939
|
componentRef = viewCRef.createComponent(MagicOverlayContainerWrapper);
|
1940
|
+
// Set the data to newly created component
|
1424
1941
|
Object.assign(componentRef.instance, magicModalContainerParameters);
|
1425
1942
|
this.overlayWindowFocusManager.pushDialog(componentRef.instance.GetRootElement());
|
1426
1943
|
componentRef.instance.DetectChanges();
|
1427
1944
|
return componentRef;
|
1428
1945
|
}
|
1429
|
-
static ɵfac = function OverlayWindowService_Factory(
|
1430
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
|
1946
|
+
/** @nocollapse */ static ɵfac = function OverlayWindowService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || OverlayWindowService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(MagicLazyLoaderService), i0.ɵɵinject(i0.Injector), i0.ɵɵinject(i0.Compiler), i0.ɵɵinject(OverlayContainerMagicProvider), i0.ɵɵinject(ConfirmationComponentsMagicProvider)); };
|
1947
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: OverlayWindowService, factory: OverlayWindowService.ɵfac, providedIn: 'root' });
|
1431
1948
|
}
|
1432
1949
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(OverlayWindowService, [{
|
1433
1950
|
type: Injectable,
|
@@ -1555,50 +2072,135 @@ class DialogInfo {
|
|
1555
2072
|
}
|
1556
2073
|
}
|
1557
2074
|
|
2075
|
+
/**
|
2076
|
+
* Main service to connect the UI with the Magic WebCLient
|
2077
|
+
*/
|
1558
2078
|
class TaskMagicService {
|
1559
2079
|
magic;
|
1560
2080
|
overlayWindowService;
|
2081
|
+
/**
|
2082
|
+
* Service to provide table-related functionalities
|
2083
|
+
*/
|
1561
2084
|
tableService;
|
2085
|
+
/**
|
2086
|
+
* Collection of data for all controls
|
2087
|
+
*/
|
1562
2088
|
Records = new Records();
|
2089
|
+
/**
|
2090
|
+
* FormGroup collection for line mode
|
2091
|
+
*/
|
1563
2092
|
formGroups = [];
|
2093
|
+
/**
|
2094
|
+
* FormGroup for all controls in screen mode
|
2095
|
+
*/
|
1564
2096
|
ScreenModeControls;
|
2097
|
+
/**
|
2098
|
+
* @ignore
|
2099
|
+
*/
|
1565
2100
|
refreshDom = new Subject();
|
2101
|
+
/**
|
2102
|
+
* @ignore
|
2103
|
+
*/
|
1566
2104
|
subscribeRefreshDom;
|
2105
|
+
/**
|
2106
|
+
* @ignore
|
2107
|
+
*/
|
1567
2108
|
detectChanges = new Subject();
|
2109
|
+
/**
|
2110
|
+
* @ignore
|
2111
|
+
*/
|
1568
2112
|
subscribeInteractiveCommands;
|
2113
|
+
/**
|
2114
|
+
* @ignore
|
2115
|
+
*/
|
1569
2116
|
interactiveCommands = new Subject();
|
2117
|
+
/**
|
2118
|
+
* @ignore
|
2119
|
+
* This event is emitted when the selected row in a table changes.
|
2120
|
+
*/
|
1570
2121
|
OnSelectedRowChanged = new EventEmitter();
|
2122
|
+
/**
|
2123
|
+
* @ignore
|
2124
|
+
*/
|
1571
2125
|
customPropertiesSubject = new Subject();
|
2126
|
+
/**
|
2127
|
+
* @ignore
|
2128
|
+
*/
|
1572
2129
|
recordsCountChangeSubject = new Subject();
|
1573
2130
|
mgLoadSubject = new Subject();
|
2131
|
+
/**
|
2132
|
+
* @ignore
|
2133
|
+
*/
|
1574
2134
|
template;
|
2135
|
+
/**
|
2136
|
+
* Service to provide subform-related functionalities
|
2137
|
+
*/
|
1575
2138
|
mgSubformService;
|
2139
|
+
/**
|
2140
|
+
* Service to provide the title-change functionality
|
2141
|
+
*/
|
1576
2142
|
mgTitleService;
|
2143
|
+
/**
|
2144
|
+
* Service which enables getting/setting values from/to the Magic WebClient engine
|
2145
|
+
*/
|
1577
2146
|
mgAccessorService;
|
1578
2147
|
mgInputDateFormat;
|
2148
|
+
/**
|
2149
|
+
* @ignore
|
2150
|
+
*/
|
1579
2151
|
oldPageSize = 0;
|
2152
|
+
/**
|
2153
|
+
*
|
2154
|
+
* @param magic
|
2155
|
+
*/
|
1580
2156
|
constructor(magic, overlayWindowService) {
|
1581
2157
|
this.magic = magic;
|
1582
2158
|
this.overlayWindowService = overlayWindowService;
|
1583
2159
|
this.Records.setGuiTopIndex(0);
|
1584
2160
|
this.mgInputDateFormat = null;
|
1585
2161
|
}
|
2162
|
+
/**
|
2163
|
+
* returns true if used is logged in
|
2164
|
+
* @returns
|
2165
|
+
*/
|
1586
2166
|
getIsLoggenIn() {
|
1587
2167
|
return this.magic.getIsLoggedIn();
|
1588
2168
|
}
|
2169
|
+
/**
|
2170
|
+
* Id of task to which this service refers
|
2171
|
+
*/
|
1589
2172
|
_taskId;
|
2173
|
+
/**
|
2174
|
+
* returns the task Id
|
2175
|
+
* @returns
|
2176
|
+
*/
|
1590
2177
|
get taskId() {
|
1591
2178
|
return this._taskId;
|
1592
2179
|
}
|
2180
|
+
/**
|
2181
|
+
* Sets the task Id
|
2182
|
+
* @param value the task id to set
|
2183
|
+
*/
|
1593
2184
|
set taskId(value) {
|
2185
|
+
// debugger;
|
1594
2186
|
this._taskId = value;
|
1595
2187
|
}
|
2188
|
+
/**
|
2189
|
+
* Returns the task's data in Screen mode
|
2190
|
+
* @returns
|
2191
|
+
*/
|
1596
2192
|
get ScreenControlsData() {
|
1597
2193
|
return this.Records.list['0'];
|
1598
2194
|
}
|
2195
|
+
/**
|
2196
|
+
* @ignore
|
2197
|
+
*/
|
1599
2198
|
settemplate(value) {
|
1600
2199
|
this.template = value;
|
1601
2200
|
}
|
2201
|
+
/**
|
2202
|
+
* Builds the FormControl for each and every control
|
2203
|
+
*/
|
1602
2204
|
buildScreenModeControls() {
|
1603
2205
|
const group = new FormGroup({});
|
1604
2206
|
for (const key in this.template) {
|
@@ -1610,10 +2212,21 @@ class TaskMagicService {
|
|
1610
2212
|
}
|
1611
2213
|
this.ScreenModeControls = group;
|
1612
2214
|
}
|
2215
|
+
/**
|
2216
|
+
* Is the control a table control
|
2217
|
+
* @param id Id of the control
|
2218
|
+
* @returns
|
2219
|
+
*/
|
1613
2220
|
isTableControl(id) {
|
1614
2221
|
return this.template[id] == '1';
|
1615
2222
|
}
|
1616
2223
|
getMgInputDateFormat() { return this.mgInputDateFormat; }
|
2224
|
+
/**
|
2225
|
+
* Returns the FormControl of a control
|
2226
|
+
* @param guiRowid Id of the requested row
|
2227
|
+
* @param id Id of the control
|
2228
|
+
* @returns
|
2229
|
+
*/
|
1617
2230
|
getFormControl(guiRowid, id) {
|
1618
2231
|
let c;
|
1619
2232
|
let group = this.isTableControl(id) ? this.formGroups[guiRowid] : this.ScreenModeControls;
|
@@ -1623,12 +2236,21 @@ class TaskMagicService {
|
|
1623
2236
|
}
|
1624
2237
|
return c;
|
1625
2238
|
}
|
2239
|
+
/**
|
2240
|
+
* handle the change of text for input control inside table
|
2241
|
+
* @param guiRowId Id of the row for which the FormControls are built
|
2242
|
+
* set the new value of the formcontrol
|
2243
|
+
*/
|
1626
2244
|
setInputTextValue(controlId, guiRowid, val) {
|
1627
2245
|
this.setValue(controlId, guiRowid, this.ConvertValToNative(controlId, 0, val));
|
1628
2246
|
const fc = this.getFormControl(guiRowid, controlId);
|
1629
2247
|
if (!isNullOrUndefined(val))
|
1630
2248
|
fc.setValue(val);
|
1631
2249
|
}
|
2250
|
+
/**
|
2251
|
+
* Build the FormControls for a table row
|
2252
|
+
* @param guiRowId Id of the row for which the FormControls are built
|
2253
|
+
*/
|
1632
2254
|
buildTableRowControls(guiRowId) {
|
1633
2255
|
const group = new FormGroup({});
|
1634
2256
|
for (const key in this.template) {
|
@@ -1640,30 +2262,58 @@ class TaskMagicService {
|
|
1640
2262
|
}
|
1641
2263
|
this.formGroups[guiRowId] = group;
|
1642
2264
|
}
|
2265
|
+
/**
|
2266
|
+
*
|
2267
|
+
* @ignore
|
2268
|
+
*/
|
1643
2269
|
updateRecordsBeforeCurrentView(value) {
|
1644
2270
|
this.Records.recordsBeforeCurrentView = value;
|
1645
2271
|
}
|
2272
|
+
/**
|
2273
|
+
* @ignore
|
2274
|
+
*/
|
1646
2275
|
setIncludesFirst(value) {
|
1647
2276
|
this.Records.includesFirst = value;
|
1648
2277
|
}
|
2278
|
+
/**
|
2279
|
+
* @ignore
|
2280
|
+
*/
|
1649
2281
|
setIncludesLast(value) {
|
1650
2282
|
this.Records.includesLast = value;
|
1651
2283
|
}
|
2284
|
+
/**
|
2285
|
+
* @ignore
|
2286
|
+
*/
|
1652
2287
|
markRowAsCreated(guiRowId) {
|
1653
2288
|
this.Records.markRowAsCreated(guiRowId);
|
1654
2289
|
}
|
2290
|
+
/**
|
2291
|
+
* @ignore
|
2292
|
+
*/
|
1655
2293
|
markRowAsNotCreated(guiRowId) {
|
1656
2294
|
this.Records.markRowAsNotCreated(guiRowId);
|
1657
2295
|
}
|
2296
|
+
/**
|
2297
|
+
* @ignore
|
2298
|
+
*/
|
1658
2299
|
startRowEditing(guiRowId) {
|
1659
2300
|
this.Records.startRowEditing(guiRowId);
|
1660
2301
|
}
|
2302
|
+
/**
|
2303
|
+
* @ignore
|
2304
|
+
*/
|
1661
2305
|
stopRowEditing(guiRowId) {
|
1662
2306
|
this.Records.stopRowEditing(guiRowId);
|
1663
2307
|
}
|
2308
|
+
/**
|
2309
|
+
* @ignore
|
2310
|
+
*/
|
1664
2311
|
isRowInRowEditing(guiRowId) {
|
1665
2312
|
return this.Records.isRowInRowEditing(guiRowId);
|
1666
2313
|
}
|
2314
|
+
/**
|
2315
|
+
* @ignore
|
2316
|
+
*/
|
1667
2317
|
setIsEmptyDataView(isEmpty) {
|
1668
2318
|
if (this.Records.isEmptyDataView !== isEmpty) {
|
1669
2319
|
if (isEmpty)
|
@@ -1673,6 +2323,11 @@ class TaskMagicService {
|
|
1673
2323
|
this.refreshView();
|
1674
2324
|
}
|
1675
2325
|
}
|
2326
|
+
/**
|
2327
|
+
* Initialize the service to work with the task
|
2328
|
+
* @param taskId Id of the task
|
2329
|
+
* @param taskDescription
|
2330
|
+
*/
|
1676
2331
|
initTask(taskId, taskDescription) {
|
1677
2332
|
this.Records.createFirst();
|
1678
2333
|
this.oldPageSize = 0;
|
@@ -1684,39 +2339,80 @@ class TaskMagicService {
|
|
1684
2339
|
this.settemplate(taskDescription);
|
1685
2340
|
}
|
1686
2341
|
this.buildScreenModeControls();
|
2342
|
+
// remove previous subscriptions
|
1687
2343
|
if (!isNullOrUndefined(this.subscribeRefreshDom))
|
1688
2344
|
this.subscribeRefreshDom.unsubscribe();
|
1689
2345
|
if (!isNullOrUndefined(this.subscribeInteractiveCommands))
|
1690
2346
|
this.subscribeInteractiveCommands.unsubscribe();
|
1691
2347
|
this.subscribeRefreshDom = this.magic.refreshDom.pipe(filter(command => command.TaskTag === this.taskId))
|
1692
2348
|
.subscribe(command => {
|
2349
|
+
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
1693
2350
|
this.executeCommand(command);
|
1694
2351
|
});
|
1695
2352
|
this.subscribeInteractiveCommands = this.magic.interactiveCommands
|
1696
2353
|
.pipe(filter(command => command.TaskTag === this.taskId))
|
1697
2354
|
.subscribe(command => {
|
2355
|
+
// console.log("Task " + command.TaskTag + "command " + command.CommandType);
|
1698
2356
|
this.executeInteractiveCommand(command);
|
1699
2357
|
});
|
1700
2358
|
}
|
2359
|
+
/**
|
2360
|
+
* @ignore
|
2361
|
+
*/
|
1701
2362
|
refreshView() {
|
1702
2363
|
this.detectChanges.next('');
|
1703
2364
|
}
|
2365
|
+
/**
|
2366
|
+
* Insert an event to the Magic WebClient event queue
|
2367
|
+
* @param guiEvent The event to insert
|
2368
|
+
*/
|
1704
2369
|
insertEvent(guiEvent) {
|
1705
2370
|
guiEvent.TaskID = this.taskId;
|
1706
2371
|
this.magic.insertEvent(guiEvent);
|
1707
2372
|
}
|
2373
|
+
/**
|
2374
|
+
* @ignore
|
2375
|
+
*/
|
1708
2376
|
GetControlPictureMask(controlName) {
|
1709
2377
|
return this.magic.GetControlPictureMask(this.taskId, controlName);
|
1710
2378
|
}
|
2379
|
+
/**
|
2380
|
+
* @ignore
|
2381
|
+
*/
|
2382
|
+
UploadFileToServer(fileContent, serverFileName) {
|
2383
|
+
return this.magic.UploadFileToServer(fileContent, serverFileName);
|
2384
|
+
}
|
2385
|
+
async DownloadFileFromServer(serverFileName) {
|
2386
|
+
return await this.magic.DownloadFileFromServer(serverFileName);
|
2387
|
+
}
|
2388
|
+
/**
|
2389
|
+
* Validates the control value, using the Magic WebClient
|
2390
|
+
* @param controlName Id of validated control
|
2391
|
+
* @param value value to be validated
|
2392
|
+
* @returns If validation fails, returns error message, else returns null
|
2393
|
+
*/
|
1711
2394
|
ValidateControlValue(controlName, value) {
|
1712
2395
|
return this.magic.ValidateControlValue(this.taskId, controlName, value);
|
1713
2396
|
}
|
2397
|
+
/**
|
2398
|
+
* @ignore
|
2399
|
+
*/
|
1714
2400
|
GetRangedValue(controlName, value) {
|
1715
2401
|
return this.magic.GetRangedValue(this.taskId, controlName, value);
|
1716
2402
|
}
|
2403
|
+
/**
|
2404
|
+
* @ignore
|
2405
|
+
*/
|
1717
2406
|
GetFldRanges(controlName) {
|
1718
2407
|
return this.magic.GetFldRanges(this.taskId, controlName);
|
1719
2408
|
}
|
2409
|
+
/**
|
2410
|
+
* returns the value of a property of the control
|
2411
|
+
* @param controlId Id of control
|
2412
|
+
* @param prop Property
|
2413
|
+
* @param guiRowId Row Id, if applicable
|
2414
|
+
* @returns Property value
|
2415
|
+
*/
|
1720
2416
|
getProperty(controlId, prop, guiRowId) {
|
1721
2417
|
if (isNullOrUndefined(guiRowId))
|
1722
2418
|
guiRowId = '0';
|
@@ -1730,6 +2426,9 @@ class TaskMagicService {
|
|
1730
2426
|
return this.Records.list[guiRowId].getProperty(controlId, prop);
|
1731
2427
|
}
|
1732
2428
|
}
|
2429
|
+
/**
|
2430
|
+
* @ignore
|
2431
|
+
*/
|
1733
2432
|
getPropertyStub(ControlsProperties, controlId, prop) {
|
1734
2433
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
1735
2434
|
if (controlId in ControlsProperties) {
|
@@ -1739,15 +2438,31 @@ class TaskMagicService {
|
|
1739
2438
|
}
|
1740
2439
|
return '';
|
1741
2440
|
}
|
2441
|
+
/**
|
2442
|
+
* @ignore
|
2443
|
+
*/
|
1742
2444
|
getStyleStub(ControlsProperties, controlId, styleName) {
|
1743
2445
|
ControlsProperties = ControlsProperties.ControlsProperties;
|
1744
2446
|
return ControlsProperties[controlId].stylesMap.get(styleName);
|
1745
2447
|
}
|
2448
|
+
/**
|
2449
|
+
* Return the CSS classes used for this control
|
2450
|
+
* @param controlId Id of control
|
2451
|
+
* @param guiRowId Row Id, if applicable
|
2452
|
+
* @returns String containing the classes currently defined for this control
|
2453
|
+
*/
|
1746
2454
|
getClasses(controlId, guiRowId) {
|
1747
2455
|
if (isNullOrUndefined(guiRowId))
|
1748
2456
|
guiRowId = '0';
|
1749
2457
|
return this.Records.list[guiRowId].getControlMetadata(controlId).classes;
|
1750
2458
|
}
|
2459
|
+
/**
|
2460
|
+
* Return the value of a style used for a control
|
2461
|
+
* @param controlId Id of control
|
2462
|
+
* @param styleName Name of style
|
2463
|
+
* @param guiRowId Row Id, if applicable
|
2464
|
+
* @returns value of style of the control
|
2465
|
+
*/
|
1751
2466
|
getStyle(controlId, styleName, guiRowId) {
|
1752
2467
|
if (isNullOrUndefined(guiRowId))
|
1753
2468
|
guiRowId = '0';
|
@@ -1758,21 +2473,45 @@ class TaskMagicService {
|
|
1758
2473
|
return StylesMapManager.magicValueGetStyle(styleName, magicValue);
|
1759
2474
|
}
|
1760
2475
|
}
|
2476
|
+
/**
|
2477
|
+
* Return the value of a control
|
2478
|
+
* @param controlId Id of control
|
2479
|
+
* @param guiRowId Row Id, if applicable
|
2480
|
+
* @returns value of the control
|
2481
|
+
*/
|
1761
2482
|
getValue(controlId, guiRowId) {
|
1762
2483
|
if (isNullOrUndefined(guiRowId))
|
1763
2484
|
guiRowId = '0';
|
1764
2485
|
return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
|
1765
2486
|
}
|
2487
|
+
/**
|
2488
|
+
* Return the formatted value of a control
|
2489
|
+
* @param controlId Id of control
|
2490
|
+
* @param guiRowId Row Id, if applicable
|
2491
|
+
* @returns value of the control
|
2492
|
+
*/
|
1766
2493
|
getFormattedValue(controlName, val, rowId) {
|
1767
2494
|
return this.magic.GetFormattedValue(this.taskId, controlName, val, rowId);
|
1768
2495
|
}
|
2496
|
+
/**
|
2497
|
+
* Sets the value of a control
|
2498
|
+
* @param controlId Id of control
|
2499
|
+
* @param guiRowId Row Id, if applicable
|
2500
|
+
* @param value Value to set
|
2501
|
+
*/
|
1769
2502
|
setValue(controlId, guiRowId, value) {
|
1770
2503
|
return this.Records.list[guiRowId].setValue(controlId, value);
|
1771
2504
|
}
|
2505
|
+
/**
|
2506
|
+
* @ignore
|
2507
|
+
*/
|
1772
2508
|
executeInteractiveCommand(guiInteractiveCommand) {
|
1773
2509
|
GuiInteractiveExecutor.executeInteractiveCommand(this, guiInteractiveCommand, this.overlayWindowService);
|
1774
2510
|
this.interactiveCommands.next(guiInteractiveCommand);
|
1775
2511
|
}
|
2512
|
+
/**
|
2513
|
+
* @ignore
|
2514
|
+
*/
|
1776
2515
|
handleSetProperty(command, isTableChild) {
|
1777
2516
|
let controlId = command.CtrlName;
|
1778
2517
|
let dvRowId = (command.line || 0);
|
@@ -1809,6 +2548,7 @@ class TaskMagicService {
|
|
1809
2548
|
let controlId = command.CtrlName;
|
1810
2549
|
let properties;
|
1811
2550
|
let isTableChild = this.isTableControl(controlId);
|
2551
|
+
// For non-input type controls on table.
|
1812
2552
|
if (command.obj !== null)
|
1813
2553
|
isTableChild = isTableChild || command.obj.IsTableChild;
|
1814
2554
|
guiRowId = this.getGuiRowId(dvRowId, isTableChild);
|
@@ -1871,8 +2611,10 @@ class TaskMagicService {
|
|
1871
2611
|
break;
|
1872
2612
|
case CommandType.PROP_SET_USER_PROPERTY:
|
1873
2613
|
properties = this.Records.list[guiRowId].getControlMetadata(controlId);
|
2614
|
+
// if the property has changed, set the property and raise the subject
|
1874
2615
|
if (properties.userProperties.get(command.Operation) !== command.obj1) {
|
1875
2616
|
properties.userProperties.set(command.Operation, command.obj1);
|
2617
|
+
// the property name is of format <controlName>~<propertyName>
|
1876
2618
|
this.customPropertiesSubject.next({ propertyName: controlId + '~' + command.Operation, value: command.obj1, rowId: guiRowId });
|
1877
2619
|
}
|
1878
2620
|
break;
|
@@ -1926,6 +2668,9 @@ class TaskMagicService {
|
|
1926
2668
|
break;
|
1927
2669
|
}
|
1928
2670
|
}
|
2671
|
+
/**
|
2672
|
+
custom validator
|
2673
|
+
*/
|
1929
2674
|
customValidator(rowid, id) {
|
1930
2675
|
return (control) => {
|
1931
2676
|
let controlMetadata;
|
@@ -1939,6 +2684,13 @@ class TaskMagicService {
|
|
1939
2684
|
return null;
|
1940
2685
|
};
|
1941
2686
|
}
|
2687
|
+
/**
|
2688
|
+
* COnvert a value from Magic format to native format
|
2689
|
+
* @param controlId Id of control
|
2690
|
+
* @param rowId Row Id, if applicable
|
2691
|
+
* @param val Value to convert
|
2692
|
+
* @returns Converted value
|
2693
|
+
*/
|
1942
2694
|
ConvertValToNative(controlId, rowId, val) {
|
1943
2695
|
let properties;
|
1944
2696
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
@@ -1990,6 +2742,13 @@ class TaskMagicService {
|
|
1990
2742
|
return val;
|
1991
2743
|
}
|
1992
2744
|
}
|
2745
|
+
/**
|
2746
|
+
* Convert a value from native to Magic format
|
2747
|
+
* @param controlId Id of control
|
2748
|
+
* @param rowId Row Id, if applicable
|
2749
|
+
* @param val Value to convert
|
2750
|
+
* @returns Converted value
|
2751
|
+
*/
|
1993
2752
|
ConvertValFromNative(controlId, rowId, val) {
|
1994
2753
|
let properties;
|
1995
2754
|
properties = this.Records.list[0].getControlMetadata(controlId);
|
@@ -2032,12 +2791,22 @@ class TaskMagicService {
|
|
2032
2791
|
return val;
|
2033
2792
|
}
|
2034
2793
|
}
|
2794
|
+
/**
|
2795
|
+
* Handle resize and also fetch chunk of records if having an empty view.
|
2796
|
+
* @ignore
|
2797
|
+
* @param pageSize : PageSize
|
2798
|
+
* @param topGuiRowId : GuiRowId of first record in view.
|
2799
|
+
*/
|
2035
2800
|
resize(pageSize, topGuiRowId) {
|
2036
2801
|
let guiEvent = getGuiEventObj('resize', 'table', 0);
|
2037
2802
|
guiEvent.PageSize = pageSize;
|
2803
|
+
//As 'getRows' event also gets executed, set the guiEvent.Line parameter.
|
2038
2804
|
guiEvent.Line = topGuiRowId;
|
2039
2805
|
this.insertEvent(guiEvent);
|
2040
2806
|
}
|
2807
|
+
/**
|
2808
|
+
* Fetches data for new table rows when scrolling done
|
2809
|
+
*/
|
2041
2810
|
onScrollDown() {
|
2042
2811
|
if (!this.Records.includesLast) {
|
2043
2812
|
let guiEvent = getGuiEventObj('getRows', '', 0);
|
@@ -2045,15 +2814,29 @@ class TaskMagicService {
|
|
2045
2814
|
this.insertEvent(guiEvent);
|
2046
2815
|
}
|
2047
2816
|
}
|
2817
|
+
/**
|
2818
|
+
* Sets the new browser window title
|
2819
|
+
* @param newTitle New window title
|
2820
|
+
*/
|
2048
2821
|
setTitle(newTitle) {
|
2049
2822
|
this.mgTitleService.setTitle(newTitle);
|
2050
2823
|
}
|
2824
|
+
/**
|
2825
|
+
* @ignore
|
2826
|
+
*/
|
2051
2827
|
getGuiRowId(dvRowId, isTableControl) {
|
2052
2828
|
return (isTableControl ? dvRowId + this.Records.recordsBeforeCurrentView : 0);
|
2053
2829
|
}
|
2830
|
+
/**
|
2831
|
+
*
|
2832
|
+
* @ignore
|
2833
|
+
*/
|
2054
2834
|
getDvRowId(guiRowId) {
|
2055
2835
|
return (guiRowId - this.Records.recordsBeforeCurrentView);
|
2056
2836
|
}
|
2837
|
+
/**
|
2838
|
+
* Clean up the service when it is no longer needed
|
2839
|
+
*/
|
2057
2840
|
dispose() {
|
2058
2841
|
this.refreshDom.complete();
|
2059
2842
|
this.detectChanges.complete();
|
@@ -2063,6 +2846,14 @@ class TaskMagicService {
|
|
2063
2846
|
this.customPropertiesSubject.complete();
|
2064
2847
|
this.OnSelectedRowChanged.complete();
|
2065
2848
|
}
|
2849
|
+
///////////////////////////////
|
2850
|
+
//Events:
|
2851
|
+
/**
|
2852
|
+
* Handle the Combobox "change" event
|
2853
|
+
* @param event The event received from the UI
|
2854
|
+
* @param idx Id of the control raising the event
|
2855
|
+
* @param line Row Id, if applicable
|
2856
|
+
*/
|
2066
2857
|
onComboboxSelectionChanged(event, idx, line) {
|
2067
2858
|
let guiEvent = getGuiEventObj('selectionchanged', idx, line);
|
2068
2859
|
if (typeof (event) == 'number') {
|
@@ -2081,6 +2872,11 @@ class TaskMagicService {
|
|
2081
2872
|
}
|
2082
2873
|
this.insertEvent(guiEvent);
|
2083
2874
|
}
|
2875
|
+
/**
|
2876
|
+
* Handle the Listbox "change" event
|
2877
|
+
* @param event The event received from the UI
|
2878
|
+
* @param idx Id of the control raising the event
|
2879
|
+
*/
|
2084
2880
|
onListBoxSelectionChanged(event, idx) {
|
2085
2881
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
2086
2882
|
let selectedOptions;
|
@@ -2096,9 +2892,15 @@ class TaskMagicService {
|
|
2096
2892
|
else
|
2097
2893
|
indexes[i] = (selectedOptions[i]).value;
|
2098
2894
|
}
|
2099
|
-
guiEvent.Value = indexes;
|
2895
|
+
guiEvent.Value = indexes; // TODO: fix
|
2100
2896
|
this.insertEvent(guiEvent);
|
2101
2897
|
}
|
2898
|
+
/**
|
2899
|
+
* Handle the Checkbox "change" event
|
2900
|
+
* @param event The event received from the UI
|
2901
|
+
* @param idx Id of the control raising the event
|
2902
|
+
* @param rowId Row Id, if applicable
|
2903
|
+
*/
|
2102
2904
|
onCheckChanged(event, idx, rowId) {
|
2103
2905
|
if (typeof rowId === 'undefined')
|
2104
2906
|
rowId = 0;
|
@@ -2107,12 +2909,12 @@ class TaskMagicService {
|
|
2107
2909
|
guiEvent.Value = event;
|
2108
2910
|
}
|
2109
2911
|
else if (typeof (event) == 'string') {
|
2110
|
-
if (event == "unchecked") {
|
2912
|
+
if (event == "unchecked") { // @ts-ignore
|
2111
2913
|
guiEvent.Value = false;
|
2112
2914
|
}
|
2113
2915
|
else if (event == 'indeterminate')
|
2114
2916
|
guiEvent.Value = null;
|
2115
|
-
else if (event == 'checked') {
|
2917
|
+
else if (event == 'checked') { // @ts-ignore
|
2116
2918
|
guiEvent.Value = true;
|
2117
2919
|
}
|
2118
2920
|
}
|
@@ -2124,11 +2926,21 @@ class TaskMagicService {
|
|
2124
2926
|
}
|
2125
2927
|
this.insertEvent(guiEvent);
|
2126
2928
|
}
|
2929
|
+
/**
|
2930
|
+
* Handle tab selection change, caused by UI events
|
2931
|
+
* @param idx Id of the control raising the event
|
2932
|
+
* @param layer Id of selected tabpage
|
2933
|
+
*/
|
2127
2934
|
mgOnTabSelectionChanged(idx, layer) {
|
2128
2935
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
2129
2936
|
guiEvent.Value = layer.toString();
|
2130
2937
|
this.insertEvent(guiEvent);
|
2131
2938
|
}
|
2939
|
+
/**
|
2940
|
+
* Handle the Radio button "change" event
|
2941
|
+
* @param event The event received from the UI
|
2942
|
+
* @param idx Id of the control raising the event
|
2943
|
+
*/
|
2132
2944
|
mgOnRadioSelectionChanged(idx) {
|
2133
2945
|
let result = this.getFormControl('0', idx);
|
2134
2946
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
@@ -2138,16 +2950,34 @@ class TaskMagicService {
|
|
2138
2950
|
guiEvent.Value = result.value.toString();
|
2139
2951
|
this.insertEvent(guiEvent);
|
2140
2952
|
}
|
2953
|
+
/**
|
2954
|
+
* Inserts the "close" event to the magic WebClient event queue
|
2955
|
+
*/
|
2141
2956
|
close() {
|
2142
2957
|
this.insertEvent(getGuiEventObj('close', null, 0));
|
2143
2958
|
}
|
2959
|
+
///////////////////////////////
|
2960
|
+
/**
|
2961
|
+
* @ignore
|
2962
|
+
*/
|
2144
2963
|
IsStub() {
|
2145
2964
|
return this.magic.isStub;
|
2146
2965
|
}
|
2966
|
+
//////////////////////////////////////////////////////////////
|
2967
|
+
///Stub handling
|
2968
|
+
/**
|
2969
|
+
* @ignore
|
2970
|
+
*/
|
2147
2971
|
jsonData;
|
2972
|
+
/**
|
2973
|
+
* @ignore
|
2974
|
+
*/
|
2148
2975
|
saveData(data) {
|
2149
2976
|
this.magic.saveData(data);
|
2150
2977
|
}
|
2978
|
+
/**
|
2979
|
+
* @ignore
|
2980
|
+
*/
|
2151
2981
|
createData() {
|
2152
2982
|
let myData = {
|
2153
2983
|
records: this.Records,
|
@@ -2159,6 +2989,9 @@ class TaskMagicService {
|
|
2159
2989
|
console.log(text);
|
2160
2990
|
this.saveData(text);
|
2161
2991
|
}
|
2992
|
+
/**
|
2993
|
+
* @ignore
|
2994
|
+
*/
|
2162
2995
|
loadStubData(stubData) {
|
2163
2996
|
this.Records = stubData.records;
|
2164
2997
|
this.settemplate(stubData.template);
|
@@ -2166,9 +2999,15 @@ class TaskMagicService {
|
|
2166
2999
|
for (let i = 0; i < this.Records.list.length; i++)
|
2167
3000
|
this.buildTableRowControls(i);
|
2168
3001
|
}
|
3002
|
+
/**
|
3003
|
+
* @ignore
|
3004
|
+
*/
|
2169
3005
|
loadData() {
|
2170
3006
|
alert('Please, overwrite method loadData');
|
2171
3007
|
}
|
3008
|
+
/**
|
3009
|
+
* @ignore
|
3010
|
+
*/
|
2172
3011
|
setStubValue(guiRowId, fc, name) {
|
2173
3012
|
if (this.IsStub()) {
|
2174
3013
|
try {
|
@@ -2179,45 +3018,79 @@ class TaskMagicService {
|
|
2179
3018
|
}
|
2180
3019
|
}
|
2181
3020
|
}
|
2182
|
-
static ɵfac = function TaskMagicService_Factory(
|
2183
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
3021
|
+
/** @nocollapse */ static ɵfac = function TaskMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskMagicService)(i0.ɵɵinject(EngineMagicService), i0.ɵɵinject(OverlayWindowService)); };
|
3022
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TaskMagicService, factory: TaskMagicService.ɵfac });
|
2184
3023
|
}
|
2185
3024
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskMagicService, [{
|
2186
3025
|
type: Injectable
|
2187
3026
|
}], () => [{ type: EngineMagicService }, { type: OverlayWindowService }], null); })();
|
2188
3027
|
|
3028
|
+
/**
|
3029
|
+
* Implements various table-related functionalities
|
3030
|
+
*/
|
2189
3031
|
class TableMagicService {
|
2190
3032
|
componentList;
|
2191
3033
|
task;
|
2192
3034
|
selectedItem;
|
2193
3035
|
chunkSize;
|
3036
|
+
/**
|
3037
|
+
*
|
3038
|
+
* @param componentList Component-mapping service
|
3039
|
+
* @param task Magic task service
|
3040
|
+
*/
|
2194
3041
|
constructor(componentList, task) {
|
2195
3042
|
this.componentList = componentList;
|
2196
3043
|
this.task = task;
|
2197
3044
|
}
|
2198
3045
|
shouldOpenFieldTextEditor = true;
|
3046
|
+
/**
|
3047
|
+
* Refreshes the DataSource
|
3048
|
+
*/
|
2199
3049
|
refreshDataSource() {
|
2200
3050
|
}
|
3051
|
+
/**
|
3052
|
+
* Returns the table page size
|
3053
|
+
* chunkSize as default value for non-paginated tables.
|
3054
|
+
*/
|
2201
3055
|
getPageSize() {
|
2202
3056
|
return this.chunkSize;
|
2203
3057
|
}
|
2204
3058
|
setChunkSize(size) {
|
2205
3059
|
this.chunkSize = size;
|
2206
3060
|
}
|
3061
|
+
/**
|
3062
|
+
* Returns max no of rows in the table.
|
3063
|
+
*/
|
2207
3064
|
getMaxRowsInTable() {
|
2208
3065
|
return this.task.Records.list.length;
|
2209
3066
|
}
|
3067
|
+
/**
|
3068
|
+
* Selects the specified row
|
3069
|
+
* @param rowId The row to select
|
3070
|
+
*/
|
2210
3071
|
selectRow(rowId) {
|
2211
3072
|
this.selectedItem = rowId;
|
2212
3073
|
}
|
2213
3074
|
getSelectedRow() {
|
2214
3075
|
return this.selectedItem;
|
2215
3076
|
}
|
3077
|
+
/**
|
3078
|
+
* Returns the selected row
|
3079
|
+
*/
|
2216
3080
|
selectedRow() {
|
2217
3081
|
return null;
|
2218
3082
|
}
|
3083
|
+
/**
|
3084
|
+
* Selects the specified page
|
3085
|
+
* @param pageId The page to select
|
3086
|
+
*/
|
2219
3087
|
selectPage(pageId) {
|
2220
3088
|
}
|
3089
|
+
/**
|
3090
|
+
* Returns whether a dialog should be opened for the HTML element
|
3091
|
+
* @param element The HTML element for which a dialog may be needed
|
3092
|
+
* @returns
|
3093
|
+
*/
|
2221
3094
|
OpenDialogForControl(element) {
|
2222
3095
|
if (element.tagName === "MAT-SELECT" || element.tagName === "MAT-CHECKBOX" ||
|
2223
3096
|
element.tagName === "INPUT" ||
|
@@ -2225,17 +3098,34 @@ class TableMagicService {
|
|
2225
3098
|
return false;
|
2226
3099
|
return true;
|
2227
3100
|
}
|
3101
|
+
/**
|
3102
|
+
* Returns the dialog used to edit values
|
3103
|
+
*/
|
2228
3104
|
getDialog() {
|
2229
3105
|
return null;
|
2230
3106
|
}
|
3107
|
+
/**
|
3108
|
+
* Handles the table "scrolled" event
|
3109
|
+
*/
|
2231
3110
|
onScrollDown() {
|
2232
3111
|
this.task.onScrollDown();
|
2233
3112
|
}
|
3113
|
+
/**
|
3114
|
+
* To be overwitten in specific implelemtations
|
3115
|
+
*/
|
2234
3116
|
sortData(e) { }
|
3117
|
+
/**
|
3118
|
+
* To be overwitten in specific implelemtations
|
3119
|
+
*/
|
2235
3120
|
mgOnPaginateChange(e, changeSelectedRow) { }
|
2236
3121
|
mgOptionChanged(e) { }
|
3122
|
+
/**
|
3123
|
+
* Change the number of lines in a table
|
3124
|
+
* @param size New number of lines in table
|
3125
|
+
*/
|
2237
3126
|
updateTableSize(size) {
|
2238
|
-
if (size === 0)
|
3127
|
+
if (size === 0) // never remove row 0 for now
|
3128
|
+
{
|
2239
3129
|
size = 1;
|
2240
3130
|
this.task.Records.clearFirstTableRecord(this.task.template);
|
2241
3131
|
}
|
@@ -2243,34 +3133,51 @@ class TableMagicService {
|
|
2243
3133
|
this.task.Records.updateSize(size);
|
2244
3134
|
this.task.setIncludesFirst(false);
|
2245
3135
|
}
|
3136
|
+
/**
|
3137
|
+
* @ignore
|
3138
|
+
*/
|
2246
3139
|
setTableTopIndex(value) {
|
2247
3140
|
if (!this.task.Records.includesFirst)
|
2248
3141
|
value++;
|
2249
3142
|
this.task.Records.setGuiTopIndex(value);
|
2250
3143
|
}
|
3144
|
+
/**
|
3145
|
+
* @ignore
|
3146
|
+
*/
|
2251
3147
|
getTableTopIndex() {
|
2252
3148
|
let topIndex = this.task.Records.getGuiTopIndex();
|
2253
3149
|
if (!this.task.Records.includesFirst)
|
2254
3150
|
topIndex--;
|
2255
3151
|
return topIndex;
|
2256
3152
|
}
|
2257
|
-
static ɵfac = function TableMagicService_Factory(
|
2258
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
3153
|
+
/** @nocollapse */ static ɵfac = function TableMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableMagicService)(i0.ɵɵinject(ComponentListMagicService), i0.ɵɵinject(TaskMagicService)); };
|
3154
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TableMagicService, factory: TableMagicService.ɵfac });
|
2259
3155
|
}
|
2260
3156
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableMagicService, [{
|
2261
3157
|
type: Injectable
|
2262
3158
|
}], () => [{ type: ComponentListMagicService }, { type: TaskMagicService }], null); })();
|
2263
3159
|
|
3160
|
+
/**
|
3161
|
+
* Enables changing the browser title using Magic expression (SetTitle)
|
3162
|
+
*/
|
2264
3163
|
class TitleMagicService {
|
2265
3164
|
titleService;
|
3165
|
+
/**
|
3166
|
+
*
|
3167
|
+
* @param titleService Angular's title-changing class
|
3168
|
+
*/
|
2266
3169
|
constructor(titleService) {
|
2267
3170
|
this.titleService = titleService;
|
2268
3171
|
}
|
3172
|
+
/**
|
3173
|
+
* Set the new title of the window
|
3174
|
+
* @param newTitle New title of the window
|
3175
|
+
*/
|
2269
3176
|
setTitle(newTitle) {
|
2270
3177
|
this.titleService.setTitle(newTitle);
|
2271
3178
|
}
|
2272
|
-
static ɵfac = function TitleMagicService_Factory(
|
2273
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
3179
|
+
/** @nocollapse */ static ɵfac = function TitleMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleMagicService)(i0.ɵɵinject(i1$1.Title)); };
|
3180
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: TitleMagicService, factory: TitleMagicService.ɵfac });
|
2274
3181
|
}
|
2275
3182
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TitleMagicService, [{
|
2276
3183
|
type: Injectable
|
@@ -2294,6 +3201,7 @@ class MagicColorService {
|
|
2294
3201
|
}
|
2295
3202
|
colorsData;
|
2296
3203
|
fileNotFound = false;
|
3204
|
+
// public static FILE_NAME;
|
2297
3205
|
constructor(http, colorFile1 = 'clr_rnt.eng') {
|
2298
3206
|
this.http = http;
|
2299
3207
|
if (colorFile1)
|
@@ -2313,6 +3221,7 @@ class MagicColorService {
|
|
2313
3221
|
}
|
2314
3222
|
hexToRgba(hex, isTransperent) {
|
2315
3223
|
let shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])$/i;
|
3224
|
+
// convert it to format : aarrggbb
|
2316
3225
|
hex = hex.replace(shorthandRegex, function (m, r, g, b, a) {
|
2317
3226
|
return a + a + r + r + g + g + b + b;
|
2318
3227
|
});
|
@@ -2327,16 +3236,24 @@ class MagicColorService {
|
|
2327
3236
|
rgb.alpha = 0;
|
2328
3237
|
return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + rgb.alpha + ')';
|
2329
3238
|
}
|
3239
|
+
/**
|
3240
|
+
* Returns the rgba value of specified color
|
3241
|
+
* @returns : value in format rgba(128,128,128,1)
|
3242
|
+
* @param : colorNumber -0 based index of color for which RGBA values are returned
|
3243
|
+
* @param: colorType : 1-MAGIC_FG_COLOR, 2-MAGIC_BG_COLOR
|
3244
|
+
*/
|
2330
3245
|
getColor(colorIndex, colorType) {
|
2331
3246
|
let isTransperent = false;
|
2332
3247
|
if (!this.colorsData && !this.fileNotFound)
|
2333
3248
|
this.getColorData();
|
2334
|
-
if (this.colorsData) {
|
3249
|
+
if (this.colorsData) { // color exists
|
2335
3250
|
if (this.colorsData[colorIndex - 1]) {
|
2336
3251
|
const grayHashCode = '00808080';
|
2337
3252
|
let hex = grayHashCode;
|
2338
|
-
let color = this.colorsData[colorIndex - 1].split(',');
|
3253
|
+
let color = this.colorsData[colorIndex - 1].split(','); // get the color details
|
2339
3254
|
let colorAtrributes = +color[3];
|
3255
|
+
// color[0] - name, color[1] - FG color, color[2] - BG color
|
3256
|
+
// color[3] - attr flags (1 - transperent, 2 - system FG, 4 - system bg)
|
2340
3257
|
switch (colorType) {
|
2341
3258
|
case MAGIC_FG_COLOR:
|
2342
3259
|
if (colorAtrributes != SYSTEM_FG && colorAtrributes != SYSTEM_FG_AND_SYSTEM_BG)
|
@@ -2360,8 +3277,8 @@ class MagicColorService {
|
|
2360
3277
|
}
|
2361
3278
|
return '';
|
2362
3279
|
}
|
2363
|
-
static ɵfac = function MagicColorService_Factory(
|
2364
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
3280
|
+
/** @nocollapse */ static ɵfac = function MagicColorService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicColorService)(i0.ɵɵinject(i1$2.HttpClient), i0.ɵɵinject(COLOR_FILE_NAME)); };
|
3281
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicColorService, factory: MagicColorService.ɵfac, providedIn: 'root' });
|
2365
3282
|
}
|
2366
3283
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicColorService, [{
|
2367
3284
|
type: Injectable,
|
@@ -2373,17 +3290,35 @@ class MagicColorService {
|
|
2373
3290
|
args: [COLOR_FILE_NAME]
|
2374
3291
|
}] }], null); })();
|
2375
3292
|
|
3293
|
+
/**
|
3294
|
+
* Provides the UI with values calculated by the Magic WebClient
|
3295
|
+
*/
|
2376
3296
|
class AccessorMagicService {
|
2377
3297
|
task;
|
2378
3298
|
magicColor;
|
2379
3299
|
Logger = null;
|
2380
3300
|
hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
|
2381
3301
|
hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
|
3302
|
+
/**
|
3303
|
+
* @ignore
|
3304
|
+
*/
|
2382
3305
|
constructor(task, magicColor) {
|
2383
3306
|
this.task = task;
|
2384
3307
|
this.magicColor = magicColor;
|
2385
3308
|
this.Logger = Logger.Instance;
|
2386
3309
|
}
|
3310
|
+
UploadFileToServer(fileContent, serverFileName) {
|
3311
|
+
return this.task.UploadFileToServer(fileContent, serverFileName);
|
3312
|
+
}
|
3313
|
+
async DownloadFileFromServer(serverFileName) {
|
3314
|
+
return await this.task.DownloadFileFromServer(serverFileName);
|
3315
|
+
}
|
3316
|
+
/**
|
3317
|
+
* Checks if the control is read-only
|
3318
|
+
* @param controlId Id of control
|
3319
|
+
* @returns Is the control not read-only
|
3320
|
+
*/
|
3321
|
+
// CheckReadOnly
|
2387
3322
|
checkIsReadOnly(controlId) {
|
2388
3323
|
let properties;
|
2389
3324
|
properties = this.task.Records.list[0].getControlMetadata(controlId);
|
@@ -2392,34 +3327,91 @@ class AccessorMagicService {
|
|
2392
3327
|
else
|
2393
3328
|
return false;
|
2394
3329
|
}
|
3330
|
+
/**
|
3331
|
+
* Returns the text of the control
|
3332
|
+
* @param controlId Id of control
|
3333
|
+
* @param rowId Id of row, if applicable
|
3334
|
+
* @returns The text of the control
|
3335
|
+
*/
|
3336
|
+
// mgGetText
|
2395
3337
|
getText(controlId, rowId) {
|
2396
3338
|
return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
|
2397
3339
|
}
|
3340
|
+
/**
|
3341
|
+
* Gets the text of the tab page
|
3342
|
+
* @param controlId Id of control
|
3343
|
+
* @param layer Id of tabpage
|
3344
|
+
* @returns Text of tabpage
|
3345
|
+
*/
|
3346
|
+
// mgGetTabpageText
|
2398
3347
|
getTabpageText(controlId, layer) {
|
2399
3348
|
const items = this.task.getProperty(controlId, HtmlProperties.ItemsList);
|
2400
3349
|
if (typeof items !== "undefined")
|
2401
3350
|
return items[layer].displayValue;
|
2402
3351
|
return "";
|
2403
3352
|
}
|
3353
|
+
/**
|
3354
|
+
* Gets the image defined for the control
|
3355
|
+
* @param controlId Id of control
|
3356
|
+
* @param rowId Id of row, if applicable
|
3357
|
+
* @returns Image set on control
|
3358
|
+
*/
|
3359
|
+
// mgGetImage
|
2404
3360
|
getImage(controlId, rowId) {
|
2405
3361
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
2406
3362
|
return result;
|
2407
3363
|
}
|
3364
|
+
/**
|
3365
|
+
* Returns whether an image is set for this control
|
3366
|
+
* @param controlId Id of control
|
3367
|
+
* @param rowId Id of row, if applicable
|
3368
|
+
* @returns returns true if control has an image set on it
|
3369
|
+
*/
|
3370
|
+
// mgIsImageExists
|
2408
3371
|
isImageExists(controlId, rowId) {
|
2409
3372
|
let result = this.task.getProperty(controlId, HtmlProperties.Image, rowId);
|
2410
3373
|
return !isNullOrUndefined(result);
|
2411
3374
|
}
|
3375
|
+
/**
|
3376
|
+
* Gets the CSS classes set on the control
|
3377
|
+
* @param controlId Id of control
|
3378
|
+
* @param rowId Id of row, if applicable
|
3379
|
+
* @returns The classes for this control
|
3380
|
+
*/
|
3381
|
+
// mgGetClasses
|
2412
3382
|
getClasses(controlId, rowId) {
|
2413
3383
|
return this.task.getClasses(controlId, rowId);
|
2414
3384
|
}
|
3385
|
+
/**
|
3386
|
+
* Gets the CSS styles set on the control
|
3387
|
+
* @param controlId Id of control
|
3388
|
+
* @param styleName NAme of style requested
|
3389
|
+
* @param rowId Id of row, if applicable
|
3390
|
+
* @returns The style set on the control
|
3391
|
+
*/
|
3392
|
+
// mgGetStyle
|
2415
3393
|
getStyle(controlId, styleName, rowId) {
|
2416
3394
|
let style = this.task.getStyle(controlId, styleName, rowId);
|
2417
3395
|
return style;
|
2418
3396
|
}
|
3397
|
+
/**
|
3398
|
+
* Returns whether a control is visible or not
|
3399
|
+
* @param controlId Id of control
|
3400
|
+
* @param rowId Id of row, if applicable
|
3401
|
+
* @returns Is the control visible or hidden
|
3402
|
+
*/
|
3403
|
+
// mgGetVisible
|
2419
3404
|
getVisible(controlId, rowId) {
|
2420
3405
|
let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
|
2421
3406
|
return vis ? 'visible' : 'hidden';
|
2422
3407
|
}
|
3408
|
+
/**
|
3409
|
+
* Returns alpha mask of a control
|
3410
|
+
* @param controlId Id of control
|
3411
|
+
* @param rowId Id of row, if applicable
|
3412
|
+
* @returns alpha mask of the control
|
3413
|
+
*/
|
3414
|
+
// getAlphaMask
|
2423
3415
|
getAlphaMask(controlId, rowId) {
|
2424
3416
|
if (isNullOrUndefined(controlId))
|
2425
3417
|
return null;
|
@@ -2443,6 +3435,12 @@ class AccessorMagicService {
|
|
2443
3435
|
}
|
2444
3436
|
return (pic != null) ? valueStr.toString() : null;
|
2445
3437
|
}
|
3438
|
+
/**
|
3439
|
+
* Returns object representing numeric picture
|
3440
|
+
* @param picture string which is defined in magic
|
3441
|
+
* @returns object representing numeric picture
|
3442
|
+
*/
|
3443
|
+
// mgGetNumericPicture
|
2446
3444
|
getNumericPicture(picture) {
|
2447
3445
|
var obj = {};
|
2448
3446
|
if (isNullOrUndefined(picture))
|
@@ -2475,51 +3473,140 @@ class AccessorMagicService {
|
|
2475
3473
|
obj['wholes'] = pic.getWholes();
|
2476
3474
|
return obj;
|
2477
3475
|
}
|
3476
|
+
/**
|
3477
|
+
* Returns whether a control should have the "required" attribute set on it
|
3478
|
+
* @param controlId Id of control
|
3479
|
+
* @param rowId Id of row, if applicable
|
3480
|
+
* @returns
|
3481
|
+
*/
|
3482
|
+
// mgGetMustInput
|
2478
3483
|
getMustInput(controlId, rowId) {
|
2479
3484
|
let vis = this.getProperty(controlId, HtmlProperties.MustInput, rowId);
|
2480
3485
|
return vis ? 'true' : 'false';
|
2481
3486
|
}
|
3487
|
+
/**
|
3488
|
+
* Returns whether a control is disabled
|
3489
|
+
* @param controlId Id of control
|
3490
|
+
* @param rowId Id of row, if applicable
|
3491
|
+
* @returns
|
3492
|
+
*/
|
3493
|
+
// mgIsDisabled
|
2482
3494
|
isDisabled(controlId, rowId) {
|
2483
3495
|
let result = this.getProperty(controlId, HtmlProperties.Enabled, rowId);
|
2484
3496
|
return result === true ? null : true;
|
2485
3497
|
}
|
3498
|
+
/**
|
3499
|
+
* @ignore
|
3500
|
+
*/
|
3501
|
+
// getProperty (not changed)
|
2486
3502
|
getProperty(controlId, prop, rowId) {
|
2487
3503
|
return this.task.getProperty(controlId, prop, rowId);
|
2488
3504
|
}
|
3505
|
+
/**
|
3506
|
+
* Returns the title (tooltip) text of the control
|
3507
|
+
* @param controlId Id of control
|
3508
|
+
* @param rowId Id of row, if applicable
|
3509
|
+
* @returns
|
3510
|
+
*/
|
3511
|
+
// mgGetTitle
|
2489
3512
|
getTitle(controlId, rowId) {
|
2490
3513
|
return this.task.getProperty(controlId, HtmlProperties.Tooltip, rowId);
|
2491
3514
|
}
|
3515
|
+
/**
|
3516
|
+
* Returns the title (tooltip) text of the control
|
3517
|
+
* @param controlId Id of control
|
3518
|
+
* @param rowId Id of row, if applicable
|
3519
|
+
* @returns
|
3520
|
+
*/
|
3521
|
+
// mgGetTitle for zoom button
|
2492
3522
|
getZoomButtonTitle(controlId, rowId) {
|
2493
3523
|
return this.task.getProperty(controlId, HtmlProperties.ZoomButtonTooltip, rowId);
|
2494
3524
|
}
|
3525
|
+
/**
|
3526
|
+
* Gets the selection control's selected value
|
3527
|
+
* @param controlId Id of control
|
3528
|
+
* @param rowId Id of row, if applicable
|
3529
|
+
* @returns
|
3530
|
+
*/
|
3531
|
+
// getSelectedValue
|
2495
3532
|
getSelectedValue(controlId, rowId) {
|
2496
3533
|
return this.task.getProperty(controlId, HtmlProperties.SelectedValue, rowId);
|
2497
3534
|
}
|
3535
|
+
/**
|
3536
|
+
* Gets the place-holder text of the control
|
3537
|
+
* @param controlId Id of control
|
3538
|
+
* @param rowId Id of row, if applicable
|
3539
|
+
* @returns
|
3540
|
+
*/
|
3541
|
+
// mgGetPlaceholder
|
2498
3542
|
getPlaceholder(controlId, rowId) {
|
2499
3543
|
return this.task.getProperty(controlId, HtmlProperties.PlaceHolder, rowId);
|
2500
3544
|
}
|
3545
|
+
/**
|
3546
|
+
* Returns a type for input controls - should the control be a simple text or a password control
|
3547
|
+
* @param controlId Id of control
|
3548
|
+
* @param rowId Id of row, if applicable
|
3549
|
+
* @returns
|
3550
|
+
*/
|
3551
|
+
// mgGetType
|
2501
3552
|
getType(controlId, rowId) {
|
2502
3553
|
let result = this.task.getProperty(controlId, HtmlProperties.Password, rowId);
|
2503
3554
|
return result ? "password" : "text";
|
2504
3555
|
}
|
3556
|
+
/**
|
3557
|
+
* Returns the tab-index of the control
|
3558
|
+
* @param controlId Id of control
|
3559
|
+
* @param rowId Id of row, if applicable
|
3560
|
+
* @returns
|
3561
|
+
*/
|
3562
|
+
// mgGetTabIndex
|
2505
3563
|
getTabIndex(controlId, rowId) {
|
2506
3564
|
return this.task.getProperty(controlId, HtmlProperties.TabIndex, rowId);
|
2507
3565
|
}
|
3566
|
+
/**
|
3567
|
+
* Returns the value of the control
|
3568
|
+
* @param controlId Id of control
|
3569
|
+
* @param rowId Id of row, if applicable
|
3570
|
+
* @returns
|
3571
|
+
*/
|
3572
|
+
/// mgGetValue -->
|
2508
3573
|
getValue(controlId, rowId) {
|
2509
3574
|
let val = this.task.getValue(controlId, rowId);
|
2510
3575
|
return val;
|
2511
3576
|
}
|
3577
|
+
/**
|
3578
|
+
* Returns the formatted value of the control
|
3579
|
+
* @param controlId Id of control
|
3580
|
+
* @param rowId Id of row, if applicable
|
3581
|
+
* @returns
|
3582
|
+
*/
|
3583
|
+
/// mgGetValue -->
|
2512
3584
|
getFormattedValue(controlId, rowId) {
|
2513
3585
|
let val = this.task.getValue(controlId, rowId);
|
2514
3586
|
val = this.task.getFormattedValue(controlId, val, rowId);
|
2515
3587
|
return val;
|
2516
3588
|
}
|
3589
|
+
/**
|
3590
|
+
* Returns the Picture of the control
|
3591
|
+
* @param controlId Id of control
|
3592
|
+
* @param rowId Id of row, if applicable
|
3593
|
+
* @returns
|
3594
|
+
*/
|
3595
|
+
/// getPicture -->
|
2517
3596
|
getPicture(controlId, rowId) {
|
2518
3597
|
if (isNullOrUndefined(controlId))
|
2519
3598
|
return null;
|
2520
3599
|
let pic = this.task.GetControlPictureMask(controlId);
|
2521
3600
|
return (pic != null) ? pic.getFormat().toString() : null;
|
2522
3601
|
}
|
3602
|
+
/**
|
3603
|
+
* Returns the custom (user) properties of the control
|
3604
|
+
* @param controlId Id of control
|
3605
|
+
* @param propertyName Name of requested property
|
3606
|
+
* @param rowId Id of row, if applicable
|
3607
|
+
* @returns
|
3608
|
+
*/
|
3609
|
+
// mgGetCustomProperty
|
2523
3610
|
getCustomProperty(controlId, propertyNameOrRowID, rowId) {
|
2524
3611
|
if (controlId.indexOf('~') == -1)
|
2525
3612
|
return this.getCustomProperty_1(controlId, propertyNameOrRowID, rowId);
|
@@ -2544,9 +3631,22 @@ class AccessorMagicService {
|
|
2544
3631
|
}
|
2545
3632
|
return userProperties;
|
2546
3633
|
}
|
3634
|
+
/**
|
3635
|
+
* Gets the values of the items of a selection control
|
3636
|
+
* @param id Id of control
|
3637
|
+
* @param rowId Id of row, if applicable
|
3638
|
+
* @returns
|
3639
|
+
*/
|
3640
|
+
// mgGetItemListValues
|
2547
3641
|
getItemListValues(id, rowId) {
|
2548
3642
|
return this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
2549
3643
|
}
|
3644
|
+
/**
|
3645
|
+
* Gets the filtered items list based on the current value of the control
|
3646
|
+
* @param controlId Id of control
|
3647
|
+
* @param rowId Id of row, if applicable
|
3648
|
+
* @returns
|
3649
|
+
*/
|
2550
3650
|
getFilteredList(controlId, rowId) {
|
2551
3651
|
if (isNullOrUndefined(rowId))
|
2552
3652
|
rowId = '0';
|
@@ -2559,6 +3659,12 @@ class AccessorMagicService {
|
|
2559
3659
|
else
|
2560
3660
|
return items;
|
2561
3661
|
}
|
3662
|
+
/**
|
3663
|
+
* Gets the display value of the item from items of a selection control
|
3664
|
+
* @param id Id of control
|
3665
|
+
* @param rowId Id of row, if applicable
|
3666
|
+
* @returns
|
3667
|
+
*/
|
2562
3668
|
getDisplayValue(id, rowId) {
|
2563
3669
|
let displayValue = "";
|
2564
3670
|
let o = this.getProperty(id, HtmlProperties.ItemsList, rowId);
|
@@ -2567,6 +3673,12 @@ class AccessorMagicService {
|
|
2567
3673
|
displayValue = o[value].displayValue;
|
2568
3674
|
return displayValue;
|
2569
3675
|
}
|
3676
|
+
/**
|
3677
|
+
* Returns whether a tab page is selected or not
|
3678
|
+
* @param index of current option in iterarotr
|
3679
|
+
* @param control Id of list control
|
3680
|
+
* @returns
|
3681
|
+
*/ // isOptionSelected
|
2570
3682
|
isOptionSelected(index, controlId) {
|
2571
3683
|
let val = this.task.getValue(controlId, "0");
|
2572
3684
|
for (let item of val) {
|
@@ -2575,18 +3687,40 @@ class AccessorMagicService {
|
|
2575
3687
|
}
|
2576
3688
|
return false;
|
2577
3689
|
}
|
3690
|
+
/**
|
3691
|
+
* Returns whether a tab page is selected or not - used for the tab buttons
|
3692
|
+
* @param controlId Id of control
|
3693
|
+
* @param layer Id of the tab page
|
3694
|
+
* @returns
|
3695
|
+
*/ // mgIsTabPageSelected
|
2578
3696
|
isTabPageSelected(controlId, layer) {
|
2579
3697
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
2580
|
-
return val == (layer - 1);
|
2581
|
-
}
|
3698
|
+
return val == (layer - 1); // comparing string to number!
|
3699
|
+
}
|
3700
|
+
/**
|
3701
|
+
* Returns whether a tab page layer is selected or not - used for the div which represents the tab page
|
3702
|
+
* @param controlId Id of control
|
3703
|
+
* @param layer Id of the tab page
|
3704
|
+
* @returns
|
3705
|
+
*/ // mgIsTabLayerSelected
|
2582
3706
|
isTabPageLayerSelected(controlId, layer) {
|
2583
3707
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedLayer);
|
2584
|
-
return val == (layer - 1);
|
3708
|
+
return val == (layer - 1); // comparing string to number!
|
2585
3709
|
}
|
3710
|
+
/**
|
3711
|
+
* Returns the index of the selected tab page
|
3712
|
+
* @param controlId Id of control
|
3713
|
+
* @returns
|
3714
|
+
*/
|
2586
3715
|
getTabSelectedIndex(controlId) {
|
2587
3716
|
let val = this.task.getProperty(controlId, HtmlProperties.SelectedValue);
|
2588
|
-
return val;
|
3717
|
+
return val; // comparing string to number!
|
2589
3718
|
}
|
3719
|
+
// private methodes
|
3720
|
+
/**
|
3721
|
+
* @ignore
|
3722
|
+
*/
|
3723
|
+
// mgIfRowCreated
|
2590
3724
|
ifRowCreated(row) {
|
2591
3725
|
if (row == null)
|
2592
3726
|
return false;
|
@@ -2594,59 +3728,83 @@ class AccessorMagicService {
|
|
2594
3728
|
let result = this.getFormGroupByRow(rowId);
|
2595
3729
|
return !isNullOrUndefined(result);
|
2596
3730
|
}
|
3731
|
+
/**
|
3732
|
+
* @ignore
|
3733
|
+
*/
|
3734
|
+
// mgGetFormGroupByRow
|
2597
3735
|
getFormGroupByRow(id) {
|
2598
3736
|
return this.task.formGroups[id];
|
2599
3737
|
}
|
3738
|
+
/**
|
3739
|
+
* @ignore
|
3740
|
+
*/
|
3741
|
+
// isRowSelected (not changed)
|
2600
3742
|
isRowSelected(controlId, rowId) {
|
2601
3743
|
const selectedRow = this.task.getProperty(controlId, HtmlProperties.SelectedRow, "0");
|
2602
3744
|
return selectedRow == rowId;
|
2603
3745
|
}
|
3746
|
+
/**
|
3747
|
+
* Returns whether a row is in edit state
|
3748
|
+
* @param row
|
3749
|
+
*/
|
2604
3750
|
isRowInRowEditing(row) {
|
2605
3751
|
let guiRowId = '0';
|
2606
3752
|
guiRowId = typeof row == "number" ? row.toString() : row.rowId;
|
2607
3753
|
return this.task.isRowInRowEditing(guiRowId);
|
2608
3754
|
}
|
3755
|
+
/**
|
3756
|
+
* Returns whether a row is in edit state, use this method while control outside table control
|
3757
|
+
* @param row
|
3758
|
+
*/
|
2609
3759
|
isCurrentInRowEditing() {
|
2610
3760
|
let row = this.task.tableService.getSelectedRow();
|
2611
3761
|
return this.task.isRowInRowEditing(row);
|
2612
3762
|
}
|
3763
|
+
/**
|
3764
|
+
* @ignore
|
3765
|
+
*/
|
3766
|
+
// GetGuiTopIndex
|
2613
3767
|
guiTopIndex() {
|
2614
3768
|
return this.task.tableService.getTableTopIndex();
|
2615
3769
|
}
|
3770
|
+
/**
|
3771
|
+
* @ignore
|
3772
|
+
*/
|
2616
3773
|
getErrMsg(id, rowId) {
|
2617
3774
|
let c = this.task.getFormControl(rowId, id);
|
2618
3775
|
if (c.hasError('required'))
|
2619
|
-
return
|
3776
|
+
return Events.GetMessageString(MsgInterface.RT_STR_FLD_MUST_UPDATED);
|
2620
3777
|
if (c.hasError('pattern')) {
|
3778
|
+
//To check whether the numeric field allowed only positive values or not.
|
2621
3779
|
if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
|
2622
|
-
return
|
3780
|
+
return Events.GetMessageString(MsgInterface.STR_ERR_NEGETIVE);
|
2623
3781
|
if (c.errors.pattern.requiredPattern.includes('.')) {
|
2624
3782
|
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[0];
|
2625
3783
|
const decimalFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[1];
|
2626
3784
|
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2627
3785
|
const actualDecimalLimit = c.errors.pattern.requiredPattern.match(/(?:[^,]+,){2}(\d+)/)[1];
|
2628
3786
|
if (numericFormat.length > actualNumericLimit || decimalFormat.length > actualDecimalLimit) {
|
2629
|
-
return
|
3787
|
+
return this.getNumericFormatErrorString(actualNumericLimit, actualDecimalLimit);
|
2630
3788
|
}
|
2631
3789
|
}
|
2632
3790
|
else if (!c.errors.pattern.requiredPattern.includes('.') && !Number.isInteger(c.errors.pattern.actualValue)) {
|
2633
3791
|
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2634
|
-
return
|
3792
|
+
return this.getNumericFormatErrorString(actualNumericLimit, 0);
|
2635
3793
|
}
|
2636
3794
|
else {
|
2637
3795
|
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString();
|
2638
3796
|
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2639
3797
|
if (numericFormat.length > actualNumericLimit) {
|
2640
|
-
return
|
3798
|
+
return this.getNumericFormatErrorString(actualNumericLimit, 0);
|
2641
3799
|
}
|
2642
3800
|
}
|
2643
3801
|
}
|
2644
3802
|
if (c.hasError('rangevalidator'))
|
2645
3803
|
return c.errors.rangevalidator.errorMsg;
|
2646
3804
|
if (c.hasError('maxlength'))
|
2647
|
-
return
|
3805
|
+
return Events.GetMessageString(MsgInterface.STR_ERR_MAX_ALLOWED_LENGTH) + c.errors.maxlength.requiredLength;
|
2648
3806
|
if (c.hasError('max'))
|
2649
|
-
return
|
3807
|
+
return Events.GetMessageString(MsgInterface.STR_ERR_MAX_ALLOWED_VALUE) + c.errors.max.max;
|
2650
3808
|
let controlMetadata = this.task.Records.list[rowId].getControlMetadata(id);
|
2651
3809
|
for (let key of controlMetadata.customValidators.keys()) {
|
2652
3810
|
if (c.hasError(key)) {
|
@@ -2656,6 +3814,19 @@ class AccessorMagicService {
|
|
2656
3814
|
}
|
2657
3815
|
return 'unknown error';
|
2658
3816
|
}
|
3817
|
+
getNumericFormatErrorString(wholeLimit, decimalLimit) {
|
3818
|
+
let token = "%d";
|
3819
|
+
let messageString = Events.GetMessageString(MsgInterface.EDT_ERR_STR_1);
|
3820
|
+
messageString = StrUtil.replaceStringTokens(messageString, token, 1, wholeLimit.toString());
|
3821
|
+
messageString = StrUtil.replaceStringTokens(messageString, token, 1, decimalLimit.toString());
|
3822
|
+
return messageString;
|
3823
|
+
}
|
3824
|
+
/**
|
3825
|
+
* Sets a user-supplied value to the specified control
|
3826
|
+
* @param controlName
|
3827
|
+
* @param value
|
3828
|
+
* @param refreshDisplay
|
3829
|
+
*/
|
2659
3830
|
setValueToControl(controlName, value, refreshDisplay) {
|
2660
3831
|
if (typeof refreshDisplay === "undefined")
|
2661
3832
|
refreshDisplay = true;
|
@@ -2664,28 +3835,44 @@ class AccessorMagicService {
|
|
2664
3835
|
guiEvent.param = refreshDisplay;
|
2665
3836
|
this.task.insertEvent(guiEvent);
|
2666
3837
|
}
|
3838
|
+
/**
|
3839
|
+
* @ignore
|
3840
|
+
*/
|
2667
3841
|
isDataviewEmpty() {
|
2668
3842
|
return this.task.Records.isEmptyDataView;
|
2669
3843
|
}
|
3844
|
+
/**
|
3845
|
+
* simulates a click event on the specified control, for the Magic engine
|
3846
|
+
* @param controlName
|
3847
|
+
* @param rowId
|
3848
|
+
*/
|
2670
3849
|
simulateClick(controlName, rowId) {
|
2671
3850
|
if (typeof rowId === "undefined")
|
2672
3851
|
rowId = 0;
|
2673
3852
|
this.task.insertEvent(getGuiEventObj('click', controlName, rowId));
|
2674
3853
|
}
|
3854
|
+
/**
|
3855
|
+
* Return Boolean TRUE if user logged in Else it will return FALSE
|
3856
|
+
*/
|
2675
3857
|
isLoggedIn() {
|
2676
3858
|
return this.task.getIsLoggenIn();
|
2677
3859
|
}
|
3860
|
+
/**
|
3861
|
+
* Returns JS object containing the records with all table fields.
|
3862
|
+
*/
|
2678
3863
|
GetFormRecords() {
|
2679
3864
|
let rowId = 0;
|
2680
3865
|
let recArray;
|
2681
3866
|
if (!isNullOrUndefined(this.task.Records) && this.task.Records.list.length > 0) {
|
2682
3867
|
let recList = this.task.Records.list;
|
2683
3868
|
let tableControls = new Array();
|
3869
|
+
//Generate list of table fields names
|
2684
3870
|
for (const key in this.task.template) {
|
2685
3871
|
if (this.task.template[key] == '1')
|
2686
3872
|
tableControls.push(key);
|
2687
3873
|
}
|
2688
3874
|
recArray = new Array();
|
3875
|
+
//Update the records as list of objects with values for table fields.
|
2689
3876
|
if (tableControls.length > 0) {
|
2690
3877
|
recList.forEach((ctrlMetaData) => {
|
2691
3878
|
if (this.task.Records.isRowCreated(rowId)) {
|
@@ -2701,31 +3888,54 @@ class AccessorMagicService {
|
|
2701
3888
|
}
|
2702
3889
|
return recArray;
|
2703
3890
|
}
|
3891
|
+
/**
|
3892
|
+
* SetCookie : set the cookie with specified name and value in browser
|
3893
|
+
* expires - expiration time
|
3894
|
+
* path - path which much exists in order so that cookie is sent as header
|
3895
|
+
* domain - specifies which hosts are allowed to receive the cookie
|
3896
|
+
* secure - specifies if cookie is secure ( works only with HTTPS)
|
3897
|
+
* sameSite - lets servers specify whether/when cookies are sent with cross-site requests
|
3898
|
+
*/
|
2704
3899
|
SetCookie(name, value, expires, path, domain, secure, sameSite) {
|
2705
3900
|
CookieService.setCookie(name, value, expires, path, domain, secure, sameSite);
|
2706
3901
|
}
|
3902
|
+
/**
|
3903
|
+
* GetCookie : get the cookie with specified name and value in browser
|
3904
|
+
*/
|
2707
3905
|
GetCookie(name) {
|
2708
3906
|
return CookieService.getCookie(name);
|
2709
3907
|
}
|
3908
|
+
/**
|
3909
|
+
* DeleteCookie : deletes the cookie
|
3910
|
+
*/
|
2710
3911
|
DeleteCookie(name) {
|
2711
3912
|
return CookieService.deleteCookie(name);
|
2712
3913
|
}
|
3914
|
+
/**
|
3915
|
+
* get RGBA color from color file
|
3916
|
+
*/
|
2713
3917
|
getColor(colorNumber, colorType) {
|
2714
3918
|
return this.magicColor.getColor(colorNumber, colorType);
|
2715
3919
|
}
|
2716
|
-
static ɵfac = function AccessorMagicService_Factory(
|
2717
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
3920
|
+
/** @nocollapse */ static ɵfac = function AccessorMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AccessorMagicService)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MagicColorService)); };
|
3921
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: AccessorMagicService, factory: AccessorMagicService.ɵfac });
|
2718
3922
|
}
|
2719
3923
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AccessorMagicService, [{
|
2720
3924
|
type: Injectable
|
2721
3925
|
}], () => [{ type: TaskMagicService }, { type: MagicColorService }], null); })();
|
2722
3926
|
|
3927
|
+
/**
|
3928
|
+
* Central place for adding the Magic services
|
3929
|
+
*/
|
2723
3930
|
class MagicServices {
|
2724
3931
|
task;
|
2725
3932
|
subformService;
|
2726
3933
|
tableService;
|
2727
3934
|
titleService;
|
2728
3935
|
mgAccessorService;
|
3936
|
+
/**
|
3937
|
+
* @ignore
|
3938
|
+
*/
|
2729
3939
|
constructor(task, subformService, tableService, titleService, mgAccessorService) {
|
2730
3940
|
this.task = task;
|
2731
3941
|
this.subformService = subformService;
|
@@ -2737,41 +3947,85 @@ class MagicServices {
|
|
2737
3947
|
task.mgTitleService = titleService;
|
2738
3948
|
task.mgAccessorService = mgAccessorService;
|
2739
3949
|
}
|
2740
|
-
static ɵfac = function MagicServices_Factory(
|
2741
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
3950
|
+
/** @nocollapse */ static ɵfac = function MagicServices_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicServices)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(SubformMagicService), i0.ɵɵinject(TableMagicService), i0.ɵɵinject(TitleMagicService), i0.ɵɵinject(AccessorMagicService)); };
|
3951
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MagicServices, factory: MagicServices.ɵfac });
|
2742
3952
|
}
|
2743
3953
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicServices, [{
|
2744
3954
|
type: Injectable
|
2745
3955
|
}], () => [{ type: TaskMagicService }, { type: SubformMagicService }, { type: TableMagicService }, { type: TitleMagicService }, { type: AccessorMagicService }], null); })();
|
2746
3956
|
|
3957
|
+
/**
|
3958
|
+
* Base component representing a Magic task
|
3959
|
+
*/
|
2747
3960
|
class TaskBaseMagicComponent {
|
2748
3961
|
ref;
|
2749
3962
|
magicServices;
|
3963
|
+
/**
|
3964
|
+
* Id of task, used for initializing the task service
|
3965
|
+
*/
|
2750
3966
|
taskIdParam;
|
3967
|
+
/**
|
3968
|
+
* @ignore
|
3969
|
+
*/
|
2751
3970
|
taskDescription;
|
3971
|
+
/**
|
3972
|
+
* @ignore
|
3973
|
+
*/
|
2752
3974
|
magicProperties = MagicProperties;
|
3975
|
+
/**
|
3976
|
+
*
|
3977
|
+
* @param ref changes-detector object
|
3978
|
+
* @param magicServices Access point for all Magic services
|
3979
|
+
*/
|
2753
3980
|
constructor(ref, magicServices) {
|
2754
3981
|
this.ref = ref;
|
2755
3982
|
this.magicServices = magicServices;
|
2756
3983
|
}
|
3984
|
+
/**
|
3985
|
+
* Returns the Magic task service
|
3986
|
+
* @returns
|
3987
|
+
*/
|
2757
3988
|
get task() {
|
2758
3989
|
return this.magicServices.task;
|
2759
3990
|
}
|
3991
|
+
/**
|
3992
|
+
* Returns the Magic subform service
|
3993
|
+
* @returns
|
3994
|
+
*/
|
2760
3995
|
get mgSub() {
|
2761
3996
|
return this.magicServices.subformService;
|
2762
3997
|
}
|
3998
|
+
/**
|
3999
|
+
* Returns the Magic table service
|
4000
|
+
* @returns
|
4001
|
+
*/
|
2763
4002
|
get tableService() {
|
2764
4003
|
return this.magicServices.tableService;
|
2765
4004
|
}
|
4005
|
+
/**
|
4006
|
+
* Returns the Magic accessor service
|
4007
|
+
* @returns
|
4008
|
+
*/
|
2766
4009
|
get mg() {
|
2767
4010
|
return this.magicServices.mgAccessorService;
|
2768
4011
|
}
|
4012
|
+
/**
|
4013
|
+
* Returns the task Id
|
4014
|
+
* @returns
|
4015
|
+
*/
|
2769
4016
|
get taskId() {
|
2770
4017
|
return this.task.taskId;
|
2771
4018
|
}
|
4019
|
+
/**
|
4020
|
+
* Returns the FormGroup for screen-mode forms
|
4021
|
+
* @returns
|
4022
|
+
*/
|
2772
4023
|
get screenFormGroup() {
|
2773
4024
|
return this.task.ScreenModeControls;
|
2774
4025
|
}
|
4026
|
+
/**
|
4027
|
+
* Interface implementation
|
4028
|
+
*/
|
2775
4029
|
ngOnInit() {
|
2776
4030
|
this.task.detectChanges.pipe().subscribe(c => {
|
2777
4031
|
this.ref.detectChanges();
|
@@ -2779,24 +4033,61 @@ class TaskBaseMagicComponent {
|
|
2779
4033
|
this.task.initTask(this.taskIdParam, this.taskDescription);
|
2780
4034
|
this.createFormControlsAccessor(this.screenFormGroup);
|
2781
4035
|
this.setInputDateFormat();
|
4036
|
+
// subcribe to custom property changes
|
2782
4037
|
this.task.customPropertiesSubject.pipe().subscribe(property => {
|
2783
4038
|
this.PropertyChanged(property.propertyName, property.rowId, property.value);
|
2784
4039
|
});
|
4040
|
+
// subcribe to records count changes
|
2785
4041
|
this.task.recordsCountChangeSubject.pipe().subscribe(value => {
|
2786
4042
|
this.RecordsCountChanged(value);
|
2787
4043
|
});
|
4044
|
+
// subcribe to mgLoad change
|
2788
4045
|
this.task.mgLoadSubject.pipe().subscribe(value => {
|
2789
4046
|
this.mgOnLoad();
|
2790
4047
|
});
|
2791
4048
|
}
|
4049
|
+
/**
|
4050
|
+
* @ignore
|
4051
|
+
*/
|
2792
4052
|
createFormControlsAccessor(formGroup) { }
|
4053
|
+
/**
|
4054
|
+
* @ignore
|
4055
|
+
*/
|
2793
4056
|
setInputDateFormat() { }
|
4057
|
+
/**
|
4058
|
+
* This method is called when the value of any custom property is updated in Magic
|
4059
|
+
* propertyName : name of property which is updated. The format is <controlname>~<propertyname>
|
4060
|
+
* rowId : row number of the updated property for controls in table control (0 for controls outside table)
|
4061
|
+
* value : updated value of the property
|
4062
|
+
* @returns : void
|
4063
|
+
* To use the method override it in your component and check the property name and write you code ..for eg
|
4064
|
+
* if(propertyName == 'controlname~propertyName') {// your code}
|
4065
|
+
* else { // your code}
|
4066
|
+
*/
|
2794
4067
|
PropertyChanged(propertyName, rowId, value) {
|
2795
|
-
|
4068
|
+
// intentionally left blank because the implementation should be in the derived class
|
4069
|
+
}
|
4070
|
+
/**
|
4071
|
+
* Records count change subject is subscribed to change in its value. This method will be called
|
4072
|
+
* as the value of records count is received at from server.
|
4073
|
+
* @returns : void
|
4074
|
+
* To use the method override it in your component.
|
4075
|
+
*/
|
2796
4076
|
RecordsCountChanged(recordsCount) {
|
2797
|
-
|
4077
|
+
// intentionally left blank because the implementation should be in the derived class
|
4078
|
+
}
|
4079
|
+
/**
|
4080
|
+
* This method will be called once engine informs UI about loading of first set of data is sent to client
|
4081
|
+
* and client has reached its first idle time.
|
4082
|
+
* @returns : void
|
4083
|
+
* To use the method override it in your component.
|
4084
|
+
*/
|
2798
4085
|
mgOnLoad() {
|
4086
|
+
// intentionally left blank because the implementation should be in the derived class
|
2799
4087
|
}
|
4088
|
+
/**
|
4089
|
+
* Interface implementation
|
4090
|
+
*/
|
2800
4091
|
ngAfterViewInit() {
|
2801
4092
|
this.mgSub.init();
|
2802
4093
|
}
|
@@ -2806,37 +4097,53 @@ class TaskBaseMagicComponent {
|
|
2806
4097
|
this.task.oldPageSize = this.tableService.getPageSize();
|
2807
4098
|
}
|
2808
4099
|
}
|
4100
|
+
/**
|
4101
|
+
* Interface implementation
|
4102
|
+
*/
|
2809
4103
|
ngOnDestroy() {
|
2810
4104
|
this.task.dispose();
|
2811
4105
|
}
|
2812
|
-
static ɵfac = function TaskBaseMagicComponent_Factory(
|
2813
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
4106
|
+
/** @nocollapse */ static ɵfac = function TaskBaseMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TaskBaseMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(MagicServices)); };
|
4107
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: TaskBaseMagicComponent, selectors: [["task-magic"]], inputs: { taskIdParam: "taskIdParam", taskDescription: "taskDescription" }, standalone: false, features: [i0.ɵɵProvidersFeature([TaskMagicService, SubformMagicService, TableMagicService])], decls: 0, vars: 0, template: function TaskBaseMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
|
2814
4108
|
}
|
2815
4109
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TaskBaseMagicComponent, [{
|
2816
4110
|
type: Component,
|
2817
4111
|
args: [{
|
2818
4112
|
selector: 'task-magic',
|
2819
4113
|
providers: [TaskMagicService, SubformMagicService, TableMagicService],
|
2820
|
-
template: ''
|
4114
|
+
template: '',
|
4115
|
+
standalone: false
|
2821
4116
|
}]
|
2822
4117
|
}], () => [{ type: i0.ChangeDetectorRef }, { type: MagicServices }], { taskIdParam: [{
|
2823
4118
|
type: Input
|
2824
4119
|
}], taskDescription: [{
|
2825
4120
|
type: Input
|
2826
4121
|
}] }); })();
|
2827
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src
|
4122
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TaskBaseMagicComponent, { className: "TaskBaseMagicComponent", filePath: "src/ui/task-base.magic.component.ts", lineNumber: 21 }); })();
|
2828
4123
|
|
4124
|
+
/**
|
4125
|
+
* @ignore
|
4126
|
+
*/
|
2829
4127
|
class RowMagicDirective {
|
2830
4128
|
_task;
|
2831
4129
|
element;
|
2832
4130
|
rowId;
|
4131
|
+
/**
|
4132
|
+
* The HTML element connected to this directive
|
4133
|
+
*/
|
2833
4134
|
htmlElement;
|
4135
|
+
/**
|
4136
|
+
* @ignore
|
4137
|
+
*/
|
2834
4138
|
rowChangedSubscriber = null;
|
2835
4139
|
constructor(_task, element) {
|
2836
4140
|
this._task = _task;
|
2837
4141
|
this.element = element;
|
2838
4142
|
this.htmlElement = this.element.nativeElement;
|
2839
4143
|
}
|
4144
|
+
/**
|
4145
|
+
* Initializes this object
|
4146
|
+
*/
|
2840
4147
|
ngOnInit() {
|
2841
4148
|
this.rowChangedSubscriber = this._task
|
2842
4149
|
.OnSelectedRowChanged.pipe(filter(rowId => rowId === this.rowId))
|
@@ -2851,7 +4158,16 @@ class RowMagicDirective {
|
|
2851
4158
|
return (rect.top >= parentRect.top &&
|
2852
4159
|
rect.bottom <= parentRect.bottom);
|
2853
4160
|
}
|
4161
|
+
/**
|
4162
|
+
* Cleanup
|
4163
|
+
*/
|
2854
4164
|
ngOnDestroy() {
|
4165
|
+
// Don't know why, but when the table is loaded for the first time, we
|
4166
|
+
// get ngOnInit() for the 1st row (rowId = "0") and then ngOnDestroy()
|
4167
|
+
// for number of rows in the page but here this.rowId is undefined.
|
4168
|
+
// Since ngOnInit() was not called for all these rows, this.rowChangedSubscriber
|
4169
|
+
// is null and hence crashes.
|
4170
|
+
// So, the condition to check nulity is added.
|
2855
4171
|
if (this.rowChangedSubscriber !== null) {
|
2856
4172
|
this.rowChangedSubscriber.unsubscribe();
|
2857
4173
|
}
|
@@ -2863,15 +4179,16 @@ class RowMagicDirective {
|
|
2863
4179
|
event.cancelBubble = true;
|
2864
4180
|
}
|
2865
4181
|
}
|
2866
|
-
static ɵfac = function RowMagicDirective_Factory(
|
2867
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4182
|
+
/** @nocollapse */ static ɵfac = function RowMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RowMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
4183
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RowMagicDirective, selectors: [["", "magicRow", ""]], hostBindings: function RowMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
2868
4184
|
i0.ɵɵlistener("click", function RowMagicDirective_click_HostBindingHandler($event) { return ctx.onClick($event); });
|
2869
|
-
} }, inputs: { rowId: [
|
4185
|
+
} }, inputs: { rowId: [0, "magicRow", "rowId"] }, standalone: false });
|
2870
4186
|
}
|
2871
4187
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(RowMagicDirective, [{
|
2872
4188
|
type: Directive,
|
2873
4189
|
args: [{
|
2874
|
-
selector: '[magicRow]'
|
4190
|
+
selector: '[magicRow]',
|
4191
|
+
standalone: false
|
2875
4192
|
}]
|
2876
4193
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }], { rowId: [{
|
2877
4194
|
type: Input,
|
@@ -2881,6 +4198,9 @@ class RowMagicDirective {
|
|
2881
4198
|
args: ['click', ['$event']]
|
2882
4199
|
}] }); })();
|
2883
4200
|
|
4201
|
+
/**
|
4202
|
+
* Connects HTML elements to the Magic Web Client engine
|
4203
|
+
*/
|
2884
4204
|
class MagicDirective {
|
2885
4205
|
_task;
|
2886
4206
|
element;
|
@@ -2893,24 +4213,64 @@ class MagicDirective {
|
|
2893
4213
|
this.selector = "magic";
|
2894
4214
|
}
|
2895
4215
|
;
|
4216
|
+
/**
|
4217
|
+
* This flag is used when we only want to register to events, but do not want to execute commands sent from server
|
4218
|
+
*/
|
2896
4219
|
set eventsOnly(val) {
|
2897
4220
|
console.log("eventsOnly");
|
2898
4221
|
this.eventsOnlyVal = true;
|
2899
4222
|
}
|
2900
4223
|
;
|
4224
|
+
/**
|
4225
|
+
* pollTime: after which value will be sent to magic
|
4226
|
+
*/
|
2901
4227
|
pollTime = 200;
|
4228
|
+
/**
|
4229
|
+
* Row id of the control, for when it is on a table
|
4230
|
+
*/
|
2902
4231
|
rowId;
|
4232
|
+
/**
|
4233
|
+
*
|
4234
|
+
*/
|
4235
|
+
//@Input() events: any[] = [];
|
4236
|
+
/**
|
4237
|
+
* The HTML element connected to this directive
|
4238
|
+
*/
|
2903
4239
|
htmlElement;
|
4240
|
+
/**
|
4241
|
+
* Magic's component handling this control
|
4242
|
+
*/
|
2904
4243
|
component;
|
4244
|
+
/**
|
4245
|
+
* Collection of event handlers for this element
|
4246
|
+
*/
|
2905
4247
|
eventHandlers = {};
|
4248
|
+
/**
|
4249
|
+
* Id of this element
|
4250
|
+
*/
|
2906
4251
|
id;
|
4252
|
+
/**
|
4253
|
+
* @ignore
|
4254
|
+
*/
|
2907
4255
|
selector;
|
4256
|
+
/**
|
4257
|
+
* @ignore
|
4258
|
+
*/
|
2908
4259
|
subscribeRefreshDom;
|
2909
4260
|
focusUnlistener;
|
2910
4261
|
eventsOnlyVal = false;
|
2911
4262
|
static opened = false;
|
2912
4263
|
static noOfAutoCompleteBoxesOpened = 0;
|
2913
4264
|
subscribeInteractiveCommands;
|
4265
|
+
/**
|
4266
|
+
*
|
4267
|
+
* @param _task The task service
|
4268
|
+
* @param element The element for which the directive is applied
|
4269
|
+
* @param renderer Renderer for the element
|
4270
|
+
* @param vcRef
|
4271
|
+
* @param platform
|
4272
|
+
* @param magicRow
|
4273
|
+
*/
|
2914
4274
|
constructor(_task, element, renderer, vcRef, platform, magicRow) {
|
2915
4275
|
this._task = _task;
|
2916
4276
|
this.element = element;
|
@@ -2919,23 +4279,43 @@ class MagicDirective {
|
|
2919
4279
|
this.platform = platform;
|
2920
4280
|
this.magicRow = magicRow;
|
2921
4281
|
this.htmlElement = this.element.nativeElement;
|
4282
|
+
//let c = (<any>this.vcRef)._view;
|
4283
|
+
//while (!(c instanceof TaskBaseMagicComponent)) {
|
4284
|
+
// c = c.component;
|
4285
|
+
//}
|
4286
|
+
//this.component = c;
|
2922
4287
|
if (!(typeof magicRow === "undefined" || magicRow === null))
|
2923
4288
|
this.rowId = magicRow.rowId;
|
2924
4289
|
}
|
4290
|
+
/**
|
4291
|
+
* Get the task service
|
4292
|
+
* @returns
|
4293
|
+
*/
|
2925
4294
|
get task() {
|
2926
4295
|
return this._task;
|
2927
4296
|
}
|
4297
|
+
/**
|
4298
|
+
* Register to the events this element may need to handle
|
4299
|
+
*/
|
2928
4300
|
regEvents() {
|
4301
|
+
// Handle events for which event handler may be removed and restored
|
2929
4302
|
this.eventHandlers["focusin"] = this.OnFocus.bind(this);
|
2930
4303
|
Object.keys(this.eventHandlers).forEach((key) => {
|
2931
4304
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
2932
4305
|
});
|
2933
|
-
|
4306
|
+
// Handle events with anonymous event handlers
|
4307
|
+
let events = ["click", "mousedown", "dblclick"]; // ,'resize', 'load', 'unload'
|
2934
4308
|
events.forEach(event => {
|
2935
4309
|
this.renderer.listen(this.htmlElement, event, (e) => {
|
4310
|
+
// check if the event is fired from zoom button ( to identify the connected zoom button in engine)
|
2936
4311
|
let fromButton = false;
|
2937
4312
|
if (this.htmlElement instanceof HTMLButtonElement)
|
2938
4313
|
fromButton = true;
|
4314
|
+
/**
|
4315
|
+
* In the case of Safari or Chrome browser on IOS, when a button is clicked, the browser does not receive
|
4316
|
+
* focus event hence the zoom action is not executed. So in order to receive focus event, enabling it exclusively
|
4317
|
+
* in the case of Safari or Chrome browser on IOS and Safari browser on Mac.
|
4318
|
+
*/
|
2939
4319
|
if (fromButton && (this.platform.IOS || this.platform.SAFARI))
|
2940
4320
|
this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
|
2941
4321
|
this.task.insertEvent(getGuiEventObj(event, this.id, +this.rowId, fromButton));
|
@@ -2951,10 +4331,13 @@ class MagicDirective {
|
|
2951
4331
|
this.task.insertEvent(guiEvent);
|
2952
4332
|
}
|
2953
4333
|
});
|
4334
|
+
// handle the input event
|
2954
4335
|
fromEvent(this.htmlElement, "input").pipe(map((event) => {
|
2955
4336
|
return event.target.value;
|
2956
|
-
}), debounceTime(this.pollTime)
|
4337
|
+
}), debounceTime(this.pollTime) // time after which value will be sent to magic
|
4338
|
+
).subscribe((x) => {
|
2957
4339
|
if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
|
4340
|
+
// Don't support character binding for date/time values
|
2958
4341
|
let attribute = this.task.Records.list[0].getControlMetadata(this.id).dataType;
|
2959
4342
|
if (attribute !== StorageAttributeType.Date && attribute != StorageAttributeType.Time)
|
2960
4343
|
this.task.mgAccessorService.setValueToControl(this.id, x, true);
|
@@ -2980,16 +4363,25 @@ class MagicDirective {
|
|
2980
4363
|
(e.keyCode >= GuiConstants.KEY_F1 && e.keyCode <= GuiConstants.KEY_F12);
|
2981
4364
|
if (guiEvent.modifiers !== Modifiers.MODIFIER_NONE || supportedKey) {
|
2982
4365
|
guiEvent.keyCode = e.keyCode;
|
4366
|
+
// Defect 160021 fixed - don't set e.cancelBubble when combobox is opened and esc key is pressed
|
2983
4367
|
if (e.keyCode !== GuiConstants.KEY_ESC || e.keyCode === GuiConstants.KEY_ESC && (!MagicDirective.opened && MagicDirective.noOfAutoCompleteBoxesOpened < 1))
|
2984
4368
|
e.cancelBubble = true;
|
2985
4369
|
this.task.insertEvent(guiEvent);
|
2986
4370
|
}
|
2987
4371
|
});
|
2988
4372
|
}
|
4373
|
+
/**
|
4374
|
+
* Handle focus event
|
4375
|
+
*/
|
2989
4376
|
OnFocus() {
|
2990
4377
|
this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
|
2991
4378
|
event.cancelBubble = true;
|
2992
4379
|
}
|
4380
|
+
/**
|
4381
|
+
* Is the command's element the same as this directive's element
|
4382
|
+
* @param command
|
4383
|
+
* @returns true/false
|
4384
|
+
*/
|
2993
4385
|
IsSameElement(command) {
|
2994
4386
|
let line = command.line;
|
2995
4387
|
if (this.task.isTableControl(command.CtrlName))
|
@@ -2998,9 +4390,17 @@ class MagicDirective {
|
|
2998
4390
|
(line === +this.rowId ||
|
2999
4391
|
(line === 0 && isNullOrUndefined(this.rowId))));
|
3000
4392
|
}
|
4393
|
+
/**
|
4394
|
+
* Is the command's element the same as this directive's component
|
4395
|
+
* @param command
|
4396
|
+
* @returns true/false
|
4397
|
+
*/
|
3001
4398
|
IsSameComponent(command) {
|
3002
4399
|
return (command.controlName === this.id);
|
3003
4400
|
}
|
4401
|
+
/**
|
4402
|
+
* @ignore
|
4403
|
+
*/
|
3004
4404
|
regUpdatesUI() {
|
3005
4405
|
this.subscribeRefreshDom = this.task
|
3006
4406
|
.refreshDom.pipe(filter(c => this.IsSameElement(c)))
|
@@ -3022,10 +4422,17 @@ class MagicDirective {
|
|
3022
4422
|
this.handleInteractiveCommands(command);
|
3023
4423
|
});
|
3024
4424
|
}
|
4425
|
+
/**
|
4426
|
+
* Initializes this object
|
4427
|
+
*/
|
3025
4428
|
ngOnInit() {
|
3026
4429
|
this.regEvents();
|
3027
4430
|
this.regUpdatesUI();
|
3028
4431
|
}
|
4432
|
+
/**
|
4433
|
+
* Handles the commands received from the Magic WebClient engine
|
4434
|
+
* @param command
|
4435
|
+
*/
|
3029
4436
|
handleCommand(command) {
|
3030
4437
|
switch (command.CommandType) {
|
3031
4438
|
case CommandType.SET_PROPERTY:
|
@@ -3033,12 +4440,16 @@ class MagicDirective {
|
|
3033
4440
|
break;
|
3034
4441
|
case CommandType.SET_FOCUS:
|
3035
4442
|
this.focusUnlistener();
|
4443
|
+
// Do not set focus on connected zoom button
|
3036
4444
|
if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
|
3037
4445
|
this.htmlElement.focus();
|
3038
4446
|
this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
|
3039
4447
|
break;
|
3040
4448
|
}
|
3041
4449
|
}
|
4450
|
+
/**
|
4451
|
+
* handle the interactive commands like CallJS
|
4452
|
+
*/
|
3042
4453
|
handleInteractiveCommands(command) {
|
3043
4454
|
switch (command._commandType) {
|
3044
4455
|
case InteractiveCommandType.CALL_JS:
|
@@ -3048,18 +4459,24 @@ class MagicDirective {
|
|
3048
4459
|
let resultString = "";
|
3049
4460
|
try {
|
3050
4461
|
if (!isNullOrUndefined(magicComponent[methodName])) {
|
4462
|
+
// invoke the method on instance of magic componenet
|
3051
4463
|
resultString = magicComponent[methodName].apply(magicComponent, args);
|
3052
4464
|
}
|
3053
4465
|
else
|
3054
|
-
console.error("Instance method " + methodName + " does not exists");
|
4466
|
+
console.error("Instance method " + methodName + " does not exists"); // when method is not found
|
3055
4467
|
}
|
3056
4468
|
catch (e) {
|
4469
|
+
// any other exception
|
3057
4470
|
console.error(e.message);
|
3058
4471
|
}
|
3059
|
-
command.resultString = resultString;
|
4472
|
+
command.resultString = resultString; // update the return value
|
3060
4473
|
break;
|
3061
4474
|
}
|
3062
4475
|
}
|
4476
|
+
/**
|
4477
|
+
* Handle the Magic set-property command
|
4478
|
+
* @param command
|
4479
|
+
*/
|
3063
4480
|
handleSetProperty(command) {
|
3064
4481
|
switch (command.Operation) {
|
3065
4482
|
case HtmlProperties.ReadOnly:
|
@@ -3073,18 +4490,22 @@ class MagicDirective {
|
|
3073
4490
|
break;
|
3074
4491
|
}
|
3075
4492
|
}
|
4493
|
+
/**
|
4494
|
+
* Cleanup
|
4495
|
+
*/
|
3076
4496
|
ngOnDestroy() {
|
3077
4497
|
this.subscribeRefreshDom.unsubscribe();
|
3078
4498
|
}
|
3079
|
-
static ɵfac = function MagicDirective_Factory(
|
3080
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" } });
|
4499
|
+
/** @nocollapse */ static ɵfac = function MagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$2.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
4500
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicDirective, selectors: [["", "magic", ""]], inputs: { magic: "magic", eventsOnly: "eventsOnly", pollTime: "pollTime", rowId: "rowId" }, standalone: false });
|
3081
4501
|
}
|
3082
4502
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
|
3083
4503
|
type: Directive,
|
3084
4504
|
args: [{
|
3085
|
-
selector: "[magic]"
|
4505
|
+
selector: "[magic]",
|
4506
|
+
standalone: false
|
3086
4507
|
}]
|
3087
|
-
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$
|
4508
|
+
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$2.Platform }, { type: RowMagicDirective, decorators: [{
|
3088
4509
|
type: Optional
|
3089
4510
|
}] }], { magic: [{
|
3090
4511
|
type: Input,
|
@@ -3098,6 +4519,9 @@ class MagicDirective {
|
|
3098
4519
|
type: Input
|
3099
4520
|
}] }); })();
|
3100
4521
|
|
4522
|
+
/**
|
4523
|
+
* @ignore
|
4524
|
+
*/
|
3101
4525
|
class NoControlMagicDirective extends MagicDirective {
|
3102
4526
|
set magic(val) { this.id = val; this.selector = 'magicnc'; }
|
3103
4527
|
;
|
@@ -3131,10 +4555,12 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3131
4555
|
}
|
3132
4556
|
}
|
3133
4557
|
}
|
4558
|
+
// is the div a tab control
|
3134
4559
|
isTabControl() {
|
3135
4560
|
return this.htmlElement instanceof HTMLDivElement &&
|
3136
4561
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicTabControl";
|
3137
4562
|
}
|
4563
|
+
// is the div a radio buttons wrapper
|
3138
4564
|
isRadio() {
|
3139
4565
|
return this.htmlElement instanceof HTMLDivElement &&
|
3140
4566
|
this.htmlElement.children[0].getAttribute('magicMark') === "magicRadio";
|
@@ -3143,6 +4569,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3143
4569
|
super.handleCommand(command);
|
3144
4570
|
switch (command.CommandType) {
|
3145
4571
|
case CommandType.SET_CLASS:
|
4572
|
+
//remove the class which was replaced by this new one, as registered in the ControlMetadata
|
3146
4573
|
const controlMetadata = this._task.Records.list[0].getControlMetadata(this.id);
|
3147
4574
|
if (controlMetadata.removedClass != '') {
|
3148
4575
|
this.htmlElement.classList.remove(controlMetadata.removedClass);
|
@@ -3155,7 +4582,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3155
4582
|
this.htmlElement.innerText = command.value;
|
3156
4583
|
if (this.htmlElement instanceof HTMLSelectElement)
|
3157
4584
|
this.htmlElement.value = command.value;
|
3158
|
-
if (this.htmlElement instanceof HTMLAnchorElement)
|
4585
|
+
if (this.htmlElement instanceof HTMLAnchorElement) //hyper-text button
|
3159
4586
|
this.htmlElement.text = command.value;
|
3160
4587
|
if (this.htmlElement instanceof HTMLInputElement) {
|
3161
4588
|
if (this.htmlElement.type === "checkbox") {
|
@@ -3179,6 +4606,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3179
4606
|
break;
|
3180
4607
|
}
|
3181
4608
|
}
|
4609
|
+
// handle set-property commands
|
3182
4610
|
handleSetProperty(command) {
|
3183
4611
|
super.handleSetProperty(command);
|
3184
4612
|
switch (command.Operation) {
|
@@ -3194,6 +4622,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3194
4622
|
break;
|
3195
4623
|
case HtmlProperties.ItemsList:
|
3196
4624
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
4625
|
+
// clear the list
|
3197
4626
|
var len = this.htmlElement.length;
|
3198
4627
|
for (var i = len - 1; i >= 0; i--) {
|
3199
4628
|
this.htmlElement.remove(i);
|
@@ -3235,7 +4664,8 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3235
4664
|
let child = tabControl.children[i];
|
3236
4665
|
const layer = child.getAttribute('layer') - 1;
|
3237
4666
|
if (child instanceof HTMLButtonElement) {
|
3238
|
-
|
4667
|
+
// set button style
|
4668
|
+
if (layer == command.obj1) { // compare int to string
|
3239
4669
|
child.classList.add('tab_button_active');
|
3240
4670
|
}
|
3241
4671
|
else {
|
@@ -3243,6 +4673,7 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3243
4673
|
}
|
3244
4674
|
}
|
3245
4675
|
else {
|
4676
|
+
// not a buton - hide unselected tabpages
|
3246
4677
|
let style = (layer == command.obj1) ? 'display: inline' : 'display: none';
|
3247
4678
|
child.setAttribute('style', style);
|
3248
4679
|
}
|
@@ -3263,24 +4694,31 @@ class NoControlMagicDirective extends MagicDirective {
|
|
3263
4694
|
break;
|
3264
4695
|
}
|
3265
4696
|
}
|
3266
|
-
static ɵfac = function NoControlMagicDirective_Factory(
|
3267
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [
|
4697
|
+
/** @nocollapse */ static ɵfac = function NoControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NoControlMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i2$2.Platform), i0.ɵɵdirectiveInject(RowMagicDirective, 8)); };
|
4698
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NoControlMagicDirective, selectors: [["", "magicnc", ""]], inputs: { magic: [0, "magicnc", "magic"] }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature] });
|
3268
4699
|
}
|
3269
4700
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoControlMagicDirective, [{
|
3270
4701
|
type: Directive,
|
3271
4702
|
args: [{
|
3272
|
-
selector: '[magicnc]'
|
4703
|
+
selector: '[magicnc]',
|
4704
|
+
standalone: false
|
3273
4705
|
}]
|
3274
|
-
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$
|
4706
|
+
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i2$2.Platform }, { type: RowMagicDirective, decorators: [{
|
3275
4707
|
type: Optional
|
3276
4708
|
}] }], { magic: [{
|
3277
4709
|
type: Input,
|
3278
4710
|
args: ['magicnc']
|
3279
4711
|
}] }); })();
|
3280
4712
|
|
4713
|
+
/**
|
4714
|
+
* @ignore
|
4715
|
+
*/
|
3281
4716
|
class Constants {
|
3282
4717
|
static DATE_FMT = 'dd/MMM/yyyy';
|
3283
4718
|
}
|
4719
|
+
/**
|
4720
|
+
* @ignore
|
4721
|
+
*/
|
3284
4722
|
class DateMagicPipe extends DatePipe {
|
3285
4723
|
_task;
|
3286
4724
|
constructor(_task) {
|
@@ -3293,6 +4731,7 @@ class DateMagicPipe extends DatePipe {
|
|
3293
4731
|
let mgDateFormatter = new MgDateFormatter();
|
3294
4732
|
if (!isNullOrUndefined(value) && mask !== null) {
|
3295
4733
|
formatStr = mgDateFormatter.ConvertMgDateFormatToAngular(mask);
|
4734
|
+
// If control is label control of table, due to query mode, then save the format here.
|
3296
4735
|
if (formatStr != null && this._task.isTableControl(controlId)) {
|
3297
4736
|
if (this._task.mgInputDateFormat == null)
|
3298
4737
|
this._task.mgInputDateFormat = formatStr;
|
@@ -3305,13 +4744,14 @@ class DateMagicPipe extends DatePipe {
|
|
3305
4744
|
value = "";
|
3306
4745
|
return value;
|
3307
4746
|
}
|
3308
|
-
static ɵfac = function DateMagicPipe_Factory(
|
3309
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true });
|
4747
|
+
/** @nocollapse */ static ɵfac = function DateMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
4748
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicDate", type: DateMagicPipe, pure: true, standalone: false });
|
3310
4749
|
}
|
3311
4750
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateMagicPipe, [{
|
3312
4751
|
type: Pipe,
|
3313
4752
|
args: [{
|
3314
|
-
name: 'magicDate'
|
4753
|
+
name: 'magicDate',
|
4754
|
+
standalone: false
|
3315
4755
|
}]
|
3316
4756
|
}], () => [{ type: TaskMagicService }], null); })();
|
3317
4757
|
class MgDateFormatter {
|
@@ -3373,14 +4813,20 @@ class MgDateFormatter {
|
|
3373
4813
|
return formatStr.ToString();
|
3374
4814
|
}
|
3375
4815
|
else
|
3376
|
-
return "dd-mm-yyyy";
|
4816
|
+
return "dd-mm-yyyy"; // return default format.
|
3377
4817
|
}
|
3378
4818
|
}
|
3379
4819
|
|
4820
|
+
/**
|
4821
|
+
* Perform Magic validation on input controls which hold alphanumeric strings
|
4822
|
+
*/
|
3380
4823
|
class MgformatMagicDirective {
|
3381
4824
|
magicDir;
|
3382
4825
|
_task;
|
3383
4826
|
datePasteFlag = false;
|
4827
|
+
/**
|
4828
|
+
* @ignore
|
4829
|
+
*/
|
3384
4830
|
constructor(magicDir, _task) {
|
3385
4831
|
this.magicDir = magicDir;
|
3386
4832
|
this._task = _task;
|
@@ -3388,16 +4834,30 @@ class MgformatMagicDirective {
|
|
3388
4834
|
ngAfterViewInit() {
|
3389
4835
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3390
4836
|
if (control != null && this._task.mgInputDateFormat == null) {
|
4837
|
+
// get the first date control's format.
|
3391
4838
|
let pic = this._task.GetControlPictureMask(this.magicDir.id);
|
3392
4839
|
if (pic.getAttr() == StorageAttribute.DATE) {
|
3393
4840
|
this.formatDate(pic);
|
3394
4841
|
}
|
3395
4842
|
}
|
3396
4843
|
}
|
4844
|
+
/**
|
4845
|
+
* @ignore
|
4846
|
+
*/
|
4847
|
+
/**
|
4848
|
+
* This can be used to set pattern
|
4849
|
+
* On input, verifies the input matches the required mask
|
4850
|
+
*/
|
3397
4851
|
onFocusEvent($event) {
|
3398
4852
|
this.calculatePattern();
|
3399
4853
|
}
|
3400
4854
|
onPaste(event) {
|
4855
|
+
/**
|
4856
|
+
* This flag is needed to skip execution of dateMasking() method when user paste date in input control.
|
4857
|
+
* This is only needed when "StorageAttribute" is DATE. But to check type of "StorageAttribute", we
|
4858
|
+
need to execute getControlMetadata() method. So, to reduce this execution overload we set
|
4859
|
+
"datePasteFlag" directly.
|
4860
|
+
*/
|
3401
4861
|
this.datePasteFlag = true;
|
3402
4862
|
}
|
3403
4863
|
onInputEvent(event) {
|
@@ -3409,6 +4869,8 @@ class MgformatMagicDirective {
|
|
3409
4869
|
}
|
3410
4870
|
this.calculatePattern();
|
3411
4871
|
}
|
4872
|
+
//This method inserts '/' as a separator while entering date in the textbox.
|
4873
|
+
//Example: 10/10/2023
|
3412
4874
|
dateMasking(event) {
|
3413
4875
|
const input = event.target;
|
3414
4876
|
let cursorPos = event.target.selectionStart;
|
@@ -3561,6 +5023,10 @@ class MgformatMagicDirective {
|
|
3561
5023
|
input.setSelectionRange(start, end);
|
3562
5024
|
}
|
3563
5025
|
}
|
5026
|
+
/**
|
5027
|
+
* @ignore
|
5028
|
+
*/
|
5029
|
+
// This can be used to implement uppercase/lower case
|
3564
5030
|
onChangeEvent(event) {
|
3565
5031
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3566
5032
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
@@ -3582,6 +5048,7 @@ class MgformatMagicDirective {
|
|
3582
5048
|
this.formatDateWithCentury(event.target.value, century, control);
|
3583
5049
|
}
|
3584
5050
|
}
|
5051
|
+
/** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
|
3585
5052
|
formatDateWithCentury(userInput, century, control) {
|
3586
5053
|
const dateFormat = this._task.mgInputDateFormat;
|
3587
5054
|
const separator = userInput.includes('/') ? '/' : "-";
|
@@ -3739,6 +5206,9 @@ class MgformatMagicDirective {
|
|
3739
5206
|
const year = Number(dateArray[0]);
|
3740
5207
|
return [day, month, year];
|
3741
5208
|
}
|
5209
|
+
/**
|
5210
|
+
* @ignore
|
5211
|
+
*/
|
3742
5212
|
calculatePattern() {
|
3743
5213
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3744
5214
|
if (control != null) {
|
@@ -3757,6 +5227,7 @@ class MgformatMagicDirective {
|
|
3757
5227
|
if (control.validator == null)
|
3758
5228
|
control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3759
5229
|
else {
|
5230
|
+
// re-set all validators again
|
3760
5231
|
if (pic.isFormatExp()) {
|
3761
5232
|
control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3762
5233
|
if (isUndefined(this.magicDir.rowId))
|
@@ -3766,6 +5237,7 @@ class MgformatMagicDirective {
|
|
3766
5237
|
else
|
3767
5238
|
control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
|
3768
5239
|
}
|
5240
|
+
// control.setValidators(Validators.maxLength(pic.getMaskLength()));
|
3769
5241
|
control.updateValueAndValidity();
|
3770
5242
|
}
|
3771
5243
|
}
|
@@ -3776,6 +5248,9 @@ class MgformatMagicDirective {
|
|
3776
5248
|
let mgDateFormatter = new MgDateFormatter();
|
3777
5249
|
this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
|
3778
5250
|
}
|
5251
|
+
/**
|
5252
|
+
* @ignore
|
5253
|
+
*/
|
3779
5254
|
formatAlphaUnicode(control) {
|
3780
5255
|
let value = control.value;
|
3781
5256
|
if (value !== null && value.length > 0) {
|
@@ -3801,6 +5276,9 @@ class MgformatMagicDirective {
|
|
3801
5276
|
control.setValue(valueStr.ToString());
|
3802
5277
|
}
|
3803
5278
|
}
|
5279
|
+
/**
|
5280
|
+
* @ignore
|
5281
|
+
*/
|
3804
5282
|
formatBoolean(control) {
|
3805
5283
|
let value = control.value;
|
3806
5284
|
if (value !== null && value.length > 0) {
|
@@ -3813,6 +5291,12 @@ class MgformatMagicDirective {
|
|
3813
5291
|
}
|
3814
5292
|
}
|
3815
5293
|
}
|
5294
|
+
/**
|
5295
|
+
* @ignore
|
5296
|
+
*/
|
5297
|
+
/// <summary>
|
5298
|
+
/// generate pattern from fld's format
|
5299
|
+
/// </summary>
|
3816
5300
|
generatePattern(attribute, pic) {
|
3817
5301
|
let pattern = '';
|
3818
5302
|
switch (attribute) {
|
@@ -3826,6 +5310,12 @@ class MgformatMagicDirective {
|
|
3826
5310
|
}
|
3827
5311
|
return pattern;
|
3828
5312
|
}
|
5313
|
+
/**
|
5314
|
+
* @ignore
|
5315
|
+
*/
|
5316
|
+
/// <summary>
|
5317
|
+
/// generate pattern for Alpha
|
5318
|
+
/// </summary>
|
3829
5319
|
generatePatternForNumber(pic) {
|
3830
5320
|
let patternStr = new StringBuilder();
|
3831
5321
|
patternStr.Append('^');
|
@@ -3838,6 +5328,9 @@ class MgformatMagicDirective {
|
|
3838
5328
|
patternStr.Append('$');
|
3839
5329
|
return patternStr.ToString();
|
3840
5330
|
}
|
5331
|
+
/**
|
5332
|
+
* @ignore
|
5333
|
+
*/
|
3841
5334
|
isPatternGenerationNeeded(attr, pic) {
|
3842
5335
|
switch (attr) {
|
3843
5336
|
case StorageAttribute.NUMERIC:
|
@@ -3847,6 +5340,12 @@ class MgformatMagicDirective {
|
|
3847
5340
|
return (pic.getMaskChars() > 0) ? true : false;
|
3848
5341
|
}
|
3849
5342
|
}
|
5343
|
+
/**
|
5344
|
+
* @ignore
|
5345
|
+
*/
|
5346
|
+
/// <summary>
|
5347
|
+
/// generate pattern for Alpha
|
5348
|
+
/// </summary>
|
3850
5349
|
generatePatternForAlpha(pic) {
|
3851
5350
|
let cnt = 0;
|
3852
5351
|
let inputAllChars = false;
|
@@ -3855,6 +5354,7 @@ class MgformatMagicDirective {
|
|
3855
5354
|
let pattern = new StringBuilder();
|
3856
5355
|
pattern.Append('^');
|
3857
5356
|
for (let i = 0; i < mask.length;) {
|
5357
|
+
//start new subset , if mask[i] is one of these.
|
3858
5358
|
if (inputAllChars && (mask.charCodeAt(i) == PICInterface.PIC_N || mask.charCodeAt(i) == PICInterface.PIC_U || mask.charCodeAt(i) == PICInterface.PIC_L
|
3859
5359
|
|| mask.charCodeAt(i) == PICInterface.PIC_X)) {
|
3860
5360
|
pattern.Append('(');
|
@@ -3900,9 +5400,13 @@ class MgformatMagicDirective {
|
|
3900
5400
|
pattern.Append('$');
|
3901
5401
|
return pattern.ToString();
|
3902
5402
|
}
|
5403
|
+
/**
|
5404
|
+
* @ignore
|
5405
|
+
*/
|
3903
5406
|
getDirectiveCount(mask, idx, pattern, changeInPattern) {
|
3904
5407
|
changeInPattern.value = false;
|
3905
5408
|
let patternCount = 0;
|
5409
|
+
// find max chars
|
3906
5410
|
while (idx < mask.length && this.IsPatternMatches(mask.charCodeAt(idx).toString(), pattern)) {
|
3907
5411
|
patternCount++;
|
3908
5412
|
idx++;
|
@@ -3911,21 +5415,25 @@ class MgformatMagicDirective {
|
|
3911
5415
|
changeInPattern.value = true;
|
3912
5416
|
return patternCount;
|
3913
5417
|
}
|
5418
|
+
/**
|
5419
|
+
* @ignore
|
5420
|
+
*/
|
3914
5421
|
IsPatternMatches(mask, pattern) {
|
3915
5422
|
for (let i = 0; i < pattern.length; i++)
|
3916
5423
|
if (mask == pattern[i])
|
3917
5424
|
return true;
|
3918
5425
|
return false;
|
3919
5426
|
}
|
3920
|
-
static ɵfac = function MgformatMagicDirective_Factory(
|
3921
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5427
|
+
/** @nocollapse */ static ɵfac = function MgformatMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
5428
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
3922
5429
|
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("paste", function MgformatMagicDirective_paste_HostBindingHandler($event) { return ctx.onPaste($event); })("input", function MgformatMagicDirective_input_HostBindingHandler($event) { return ctx.onInputEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); })("blur", function MgformatMagicDirective_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
3923
|
-
} } });
|
5430
|
+
} }, standalone: false });
|
3924
5431
|
}
|
3925
5432
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgformatMagicDirective, [{
|
3926
5433
|
type: Directive,
|
3927
5434
|
args: [{
|
3928
|
-
selector: '[mgFormat]'
|
5435
|
+
selector: '[mgFormat]',
|
5436
|
+
standalone: false
|
3929
5437
|
}]
|
3930
5438
|
}], () => [{ type: MagicDirective }, { type: TaskMagicService }], { onFocusEvent: [{
|
3931
5439
|
type: HostListener,
|
@@ -3944,6 +5452,9 @@ class MgformatMagicDirective {
|
|
3944
5452
|
args: ['blur', ['$event']]
|
3945
5453
|
}] }); })();
|
3946
5454
|
|
5455
|
+
/**
|
5456
|
+
* @ignore
|
5457
|
+
*/
|
3947
5458
|
class TimeMagicPipe extends DatePipe {
|
3948
5459
|
_task;
|
3949
5460
|
constructor(_task) {
|
@@ -3979,23 +5490,37 @@ class TimeMagicPipe extends DatePipe {
|
|
3979
5490
|
}
|
3980
5491
|
return value;
|
3981
5492
|
}
|
3982
|
-
static ɵfac = function TimeMagicPipe_Factory(
|
3983
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true });
|
5493
|
+
/** @nocollapse */ static ɵfac = function TimeMagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TimeMagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
5494
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime", type: TimeMagicPipe, pure: true, standalone: false });
|
3984
5495
|
}
|
3985
5496
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TimeMagicPipe, [{
|
3986
5497
|
type: Pipe,
|
3987
5498
|
args: [{
|
3988
|
-
name: 'magicTime'
|
5499
|
+
name: 'magicTime',
|
5500
|
+
standalone: false
|
3989
5501
|
}]
|
3990
5502
|
}], () => [{ type: TaskMagicService }], null); })();
|
3991
5503
|
|
5504
|
+
/**
|
5505
|
+
* Validates the field range.
|
5506
|
+
*/
|
3992
5507
|
class RangeValidatorMagicDirective {
|
3993
5508
|
_task;
|
3994
5509
|
vcRef;
|
5510
|
+
/**
|
5511
|
+
*
|
5512
|
+
* @param _task The task service
|
5513
|
+
* @param vcRef
|
5514
|
+
*/
|
3995
5515
|
constructor(_task, vcRef) {
|
3996
5516
|
this._task = _task;
|
3997
5517
|
this.vcRef = vcRef;
|
3998
5518
|
}
|
5519
|
+
/**
|
5520
|
+
* Validation method
|
5521
|
+
* @param c FormControl to validate
|
5522
|
+
* @returns If validation fails, return error message, else returns null
|
5523
|
+
*/
|
3999
5524
|
validate(c) {
|
4000
5525
|
let controlName;
|
4001
5526
|
controlName = this.getControlName(c);
|
@@ -4017,12 +5542,15 @@ class RangeValidatorMagicDirective {
|
|
4017
5542
|
};
|
4018
5543
|
}
|
4019
5544
|
}
|
5545
|
+
/**
|
5546
|
+
* @ignore
|
5547
|
+
*/
|
4020
5548
|
getControlName(c) {
|
4021
5549
|
const formGroup = c.parent.controls;
|
4022
5550
|
return Object.keys(formGroup).find(name => c === formGroup[name]) || null;
|
4023
5551
|
}
|
4024
|
-
static ɵfac = function RangeValidatorMagicDirective_Factory(
|
4025
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], features: [i0.ɵɵProvidersFeature([
|
5552
|
+
/** @nocollapse */ static ɵfac = function RangeValidatorMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || RangeValidatorMagicDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
5553
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: RangeValidatorMagicDirective, selectors: [["", "rangevalidator", ""]], standalone: false, features: [i0.ɵɵProvidersFeature([
|
4026
5554
|
{
|
4027
5555
|
provide: NG_VALIDATORS,
|
4028
5556
|
useExisting: RangeValidatorMagicDirective,
|
@@ -4040,7 +5568,8 @@ class RangeValidatorMagicDirective {
|
|
4040
5568
|
useExisting: RangeValidatorMagicDirective,
|
4041
5569
|
multi: true,
|
4042
5570
|
}
|
4043
|
-
]
|
5571
|
+
],
|
5572
|
+
standalone: false
|
4044
5573
|
}]
|
4045
5574
|
}], () => [{ type: TaskMagicService }, { type: i0.ViewContainerRef }], null); })();
|
4046
5575
|
|
@@ -4050,26 +5579,48 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
|
|
4050
5579
|
const ctx_r0 = i0.ɵɵnextContext();
|
4051
5580
|
i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
|
4052
5581
|
} }
|
5582
|
+
/**
|
5583
|
+
* Represents a Magic subform
|
5584
|
+
*/
|
4053
5585
|
class SubformMagicComponent {
|
4054
5586
|
vcRef;
|
4055
5587
|
mgSub;
|
5588
|
+
/**
|
5589
|
+
* @ignore
|
5590
|
+
*/
|
4056
5591
|
id;
|
5592
|
+
/**
|
5593
|
+
* @ignore
|
5594
|
+
*/
|
4057
5595
|
set magic(val) { this.id = val; }
|
4058
5596
|
;
|
5597
|
+
/**
|
5598
|
+
* @ignore
|
5599
|
+
*/
|
4059
5600
|
component = null;
|
5601
|
+
/**
|
5602
|
+
* @ignore
|
5603
|
+
*/
|
4060
5604
|
constructor(vcRef, mgSub) {
|
4061
5605
|
this.vcRef = vcRef;
|
4062
5606
|
this.mgSub = mgSub;
|
5607
|
+
// For angular 13 - find the component from _hostLView
|
4063
5608
|
this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
|
4064
5609
|
}
|
5610
|
+
/**
|
5611
|
+
* @ignore
|
5612
|
+
*/
|
4065
5613
|
get Component() {
|
4066
5614
|
return this.mgSub.mgGetComp(this.id);
|
4067
5615
|
}
|
5616
|
+
/**
|
5617
|
+
* @ignore
|
5618
|
+
*/
|
4068
5619
|
get Parameters() {
|
4069
5620
|
return this.mgSub.mgGetParameters(this.id);
|
4070
5621
|
}
|
4071
|
-
static ɵfac = function SubformMagicComponent_Factory(
|
4072
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
5622
|
+
/** @nocollapse */ static ɵfac = function SubformMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SubformMagicComponent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(SubformMagicService)); };
|
5623
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: SubformMagicComponent, selectors: [["magic-subform"]], inputs: { magic: "magic" }, standalone: false, decls: 1, vars: 1, consts: [[3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"]], template: function SubformMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
4073
5624
|
i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
|
4074
5625
|
} if (rf & 2) {
|
4075
5626
|
i0.ɵɵproperty("ngIf", ctx.Component);
|
@@ -4085,13 +5636,14 @@ class SubformMagicComponent {
|
|
4085
5636
|
[ndcDynamicComponent]="Component"
|
4086
5637
|
[ndcDynamicInputs]="Parameters">
|
4087
5638
|
</ndc-dynamic>
|
4088
|
-
|
5639
|
+
`,
|
5640
|
+
standalone: false
|
4089
5641
|
}]
|
4090
5642
|
}], () => [{ type: i0.ViewContainerRef }, { type: SubformMagicService }], { magic: [{
|
4091
5643
|
type: Input,
|
4092
5644
|
args: ['magic']
|
4093
5645
|
}] }); })();
|
4094
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src
|
5646
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubformMagicComponent, { className: "SubformMagicComponent", filePath: "src/ui/subform.magic.component.ts", lineNumber: 22 }); })();
|
4095
5647
|
|
4096
5648
|
const _c0$1 = ["customContent"];
|
4097
5649
|
const _c1 = ["*"];
|
@@ -4115,12 +5667,21 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
|
|
4115
5667
|
i0.ɵɵadvance(4);
|
4116
5668
|
i0.ɵɵproperty("ngIf", ctx_r0.defaultDisplay);
|
4117
5669
|
} }
|
5670
|
+
/**
|
5671
|
+
* Represents a Magic subform
|
5672
|
+
*/
|
4118
5673
|
class ErrorMagicComponent {
|
4119
5674
|
_task;
|
4120
5675
|
mgService;
|
4121
5676
|
changeDetectorRef;
|
5677
|
+
/**
|
5678
|
+
* @ignore
|
5679
|
+
*/
|
4122
5680
|
id;
|
4123
5681
|
rowId;
|
5682
|
+
/**
|
5683
|
+
* @ignore
|
5684
|
+
*/
|
4124
5685
|
set magic(val) {
|
4125
5686
|
this.id = val;
|
4126
5687
|
}
|
@@ -4129,18 +5690,26 @@ class ErrorMagicComponent {
|
|
4129
5690
|
this.rowId = val;
|
4130
5691
|
}
|
4131
5692
|
;
|
5693
|
+
// if true - display standard magic error message, if false - customer has provides his own content and we'll use it
|
4132
5694
|
defaultDisplay = true;
|
4133
5695
|
set CustomContent(innerComponent) {
|
4134
5696
|
this.defaultDisplay = innerComponent == undefined || this.isEmpty(innerComponent.nativeElement);
|
4135
5697
|
this.changeDetectorRef.detectChanges();
|
4136
5698
|
}
|
4137
5699
|
;
|
5700
|
+
/**
|
5701
|
+
* @ignore
|
5702
|
+
*/
|
4138
5703
|
constructor(_task, mgService, changeDetectorRef) {
|
4139
5704
|
this._task = _task;
|
4140
5705
|
this.mgService = mgService;
|
4141
5706
|
this.changeDetectorRef = changeDetectorRef;
|
4142
5707
|
this.rowId = "0";
|
4143
5708
|
}
|
5709
|
+
/**
|
5710
|
+
* returns true if the html element has no children
|
5711
|
+
* @param element
|
5712
|
+
*/
|
4144
5713
|
isEmpty(element) {
|
4145
5714
|
const nodes = element.childNodes;
|
4146
5715
|
for (let i = 0; i < nodes.length; i++) {
|
@@ -4151,6 +5720,9 @@ class ErrorMagicComponent {
|
|
4151
5720
|
}
|
4152
5721
|
return true;
|
4153
5722
|
}
|
5723
|
+
/**
|
5724
|
+
* @ignore
|
5725
|
+
*/
|
4154
5726
|
HasErrors(id) {
|
4155
5727
|
if (!isUndefined(id)) {
|
4156
5728
|
let control = this._task.getFormControl(this.rowId, id);
|
@@ -4171,13 +5743,13 @@ class ErrorMagicComponent {
|
|
4171
5743
|
}
|
4172
5744
|
return false;
|
4173
5745
|
}
|
4174
|
-
static ɵfac = function ErrorMagicComponent_Factory(
|
4175
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
5746
|
+
/** @nocollapse */ static ɵfac = function ErrorMagicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ErrorMagicComponent)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(AccessorMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
5747
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: ErrorMagicComponent, selectors: [["mgError"]], viewQuery: function ErrorMagicComponent_Query(rf, ctx) { if (rf & 1) {
|
4176
5748
|
i0.ɵɵviewQuery(_c0$1, 5);
|
4177
5749
|
} if (rf & 2) {
|
4178
5750
|
let _t;
|
4179
5751
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CustomContent = _t.first);
|
4180
|
-
} }, inputs: { magic: "magic", rowId1: [
|
5752
|
+
} }, inputs: { magic: "magic", rowId1: [0, "rowId", "rowId1"] }, standalone: false, ngContentSelectors: _c1, decls: 1, vars: 1, consts: [["customContent", ""], [4, "ngIf"]], template: function ErrorMagicComponent_Template(rf, ctx) { if (rf & 1) {
|
4181
5753
|
i0.ɵɵprojectionDef();
|
4182
5754
|
i0.ɵɵtemplate(0, ErrorMagicComponent_div_0_Template, 5, 1, "div", 1);
|
4183
5755
|
} if (rf & 2) {
|
@@ -4196,7 +5768,8 @@ class ErrorMagicComponent {
|
|
4196
5768
|
{{mgService.getErrMsg(id, rowId)}}
|
4197
5769
|
</span>
|
4198
5770
|
</div>
|
4199
|
-
|
5771
|
+
`,
|
5772
|
+
standalone: false
|
4200
5773
|
}]
|
4201
5774
|
}], () => [{ type: TaskMagicService }, { type: AccessorMagicService }, { type: i0.ChangeDetectorRef }], { magic: [{
|
4202
5775
|
type: Input,
|
@@ -4208,8 +5781,11 @@ class ErrorMagicComponent {
|
|
4208
5781
|
type: ViewChild,
|
4209
5782
|
args: ['customContent', { static: false }]
|
4210
5783
|
}] }); })();
|
4211
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src
|
5784
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ErrorMagicComponent, { className: "ErrorMagicComponent", filePath: "src/ui/mgerror.magic.component.ts", lineNumber: 24 }); })();
|
4212
5785
|
|
5786
|
+
/**
|
5787
|
+
* Directive for checkboxes, to handle the 'change' event
|
5788
|
+
*/
|
4213
5789
|
class CheckboxMagicDirective {
|
4214
5790
|
magicDirective;
|
4215
5791
|
el;
|
@@ -4217,11 +5793,17 @@ class CheckboxMagicDirective {
|
|
4217
5793
|
threeState = false;
|
4218
5794
|
subscribeRefreshDom = null;
|
4219
5795
|
isIndeterminate = false;
|
5796
|
+
/**
|
5797
|
+
* @ignore
|
5798
|
+
*/
|
4220
5799
|
constructor(magicDirective, el, task) {
|
4221
5800
|
this.magicDirective = magicDirective;
|
4222
5801
|
this.el = el;
|
4223
5802
|
this.task = task;
|
4224
5803
|
}
|
5804
|
+
/**
|
5805
|
+
* Handles the Checkbox 'change' event - pass it to the Magic engine
|
5806
|
+
*/
|
4225
5807
|
onChange($event) {
|
4226
5808
|
if (this.threeState) {
|
4227
5809
|
this.handleThreeState();
|
@@ -4276,16 +5858,20 @@ class CheckboxMagicDirective {
|
|
4276
5858
|
checkbox.indeterminate = false;
|
4277
5859
|
value = 'checked';
|
4278
5860
|
}
|
5861
|
+
// @ts-ignore
|
4279
5862
|
this.magicDirective.task.onCheckChanged(value, this.magicDirective.id, +this.magicDirective.rowId);
|
4280
5863
|
}
|
5864
|
+
/**
|
5865
|
+
* Cleanup
|
5866
|
+
*/
|
4281
5867
|
ngOnDestroy() {
|
4282
5868
|
if (this.subscribeRefreshDom !== null)
|
4283
5869
|
this.subscribeRefreshDom.unsubscribe();
|
4284
5870
|
}
|
4285
|
-
static ɵfac = function CheckboxMagicDirective_Factory(
|
4286
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5871
|
+
/** @nocollapse */ static ɵfac = function CheckboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
5872
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4287
5873
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4288
|
-
} }, inputs: { threeState: "threeState" } });
|
5874
|
+
} }, inputs: { threeState: "threeState" }, standalone: false });
|
4289
5875
|
}
|
4290
5876
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
4291
5877
|
type: Directive,
|
@@ -4293,6 +5879,7 @@ class CheckboxMagicDirective {
|
|
4293
5879
|
selector: `
|
4294
5880
|
input[type=checkbox][magic]:not([noFormControl])
|
4295
5881
|
`,
|
5882
|
+
standalone: false
|
4296
5883
|
}]
|
4297
5884
|
}], () => [{ type: MagicDirective }, { type: i0.ElementRef }, { type: TaskMagicService }], { threeState: [{
|
4298
5885
|
type: Input
|
@@ -4301,43 +5888,62 @@ class CheckboxMagicDirective {
|
|
4301
5888
|
args: ['change', ['$event']]
|
4302
5889
|
}] }); })();
|
4303
5890
|
|
5891
|
+
/**
|
5892
|
+
* Directive for comboboxes, to handle the 'change' event
|
5893
|
+
*/
|
4304
5894
|
class ComboboxMagicDirective {
|
4305
5895
|
magicDirective;
|
4306
5896
|
constructor(magicDirective) {
|
4307
5897
|
this.magicDirective = magicDirective;
|
5898
|
+
// subcribe to refreshDom. This is a special case for native select HTML control.
|
5899
|
+
// to refresh the selected property. Else by default, HTML element doesn't get refreshed as per
|
5900
|
+
// selected value and 1st element remains selected.
|
4308
5901
|
this.magicDirective.task.refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c))).subscribe(value => {
|
4309
5902
|
let command = value;
|
4310
5903
|
if (command.Operation === HtmlProperties.ItemsList)
|
4311
5904
|
this.onComboboxItemsListChanged();
|
4312
5905
|
});
|
4313
5906
|
}
|
5907
|
+
/**
|
5908
|
+
* Handles the Combobox 'change' event - pass it to the Magic engine
|
5909
|
+
*/
|
4314
5910
|
onChange($event) {
|
4315
5911
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
4316
5912
|
}
|
5913
|
+
/**
|
5914
|
+
* To refresh Combobox selection as per selected property.
|
5915
|
+
*/
|
4317
5916
|
onComboboxItemsListChanged() {
|
4318
5917
|
this.magicDirective.task.refreshView();
|
4319
5918
|
}
|
4320
|
-
static ɵfac = function ComboboxMagicDirective_Factory(
|
4321
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
5919
|
+
/** @nocollapse */ static ɵfac = function ComboboxMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
5920
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4322
5921
|
i0.ɵɵlistener("change", function ComboboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4323
|
-
} } });
|
5922
|
+
} }, standalone: false });
|
4324
5923
|
}
|
4325
5924
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ComboboxMagicDirective, [{
|
4326
5925
|
type: Directive,
|
4327
5926
|
args: [{
|
4328
5927
|
selector: `select[magic]:not([multiple])`,
|
5928
|
+
standalone: false
|
4329
5929
|
}]
|
4330
5930
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4331
5931
|
type: HostListener,
|
4332
5932
|
args: ['change', ['$event']]
|
4333
5933
|
}] }); })();
|
4334
5934
|
|
5935
|
+
/**
|
5936
|
+
* This service supports custom actions on magic exit
|
5937
|
+
*/
|
4335
5938
|
class ExitMagicService {
|
5939
|
+
/**
|
5940
|
+
* Override this method to implement custom logic on magic exit
|
5941
|
+
*/
|
4336
5942
|
exitMagic() {
|
4337
5943
|
console.log("Magic application terminated");
|
4338
5944
|
}
|
4339
|
-
static ɵfac = function ExitMagicService_Factory(
|
4340
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
5945
|
+
/** @nocollapse */ static ɵfac = function ExitMagicService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ExitMagicService)(); };
|
5946
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: ExitMagicService, factory: ExitMagicService.ɵfac });
|
4341
5947
|
}
|
4342
5948
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ExitMagicService, [{
|
4343
5949
|
type: Injectable
|
@@ -4363,6 +5969,9 @@ function MagicShellComponent_div_5_Template(rf, ctx) { if (rf & 1) {
|
|
4363
5969
|
function MagicShellComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
4364
5970
|
i0.ɵɵelement(0, "div", 9);
|
4365
5971
|
} }
|
5972
|
+
/**
|
5973
|
+
* Root Magic component
|
5974
|
+
*/
|
4366
5975
|
class MagicShellComponent {
|
4367
5976
|
engineMagicService;
|
4368
5977
|
componentList;
|
@@ -4374,13 +5983,28 @@ class MagicShellComponent {
|
|
4374
5983
|
route;
|
4375
5984
|
router;
|
4376
5985
|
exitMagicService;
|
5986
|
+
/**
|
5987
|
+
* Root component to be displayed in the window
|
5988
|
+
*/
|
4377
5989
|
RootComponent = null;
|
5990
|
+
/**
|
5991
|
+
* parameters for the Root Component
|
5992
|
+
*/
|
4378
5993
|
RootComponentParameters;
|
4379
5994
|
overlayWindowsContainerViewRef;
|
4380
5995
|
rootMagicElementRef;
|
4381
5996
|
SpinnerTemplate;
|
4382
5997
|
showSpinner;
|
4383
5998
|
magicEngineTerminated = false;
|
5999
|
+
/**
|
6000
|
+
*
|
6001
|
+
* @param magic Magic's service
|
6002
|
+
* @param componentList Magic component list
|
6003
|
+
* @param changeDetectorRef Changes detector
|
6004
|
+
* @param titleService Title setting service
|
6005
|
+
* @param httpClient The native httpClient instance
|
6006
|
+
* @param exitMagicService Magic exit service
|
6007
|
+
*/
|
4384
6008
|
constructor(engineMagicService, componentList, changeDetectorRef, titleService, overlayWindowService, httpClient, pendingCommandsCollector, route, router, exitMagicService) {
|
4385
6009
|
this.engineMagicService = engineMagicService;
|
4386
6010
|
this.componentList = componentList;
|
@@ -4395,17 +6019,24 @@ class MagicShellComponent {
|
|
4395
6019
|
this.initialize();
|
4396
6020
|
this.setTitle();
|
4397
6021
|
}
|
6022
|
+
/**
|
6023
|
+
* Before-unload event listener
|
6024
|
+
* @param event
|
6025
|
+
*/
|
4398
6026
|
onBeforeUnload(event) {
|
4399
6027
|
if (this.engineMagicService.TransCacheExists()) {
|
6028
|
+
// Show the confirmation box before unloading the browser
|
4400
6029
|
event.returnValue = 'Are you sure?';
|
4401
6030
|
return 'Are you sure?';
|
4402
6031
|
}
|
4403
6032
|
else {
|
6033
|
+
// terminate the magic server context using fetch API with keep-alive
|
4404
6034
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
4405
6035
|
this.magicEngineTerminated = true;
|
4406
6036
|
}
|
4407
6037
|
}
|
4408
6038
|
onUnload(event) {
|
6039
|
+
// Chrome provides an opportunity to terminate the context after user approves the browser unload alert
|
4409
6040
|
if (!this.magicEngineTerminated)
|
4410
6041
|
this.engineMagicService.TerminateContextUsingFetchAPI();
|
4411
6042
|
}
|
@@ -4417,6 +6048,7 @@ class MagicShellComponent {
|
|
4417
6048
|
if (this.router.navigated) {
|
4418
6049
|
const queryParams = this.route.snapshot.queryParams;
|
4419
6050
|
const queryParamsMap = new Map();
|
6051
|
+
// Iterate over the queryParams object and populate the Map
|
4420
6052
|
for (const key in queryParams) {
|
4421
6053
|
if (queryParams.hasOwnProperty(key)) {
|
4422
6054
|
queryParamsMap.set(key, queryParams[key].toString());
|
@@ -4430,13 +6062,26 @@ class MagicShellComponent {
|
|
4430
6062
|
setViewContainerRef(vcRef) {
|
4431
6063
|
this.overlayWindowsContainerViewRef = vcRef;
|
4432
6064
|
}
|
6065
|
+
/**
|
6066
|
+
* Initialization of Magic mechanisms
|
6067
|
+
*/
|
4433
6068
|
initialize() {
|
4434
6069
|
this.registerUICommands();
|
4435
6070
|
}
|
6071
|
+
/**
|
6072
|
+
* Set the title
|
6073
|
+
*/
|
4436
6074
|
setTitle() {
|
4437
6075
|
const newTitle = this.componentList.title;
|
4438
6076
|
this.titleService.setTitle(newTitle);
|
4439
6077
|
}
|
6078
|
+
/**
|
6079
|
+
* Set the component according to requested form
|
6080
|
+
* @param formName Name of the form to open
|
6081
|
+
* @param taskId Id of opening task
|
6082
|
+
* @param taskDescription TODO
|
6083
|
+
* @param isModal whether modal window is being opened
|
6084
|
+
*/
|
4440
6085
|
setComponent(formName, taskId, taskDescription, isModal) {
|
4441
6086
|
this.pendingCommandsCollector.startCollecting();
|
4442
6087
|
if (isModal) {
|
@@ -4448,6 +6093,9 @@ class MagicShellComponent {
|
|
4448
6093
|
}
|
4449
6094
|
this.changeDetectorRef.detectChanges();
|
4450
6095
|
}
|
6096
|
+
/**
|
6097
|
+
* @ignore
|
6098
|
+
*/
|
4451
6099
|
registerUICommands() {
|
4452
6100
|
this.engineMagicService.refreshDom.pipe(filter(command => command.TaskTag === '0'))
|
4453
6101
|
.subscribe(command => {
|
@@ -4459,6 +6107,10 @@ class MagicShellComponent {
|
|
4459
6107
|
GuiInteractiveExecutor.executeInteractiveCommand(null, command, this.overlayWindowService);
|
4460
6108
|
});
|
4461
6109
|
}
|
6110
|
+
/**
|
6111
|
+
* Execute commands received from the Magic WebClient engine
|
6112
|
+
* @param command
|
6113
|
+
*/
|
4462
6114
|
executeCommand(command) {
|
4463
6115
|
switch (command.CommandType) {
|
4464
6116
|
case CommandType.OPEN_FORM:
|
@@ -4473,7 +6125,7 @@ class MagicShellComponent {
|
|
4473
6125
|
this.RootComponentParameters = {};
|
4474
6126
|
this.changeDetectorRef.detectChanges();
|
4475
6127
|
}
|
4476
|
-
else {
|
6128
|
+
else { // Close modal window
|
4477
6129
|
this.overlayWindowService.close(command.str);
|
4478
6130
|
this.changeDetectorRef.detectChanges();
|
4479
6131
|
}
|
@@ -4496,15 +6148,17 @@ class MagicShellComponent {
|
|
4496
6148
|
break;
|
4497
6149
|
}
|
4498
6150
|
}
|
4499
|
-
static ɵfac = function MagicShellComponent_Factory(
|
4500
|
-
static ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
6151
|
+
/** @nocollapse */ static ɵfac = function MagicShellComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicShellComponent)(i0.ɵɵdirectiveInject(EngineMagicService), i0.ɵɵdirectiveInject(ComponentListMagicService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1$1.Title), i0.ɵɵdirectiveInject(OverlayWindowService), i0.ɵɵdirectiveInject(i1$2.HttpClient), i0.ɵɵdirectiveInject(CommandsCollectorMagicService), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(ExitMagicService, 8)); };
|
6152
|
+
/** @nocollapse */ static ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: MagicShellComponent, selectors: [["magic-root"]], viewQuery: function MagicShellComponent_Query(rf, ctx) { if (rf & 1) {
|
4501
6153
|
i0.ɵɵviewQuery(_c0, 7);
|
4502
6154
|
} if (rf & 2) {
|
4503
6155
|
let _t;
|
4504
6156
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rootMagicElementRef = _t.first);
|
4505
6157
|
} }, hostBindings: function MagicShellComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
4506
6158
|
i0.ɵɵlistener("beforeunload", function MagicShellComponent_beforeunload_HostBindingHandler($event) { return ctx.onBeforeUnload($event); }, false, i0.ɵɵresolveWindow)("unload", function MagicShellComponent_unload_HostBindingHandler($event) { return ctx.onUnload($event); }, false, i0.ɵɵresolveWindow);
|
4507
|
-
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, features: [i0.ɵɵProvidersFeature([
|
6159
|
+
} }, inputs: { SpinnerTemplate: "SpinnerTemplate" }, standalone: false, features: [i0.ɵɵProvidersFeature([
|
6160
|
+
// ExitMagicService
|
6161
|
+
])], decls: 8, vars: 2, consts: [["magicRoot", ""], ["overlayWindowsContainer", ""], ["defaultSpinner", ""], [3, "ndcDynamicComponent", "ndcDynamicInputs", 4, "ngIf"], ["magicViewContainerRef", ""], ["class", "spinner-background", 4, "ngIf"], [3, "ndcDynamicComponent", "ndcDynamicInputs"], [1, "spinner-background"], [3, "ngTemplateOutlet"], [1, "mgSpinnerClass"]], template: function MagicShellComponent_Template(rf, ctx) { if (rf & 1) {
|
4508
6162
|
i0.ɵɵelementStart(0, "div", null, 0);
|
4509
6163
|
i0.ɵɵtemplate(2, MagicShellComponent_ndc_dynamic_2_Template, 1, 2, "ndc-dynamic", 3);
|
4510
6164
|
i0.ɵɵelement(3, "div", 4, 1);
|
@@ -4519,7 +6173,9 @@ class MagicShellComponent {
|
|
4519
6173
|
}
|
4520
6174
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
|
4521
6175
|
type: Component,
|
4522
|
-
args: [{ selector: 'magic-root', providers: [
|
6176
|
+
args: [{ selector: 'magic-root', providers: [
|
6177
|
+
// ExitMagicService
|
6178
|
+
], template: `
|
4523
6179
|
<div #magicRoot>
|
4524
6180
|
<ndc-dynamic
|
4525
6181
|
*ngIf = "RootComponent !== null"
|
@@ -4538,7 +6194,7 @@ class MagicShellComponent {
|
|
4538
6194
|
<ng-template #defaultSpinner>
|
4539
6195
|
<div class="mgSpinnerClass"></div>
|
4540
6196
|
</ng-template>
|
4541
|
-
`, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
6197
|
+
`, standalone: false, styles: [".mgSpinnerClass{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
4542
6198
|
}], () => [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: ExitMagicService, decorators: [{
|
4543
6199
|
type: Optional
|
4544
6200
|
}] }], { rootMagicElementRef: [{
|
@@ -4553,18 +6209,24 @@ class MagicShellComponent {
|
|
4553
6209
|
type: HostListener,
|
4554
6210
|
args: ['window:unload', ['$event']]
|
4555
6211
|
}] }); })();
|
4556
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src
|
6212
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MagicShellComponent, { className: "MagicShellComponent", filePath: "src/ui/magic-root.component.ts", lineNumber: 86 }); })();
|
4557
6213
|
|
6214
|
+
/**
|
6215
|
+
* @ignore
|
6216
|
+
*/
|
4558
6217
|
const CHECKBOX_VALUE_ACCESSOR = {
|
4559
6218
|
provide: NG_VALUE_ACCESSOR,
|
4560
6219
|
useExisting: forwardRef(() => MagicCheckboxControlValueAccessor),
|
4561
6220
|
multi: true,
|
4562
6221
|
};
|
6222
|
+
/**
|
6223
|
+
* Value accessor for Checkbox without a FormControl
|
6224
|
+
*/
|
4563
6225
|
class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
4564
|
-
static ɵfac = (() => { let ɵMagicCheckboxControlValueAccessor_BaseFactory; return function MagicCheckboxControlValueAccessor_Factory(
|
4565
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicCheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "magic", "", 3, "formControlName", "", 3, "no-form-control", ""], ["input", "type", "checkbox", "magic", "", 3, "formControl", ""], ["input", "type", "checkbox", "magic", "", 3, "ngModel", ""]], hostBindings: function MagicCheckboxControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
6226
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicCheckboxControlValueAccessor_BaseFactory; return function MagicCheckboxControlValueAccessor_Factory(__ngFactoryType__) { return (ɵMagicCheckboxControlValueAccessor_BaseFactory || (ɵMagicCheckboxControlValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicCheckboxControlValueAccessor)))(__ngFactoryType__ || MagicCheckboxControlValueAccessor); }; })();
|
6227
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicCheckboxControlValueAccessor, selectors: [["input", "type", "checkbox", "magic", "", 3, "formControlName", "", 3, "no-form-control", ""], ["input", "type", "checkbox", "magic", "", 3, "formControl", ""], ["input", "type", "checkbox", "magic", "", 3, "ngModel", ""]], hostBindings: function MagicCheckboxControlValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
4566
6228
|
i0.ɵɵlistener("change", function MagicCheckboxControlValueAccessor_change_HostBindingHandler($event) { return ctx.onChange($event.target.checked); })("blur", function MagicCheckboxControlValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
|
4567
|
-
} }, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
6229
|
+
} }, standalone: false, features: [i0.ɵɵProvidersFeature([CHECKBOX_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
4568
6230
|
}
|
4569
6231
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicCheckboxControlValueAccessor, [{
|
4570
6232
|
type: Directive,
|
@@ -4575,20 +6237,27 @@ class MagicCheckboxControlValueAccessor extends CheckboxControlValueAccessor {
|
|
4575
6237
|
input[type=checkbox][magic]:not([ngModel])
|
4576
6238
|
`,
|
4577
6239
|
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
4578
|
-
providers: [CHECKBOX_VALUE_ACCESSOR]
|
6240
|
+
providers: [CHECKBOX_VALUE_ACCESSOR],
|
6241
|
+
standalone: false
|
4579
6242
|
}]
|
4580
6243
|
}], null, null); })();
|
4581
6244
|
|
6245
|
+
/**
|
6246
|
+
* @ignore
|
6247
|
+
*/
|
4582
6248
|
const MAGIC_DEFAULT_VALUE_ACCESSOR = {
|
4583
6249
|
provide: NG_VALUE_ACCESSOR,
|
4584
6250
|
useExisting: forwardRef(() => MagicDefaultValueAccessor),
|
4585
6251
|
multi: true
|
4586
6252
|
};
|
6253
|
+
/**
|
6254
|
+
* @ignore
|
6255
|
+
*/
|
4587
6256
|
class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
4588
|
-
static ɵfac = (() => { let ɵMagicDefaultValueAccessor_BaseFactory; return function MagicDefaultValueAccessor_Factory(
|
4589
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: MagicDefaultValueAccessor, selectors: [["input", "magic", "", 3, "type", "checkbox", 3, "formControlName", "", 3, "no-form-control", ""], ["textarea", "magic", "", 3, "formControlName", "", 3, "noFormControl", "", 3, "no-form-control", ""]], hostBindings: function MagicDefaultValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
6257
|
+
/** @nocollapse */ static ɵfac = /** @pureOrBreakMyCode */ (() => { let ɵMagicDefaultValueAccessor_BaseFactory; return function MagicDefaultValueAccessor_Factory(__ngFactoryType__) { return (ɵMagicDefaultValueAccessor_BaseFactory || (ɵMagicDefaultValueAccessor_BaseFactory = i0.ɵɵgetInheritedFactory(MagicDefaultValueAccessor)))(__ngFactoryType__ || MagicDefaultValueAccessor); }; })();
|
6258
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: MagicDefaultValueAccessor, selectors: [["input", "magic", "", 3, "type", "checkbox", 3, "formControlName", "", 3, "no-form-control", ""], ["textarea", "magic", "", 3, "formControlName", "", 3, "noFormControl", "", 3, "no-form-control", ""]], hostBindings: function MagicDefaultValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
4590
6259
|
i0.ɵɵlistener("input", function MagicDefaultValueAccessor_input_HostBindingHandler($event) { return ctx._handleInput($event.target.value); })("blur", function MagicDefaultValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); })("compositionstart", function MagicDefaultValueAccessor_compositionstart_HostBindingHandler() { return ctx._compositionStart(); })("compositionend", function MagicDefaultValueAccessor_compositionend_HostBindingHandler($event) { return ctx._compositionEnd($event.target.value); });
|
4591
|
-
} }, exportAs: ["magic"], features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
6260
|
+
} }, exportAs: ["magic"], standalone: false, features: [i0.ɵɵProvidersFeature([MAGIC_DEFAULT_VALUE_ACCESSOR]), i0.ɵɵInheritDefinitionFeature] });
|
4592
6261
|
}
|
4593
6262
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDefaultValueAccessor, [{
|
4594
6263
|
type: Directive,
|
@@ -4604,22 +6273,29 @@ class MagicDefaultValueAccessor extends DefaultValueAccessor {
|
|
4604
6273
|
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
4605
6274
|
},
|
4606
6275
|
providers: [MAGIC_DEFAULT_VALUE_ACCESSOR],
|
4607
|
-
exportAs: 'magic'
|
6276
|
+
exportAs: 'magic',
|
6277
|
+
standalone: false
|
4608
6278
|
}]
|
4609
6279
|
}], null, null); })();
|
4610
6280
|
|
6281
|
+
/**
|
6282
|
+
* Directive for checkboxes which should not have a form control
|
6283
|
+
*/
|
4611
6284
|
class CheckboxNoFormControlMagicDirective {
|
4612
6285
|
magicDirective;
|
4613
6286
|
constructor(magicDirective) {
|
4614
6287
|
this.magicDirective = magicDirective;
|
4615
6288
|
}
|
6289
|
+
/**
|
6290
|
+
* Handle the 'Checkbox' change event - pass it to the Magic engine
|
6291
|
+
*/
|
4616
6292
|
onChange($event) {
|
4617
6293
|
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
4618
6294
|
}
|
4619
|
-
static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(
|
4620
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
6295
|
+
/** @nocollapse */ static ɵfac = function CheckboxNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CheckboxNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
6296
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: CheckboxNoFormControlMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", "noFormControl", ""]], hostBindings: function CheckboxNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4621
6297
|
i0.ɵɵlistener("change", function CheckboxNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4622
|
-
} } });
|
6298
|
+
} }, standalone: false });
|
4623
6299
|
}
|
4624
6300
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxNoFormControlMagicDirective, [{
|
4625
6301
|
type: Directive,
|
@@ -4627,30 +6303,38 @@ class CheckboxNoFormControlMagicDirective {
|
|
4627
6303
|
selector: `
|
4628
6304
|
input[type=checkbox][magic]:([noFormControl])
|
4629
6305
|
`,
|
6306
|
+
standalone: false
|
4630
6307
|
}]
|
4631
6308
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4632
6309
|
type: HostListener,
|
4633
6310
|
args: ['change', ['$event']]
|
4634
6311
|
}] }); })();
|
4635
6312
|
|
6313
|
+
/**
|
6314
|
+
* Directive for non-checkbox input controls which do not have a form control
|
6315
|
+
*/
|
4636
6316
|
class InputNoFormControlMagicDirective {
|
4637
6317
|
magicDirective;
|
4638
6318
|
constructor(magicDirective) {
|
4639
6319
|
this.magicDirective = magicDirective;
|
4640
6320
|
}
|
6321
|
+
/**
|
6322
|
+
* Handles the 'change' event - pass it to the Magic engine
|
6323
|
+
*/
|
4641
6324
|
onChange($event) {
|
4642
6325
|
this.magicDirective.task.setInputTextValue(this.magicDirective.id, this.magicDirective.rowId, event.srcElement.value);
|
4643
6326
|
}
|
4644
|
-
static ɵfac = function InputNoFormControlMagicDirective_Factory(
|
4645
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
6327
|
+
/** @nocollapse */ static ɵfac = function InputNoFormControlMagicDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || InputNoFormControlMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
6328
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: InputNoFormControlMagicDirective, selectors: [["input", "magic", "", "noFormControl", "", 3, "type", "checkbox"], ["textarea", "magic", "", "noFormControl", "", 3, "type", "checkbox"]], hostBindings: function InputNoFormControlMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
4646
6329
|
i0.ɵɵlistener("change", function InputNoFormControlMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
4647
|
-
} } });
|
6330
|
+
} }, standalone: false });
|
4648
6331
|
}
|
4649
6332
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputNoFormControlMagicDirective, [{
|
4650
6333
|
type: Directive,
|
4651
6334
|
args: [{
|
4652
6335
|
selector: `input[magic]:([noFormControl]):not([type=checkbox]),
|
4653
|
-
textarea[magic]:([noFormControl]):not([type=checkbox])
|
6336
|
+
textarea[magic]:([noFormControl]):not([type=checkbox])`,
|
6337
|
+
standalone: false
|
4654
6338
|
}]
|
4655
6339
|
}], () => [{ type: MagicDirective }], { onChange: [{
|
4656
6340
|
type: HostListener,
|
@@ -4662,6 +6346,14 @@ const DATE_VALUE_ACCESSOR = {
|
|
4662
6346
|
useExisting: forwardRef(() => DateValueAccessor),
|
4663
6347
|
multi: true
|
4664
6348
|
};
|
6349
|
+
/**
|
6350
|
+
* The accessor for writing a value and listening to changes on a date input element
|
6351
|
+
*
|
6352
|
+
* ### Example
|
6353
|
+
* `<input type="date" name="birthday" ngModel dateInput>`
|
6354
|
+
* OR
|
6355
|
+
* `<input type="date" formControlName="birthday" dateInput>`
|
6356
|
+
*/
|
4665
6357
|
class DateValueAccessor {
|
4666
6358
|
renderer;
|
4667
6359
|
elementRef;
|
@@ -4680,6 +6372,7 @@ class DateValueAccessor {
|
|
4680
6372
|
this.magicDir = magicDir;
|
4681
6373
|
this._task = _task;
|
4682
6374
|
}
|
6375
|
+
/** Format year, if user enters 2 digits instead of 4 digits as per the century given in Magic.ini file */
|
4683
6376
|
formatDateWithCentury(userInput, century, control) {
|
4684
6377
|
const separator = userInput.includes('/') ? '/' : "-";
|
4685
6378
|
let centuryVal = parseInt(century.toString().slice(0, 2));
|
@@ -4694,6 +6387,7 @@ class DateValueAccessor {
|
|
4694
6387
|
year;
|
4695
6388
|
control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
|
4696
6389
|
}
|
6390
|
+
/** Writes a new value to the element (model -> view) */
|
4697
6391
|
writeValue(value) {
|
4698
6392
|
if (!value) {
|
4699
6393
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
@@ -4701,27 +6395,31 @@ class DateValueAccessor {
|
|
4701
6395
|
}
|
4702
6396
|
this.renderer.setProperty(this.elementRef.nativeElement, "valueAsDate", new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate())));
|
4703
6397
|
}
|
6398
|
+
/** Registers a callback function, called when value changes (view -> model) */
|
4704
6399
|
registerOnChange(fn) {
|
4705
6400
|
this.onChange = v => fn(v instanceof Date
|
4706
6401
|
? new Date(v.getUTCFullYear(), v.getUTCMonth(), v.getUTCDate())
|
4707
6402
|
: v);
|
4708
6403
|
}
|
6404
|
+
/** Registers a callback function, called when the control is blurred */
|
4709
6405
|
registerOnTouched(fn) {
|
4710
6406
|
this.onTouched = fn;
|
4711
6407
|
}
|
6408
|
+
/** Enables or disables the element when the control status changes */
|
4712
6409
|
setDisabledState(isDisabled) {
|
4713
6410
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
4714
6411
|
}
|
4715
|
-
static ɵfac = function DateValueAccessor_Factory(
|
4716
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
6412
|
+
/** @nocollapse */ static ɵfac = function DateValueAccessor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
6413
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
|
4717
6414
|
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
4718
|
-
} }, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
6415
|
+
} }, standalone: false, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
4719
6416
|
}
|
4720
6417
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateValueAccessor, [{
|
4721
6418
|
type: Directive,
|
4722
6419
|
args: [{
|
4723
6420
|
selector: "[dateInput]",
|
4724
|
-
providers: [DATE_VALUE_ACCESSOR]
|
6421
|
+
providers: [DATE_VALUE_ACCESSOR],
|
6422
|
+
standalone: false
|
4725
6423
|
}]
|
4726
6424
|
}], () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: MagicDirective }, { type: TaskMagicService }], { onChange: [{
|
4727
6425
|
type: HostListener,
|
@@ -4734,6 +6432,9 @@ class DateValueAccessor {
|
|
4734
6432
|
args: ['blur', ['$event']]
|
4735
6433
|
}] }); })();
|
4736
6434
|
|
6435
|
+
/**
|
6436
|
+
* 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
|
6437
|
+
*/
|
4737
6438
|
class NonMagicControlDirective {
|
4738
6439
|
_task;
|
4739
6440
|
element;
|
@@ -4744,13 +6445,38 @@ class NonMagicControlDirective {
|
|
4744
6445
|
this.selector = 'NonMagicControl';
|
4745
6446
|
}
|
4746
6447
|
;
|
6448
|
+
/**
|
6449
|
+
* The HTML element connected to this directive
|
6450
|
+
*/
|
4747
6451
|
htmlElement;
|
6452
|
+
/**
|
6453
|
+
* Magic's component handling this control
|
6454
|
+
*/
|
4748
6455
|
component;
|
6456
|
+
/**
|
6457
|
+
* Collection of event handlers for this element
|
6458
|
+
*/
|
4749
6459
|
eventHandlers = {};
|
6460
|
+
/**
|
6461
|
+
* Id of this element
|
6462
|
+
*/
|
4750
6463
|
id;
|
6464
|
+
/**
|
6465
|
+
* @ignore
|
6466
|
+
*/
|
4751
6467
|
selector;
|
6468
|
+
/**
|
6469
|
+
* @ignore
|
6470
|
+
*/
|
4752
6471
|
subscribeRefreshDom;
|
4753
6472
|
eventsOnlyVal = false;
|
6473
|
+
/**
|
6474
|
+
*
|
6475
|
+
* @param _task The task service
|
6476
|
+
* @param element The element for which the directive is applied
|
6477
|
+
* @param renderer Renderer for the element
|
6478
|
+
* @param vcRef
|
6479
|
+
*/
|
4754
6480
|
constructor(_task, element, renderer, vcRef) {
|
4755
6481
|
this._task = _task;
|
4756
6482
|
this.element = element;
|
@@ -4758,29 +6484,44 @@ class NonMagicControlDirective {
|
|
4758
6484
|
this.vcRef = vcRef;
|
4759
6485
|
this.htmlElement = this.element.nativeElement;
|
4760
6486
|
}
|
6487
|
+
/**
|
6488
|
+
* Get the task service
|
6489
|
+
* @returns
|
6490
|
+
*/
|
4761
6491
|
get task() {
|
4762
6492
|
return this._task;
|
4763
6493
|
}
|
6494
|
+
/**
|
6495
|
+
* Register to the events this element may need to handle
|
6496
|
+
*/
|
4764
6497
|
regEvents() {
|
6498
|
+
// Handle events for which event handler may be removed and restored
|
4765
6499
|
this.eventHandlers['focusin'] = this.OnFocus.bind(this);
|
4766
6500
|
Object.keys(this.eventHandlers).forEach((key) => {
|
4767
6501
|
this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
|
4768
6502
|
});
|
4769
6503
|
}
|
6504
|
+
/**
|
6505
|
+
* Handle focus event
|
6506
|
+
*/
|
4770
6507
|
OnFocus() {
|
4771
6508
|
this.task.insertEvent(getGuiEventObj('focusOnNonMagicControl', '', -1));
|
4772
6509
|
event.cancelBubble = true;
|
4773
6510
|
}
|
6511
|
+
/**
|
6512
|
+
* Initialize this object
|
6513
|
+
*/
|
4774
6514
|
ngOnInit() {
|
4775
6515
|
this.regEvents();
|
4776
6516
|
}
|
4777
|
-
static ɵfac = function NonMagicControlDirective_Factory(
|
4778
|
-
static ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [
|
6517
|
+
/** @nocollapse */ static ɵfac = function NonMagicControlDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NonMagicControlDirective)(i0.ɵɵdirectiveInject(TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
|
6518
|
+
/** @nocollapse */ static ɵdir = /** @pureOrBreakMyCode */ i0.ɵɵdefineDirective({ type: NonMagicControlDirective, selectors: [["", "NonMagicControl", ""]], inputs: { magic: [0, "NonMagicControl", "magic"] }, standalone: false });
|
4779
6519
|
}
|
4780
6520
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NonMagicControlDirective, [{
|
4781
6521
|
type: Directive,
|
4782
6522
|
args: [{
|
4783
|
-
selector: '[NonMagicControl]'
|
6523
|
+
selector: '[NonMagicControl]',
|
6524
|
+
standalone: false
|
4784
6525
|
}]
|
4785
6526
|
}], () => [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }], { magic: [{
|
4786
6527
|
type: Input,
|
@@ -4808,16 +6549,20 @@ class Time24MagicPipe {
|
|
4808
6549
|
}
|
4809
6550
|
return value;
|
4810
6551
|
}
|
4811
|
-
static ɵfac = function Time24MagicPipe_Factory(
|
4812
|
-
static ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true });
|
6552
|
+
/** @nocollapse */ static ɵfac = function Time24MagicPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Time24MagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
6553
|
+
/** @nocollapse */ static ɵpipe = /** @pureOrBreakMyCode */ i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true, standalone: false });
|
4813
6554
|
}
|
4814
6555
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
|
4815
6556
|
type: Pipe,
|
4816
6557
|
args: [{
|
4817
|
-
name: 'magicTime24'
|
6558
|
+
name: 'magicTime24',
|
6559
|
+
standalone: false
|
4818
6560
|
}]
|
4819
6561
|
}], () => [{ type: TaskMagicService }], null); })();
|
4820
6562
|
|
6563
|
+
/**
|
6564
|
+
* @ignore
|
6565
|
+
*/
|
4821
6566
|
const decs = [
|
4822
6567
|
MagicDirective,
|
4823
6568
|
CheckboxMagicDirective,
|
@@ -4849,30 +6594,33 @@ const decs = [
|
|
4849
6594
|
MagicViewContainerRef,
|
4850
6595
|
Time24MagicPipe
|
4851
6596
|
];
|
6597
|
+
/**
|
6598
|
+
* @ignore
|
6599
|
+
*/
|
4852
6600
|
class MagicModule {
|
4853
|
-
static ɵfac = function MagicModule_Factory(
|
4854
|
-
static ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
|
4855
|
-
static ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [CommonModule,
|
6601
|
+
/** @nocollapse */ static ɵfac = function MagicModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MagicModule)(); };
|
6602
|
+
/** @nocollapse */ static ɵmod = /** @pureOrBreakMyCode */ i0.ɵɵdefineNgModule({ type: MagicModule });
|
6603
|
+
/** @nocollapse */ static ɵinj = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule,
|
4856
6604
|
FormsModule,
|
4857
6605
|
ReactiveFormsModule,
|
4858
6606
|
RouterModule,
|
4859
6607
|
DynamicModule,
|
4860
|
-
|
6608
|
+
DragDropModule, MaskitoModule] });
|
4861
6609
|
}
|
4862
6610
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
|
4863
6611
|
type: NgModule,
|
4864
6612
|
args: [{
|
4865
6613
|
declarations: [...decs],
|
4866
6614
|
exports: [...decs, MaskitoModule],
|
4867
|
-
imports: [
|
4868
|
-
CommonModule,
|
6615
|
+
imports: [CommonModule,
|
4869
6616
|
FormsModule,
|
4870
6617
|
ReactiveFormsModule,
|
4871
6618
|
RouterModule,
|
4872
6619
|
DynamicModule,
|
4873
|
-
|
4874
|
-
|
4875
|
-
|
6620
|
+
CdkDragHandle,
|
6621
|
+
CdkDrag,
|
6622
|
+
DragDropModule],
|
6623
|
+
providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider, provideHttpClient(withInterceptorsFromDi())]
|
4876
6624
|
}]
|
4877
6625
|
}], null, null); })();
|
4878
6626
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicModule, { declarations: [MagicDirective,
|
@@ -4908,7 +6656,9 @@ class MagicModule {
|
|
4908
6656
|
ReactiveFormsModule,
|
4909
6657
|
RouterModule,
|
4910
6658
|
DynamicModule,
|
4911
|
-
|
6659
|
+
CdkDragHandle,
|
6660
|
+
CdkDrag,
|
6661
|
+
DragDropModule], exports: [MagicDirective,
|
4912
6662
|
CheckboxMagicDirective,
|
4913
6663
|
CheckboxNoFormControlMagicDirective,
|
4914
6664
|
InputNoFormControlMagicDirective,
|
@@ -5023,15 +6773,15 @@ class MgDateAdapter extends NativeDateAdapter {
|
|
5023
6773
|
this.mgdtfmt = this.task.mgInputDateFormat;
|
5024
6774
|
if (displayFormat === 'input') {
|
5025
6775
|
if (this.mgdtfmt == null)
|
5026
|
-
this.mgdtfmt = 'M/d/yyyy';
|
6776
|
+
this.mgdtfmt = 'M/d/yyyy'; //default format
|
5027
6777
|
return formatDate(date, this.mgdtfmt, this.locale);
|
5028
6778
|
}
|
5029
6779
|
else {
|
5030
6780
|
return date.toDateString();
|
5031
6781
|
}
|
5032
6782
|
}
|
5033
|
-
static ɵfac = function MgDateAdapter_Factory(
|
5034
|
-
static ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
6783
|
+
/** @nocollapse */ static ɵfac = function MgDateAdapter_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MgDateAdapter)(i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
|
6784
|
+
/** @nocollapse */ static ɵprov = /** @pureOrBreakMyCode */ i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
|
5035
6785
|
}
|
5036
6786
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
|
5037
6787
|
type: Injectable
|
@@ -5044,6 +6794,9 @@ const matDateProviders = [
|
|
5044
6794
|
{ provide: DateAdapter, useClass: MgDateAdapter },
|
5045
6795
|
{ provide: MAT_DATE_FORMATS, useValue: MG_FORMATS }
|
5046
6796
|
];
|
6797
|
+
/**
|
6798
|
+
* Magic service providers
|
6799
|
+
*/
|
5047
6800
|
const basicMagicProviders = [
|
5048
6801
|
MagicServices,
|
5049
6802
|
TaskMagicService,
|
@@ -5057,7 +6810,16 @@ const magicProviders = [
|
|
5057
6810
|
TableMagicService
|
5058
6811
|
];
|
5059
6812
|
|
6813
|
+
/**
|
6814
|
+
* @ignore
|
6815
|
+
*/
|
6816
|
+
///////////////////////////////////////////////////////////
|
6817
|
+
// class to hold gui-related helper methods
|
6818
|
+
///////////////////////////////////////////////////////////
|
5060
6819
|
class utils {
|
6820
|
+
///////////////////////////////////////////////////////////
|
6821
|
+
// Calculate the distance between the control and the supplied x,y coordinates
|
6822
|
+
///////////////////////////////////////////////////////////
|
5061
6823
|
static getDistance(control, x, y) {
|
5062
6824
|
let left = control.clientLeft, top = control.clientTop;
|
5063
6825
|
let dx, dy;
|
@@ -5084,6 +6846,9 @@ class utils {
|
|
5084
6846
|
const ret = (dx * dx + dy * dy);
|
5085
6847
|
return ret;
|
5086
6848
|
}
|
6849
|
+
///////////////////////////////////////////////////////////
|
6850
|
+
//
|
6851
|
+
///////////////////////////////////////////////////////////
|
5087
6852
|
static getDimentions(el) {
|
5088
6853
|
let xPos = 0;
|
5089
6854
|
let yPos = 0;
|
@@ -5091,12 +6856,14 @@ class utils {
|
|
5091
6856
|
let height = el.height;
|
5092
6857
|
while (el) {
|
5093
6858
|
if (el.tagName == "BODY") {
|
6859
|
+
// deal with browser quirks with body/window/document and page scroll
|
5094
6860
|
let xScroll = el.scrollLeft || document.documentElement.scrollLeft;
|
5095
6861
|
let yScroll = el.scrollTop || document.documentElement.scrollTop;
|
5096
6862
|
xPos += (el.offsetLeft - xScroll + el.clientLeft);
|
5097
6863
|
yPos += (el.offsetTop - yScroll + el.clientTop);
|
5098
6864
|
}
|
5099
6865
|
else {
|
6866
|
+
// for all other non-BODY elements
|
5100
6867
|
xPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);
|
5101
6868
|
yPos += (el.offsetTop - el.scrollTop + el.clientTop);
|
5102
6869
|
}
|
@@ -5111,11 +6878,22 @@ class utils {
|
|
5111
6878
|
}
|
5112
6879
|
}
|
5113
6880
|
|
6881
|
+
/**
|
6882
|
+
* @ignore
|
6883
|
+
*/
|
5114
6884
|
class ModalFormDefinition {
|
5115
6885
|
taskId = "";
|
5116
6886
|
comp = null;
|
5117
6887
|
parameters = {};
|
5118
6888
|
}
|
5119
6889
|
|
6890
|
+
/**
|
6891
|
+
* @file Automatically generated by barrelsby.
|
6892
|
+
*/
|
6893
|
+
|
6894
|
+
/**
|
6895
|
+
* Generated bundle index. Do not edit.
|
6896
|
+
*/
|
6897
|
+
|
5120
6898
|
export { AccessorMagicService, BaseMagicAlertComponent, BaseMagicConfirmComponent, BaseMagicOverlayContainer, CHECKBOX_VALUE_ACCESSOR, COLOR_FILE_NAME, CheckboxMagicDirective, CheckboxNoFormControlMagicDirective, ComboboxMagicDirective, CommandsCollectorMagicService, ComponentListMagicService, ConfirmationComponentsMagicProvider, Constants, ControlMetadata, ControlsMetadata, DATE_VALUE_ACCESSOR, DateMagicPipe, DateValueAccessor, EngineMagicService, ErrorMagicComponent, ExitMagicService, GuiInteractiveExecutor, HtmlClasses, InputNoFormControlMagicDirective, MAGIC_BG_COLOR, MAGIC_DEFAULT_VALUE_ACCESSOR, MAGIC_FG_COLOR, MG_FORMATS, MagicAlertComponent, MagicCheckboxControlValueAccessor, MagicColorService, MagicConfirmationBoxComponent, MagicDefaultValueAccessor, MagicDirective, MagicFocusDirective, MagicLazyLoaderService, MagicModule, MagicOverlayContainer, MagicOverlayContainerWrapper, MagicServices, MagicShellComponent, MagicViewContainerRef, MgDateAdapter, MgDateFormatter, MgformatMagicDirective, ModalFormDefinition, NoControlMagicDirective, NonMagicControlDirective, OverlayContainerMagicProvider, OverlayWindowService, RangeValidatorMagicDirective, Records, RouteCommand, RouterCommandsMagicService, RouterContainerMagicComponent, RowMagicDirective, StylesMapManager, SubformMagicComponent, SubformMagicService, TableMagicService, TaskBaseMagicComponent, TaskMagicService, Time24MagicPipe, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
5121
6899
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|