@magic-xpa/angular 4.1000.0-dev4100.99 → 4.1000.410-0.428
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/esm2020/index.mjs +2 -1
- package/esm2020/src/magic.core.module.mjs +16 -13
- package/esm2020/src/services/accessor.magic.service.mjs +28 -3
- package/esm2020/src/services/magic-color.service.mjs +4 -4
- package/esm2020/src/services/subform.magic.service.mjs +1 -1
- package/esm2020/src/services/table.magic.service.mjs +5 -2
- package/esm2020/src/services/task.magics.service.mjs +25 -4
- package/esm2020/src/ui/GuiInteractiveExecutor.mjs +7 -2
- package/esm2020/src/ui/components/base-magic-alert.component.mjs +3 -7
- package/esm2020/src/ui/components/base-magic-confirm.component.mjs +3 -7
- package/esm2020/src/ui/components/magic-alert.component.mjs +3 -35
- package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +3 -39
- package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +6 -6
- package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +76 -7
- package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +11 -1
- package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +34 -5
- package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +3 -3
- package/esm2020/src/ui/directives/magic.directive.mjs +11 -11
- package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +336 -3
- package/esm2020/src/ui/magic-modal/base-magic-overlay-container.mjs +1 -1
- package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +4 -18
- package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +4 -4
- package/esm2020/src/ui/magic-root.component.mjs +4 -38
- package/esm2020/src/ui/mgerror.magic.component.mjs +9 -9
- package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +34 -0
- package/esm2020/src/ui/router-container.magic.component.mjs +4 -4
- package/esm2020/src/ui/subform.magic.component.mjs +4 -4
- package/esm2020/src/ui/task-base.magic.component.mjs +8 -2
- package/fesm2015/magic-xpa-angular.mjs +605 -208
- package/fesm2015/magic-xpa-angular.mjs.map +1 -1
- package/fesm2020/magic-xpa-angular.mjs +603 -208
- package/fesm2020/magic-xpa-angular.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +11 -8
- package/src/magic.core.module.d.ts +8 -6
- package/src/services/accessor.magic.service.d.ts +3 -0
- package/src/services/table.magic.service.d.ts +2 -0
- package/src/services/task.magics.service.d.ts +1 -0
- package/src/ui/components/base-magic-alert.component.d.ts +1 -1
- package/src/ui/components/base-magic-confirm.component.d.ts +1 -1
- package/src/ui/components/magic-alert.component.d.ts +1 -1
- package/src/ui/components/magic-confirmation-box.component.d.ts +1 -1
- package/src/ui/directives/NonMagicControlDirective.d.ts +1 -1
- package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +1 -1
- package/src/ui/directives/magic/checkbox.magic.directive.d.ts +15 -2
- package/src/ui/directives/magic/combobox.magic.directive.d.ts +2 -1
- package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +1 -1
- package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +9 -3
- package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +1 -1
- package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +1 -1
- package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +1 -1
- package/src/ui/directives/magic/row.magic.directive.d.ts +1 -1
- package/src/ui/directives/magic-focus.directive.d.ts +1 -1
- package/src/ui/directives/magic.directive.d.ts +2 -2
- package/src/ui/directives/magicViewContainerRef.directive.d.ts +1 -1
- package/src/ui/directives/mgformat.magic.directive.d.ts +12 -2
- package/src/ui/directives/range-validator.magic.directive.d.ts +1 -1
- package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +1 -1
- package/src/ui/magic-modal/magic-overlay-container.d.ts +1 -1
- package/src/ui/magic-root.component.d.ts +1 -1
- package/src/ui/mgerror.magic.component.d.ts +1 -1
- package/src/ui/pipes/date.magic.pipe.d.ts +1 -1
- package/src/ui/pipes/time.magic.pipe.d.ts +1 -1
- package/src/ui/pipes/time24.magic.pipe.d.ts +10 -0
- package/src/ui/router-container.magic.component.d.ts +1 -1
- package/src/ui/subform.magic.component.d.ts +1 -1
- package/src/ui/task-base.magic.component.d.ts +2 -1
- package/magic-xpa-angular.d.ts +0 -2
@@ -8,15 +8,17 @@ import { 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, OverlayType, Styles,
|
12
|
-
import { MagicBridge, getGuiEventObj, CookieService } from '@magic-xpa/engine';
|
11
|
+
import { InteractiveCommandType, HtmlProperties, OverlayType, Styles, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
|
12
|
+
import { MagicBridge, getGuiEventObj, CookieService, Environment, LastFocusedManager } from '@magic-xpa/engine';
|
13
13
|
import { MagicProperties, Logger, StrUtil, StorageAttribute, PICInterface, BindingLevel, StorageAttributeType, MgControlType } from '@magic-xpa/utils';
|
14
14
|
import { filter, map, debounceTime } from 'rxjs/operators';
|
15
15
|
import { Subject, fromEvent } from 'rxjs';
|
16
16
|
import { __awaiter, __decorate, __metadata } from 'tslib';
|
17
17
|
import * as i1$1 from '@angular/platform-browser';
|
18
|
+
import { maskitoTimeOptionsGenerator } from '@maskito/kit';
|
18
19
|
import * as i1$2 from '@angular/common/http';
|
19
20
|
import { HttpClientModule } from '@angular/common/http';
|
21
|
+
import { MaskitoModule } from '@maskito/angular';
|
20
22
|
import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
21
23
|
import * as i1$3 from '@angular/cdk/platform';
|
22
24
|
|
@@ -610,6 +612,9 @@ SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicServic
|
|
610
612
|
})();
|
611
613
|
|
612
614
|
class RouterContainerMagicComponent {
|
615
|
+
static get LastRoute() {
|
616
|
+
return RouterContainerMagicComponent.lastRoute;
|
617
|
+
}
|
613
618
|
constructor(activatedRoute, router, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
|
614
619
|
this.activatedRoute = activatedRoute;
|
615
620
|
this.router = router;
|
@@ -623,9 +628,6 @@ class RouterContainerMagicComponent {
|
|
623
628
|
this.componentRef = null;
|
624
629
|
this.parentMgSubformService = null;
|
625
630
|
}
|
626
|
-
static get LastRoute() {
|
627
|
-
return RouterContainerMagicComponent.lastRoute;
|
628
|
-
}
|
629
631
|
ngOnInit() {
|
630
632
|
let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
|
631
633
|
let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
|
@@ -754,6 +756,11 @@ class GuiInteractiveExecutor {
|
|
754
756
|
}
|
755
757
|
else if (this.task.isTableControl(this.command.controlName))
|
756
758
|
val = this.task.getValue(this.command.controlName, guiRowId.toString());
|
759
|
+
if (this.command._boolVal) {
|
760
|
+
const indeterminate = this.task.getProperty(this.command.controlName, HtmlProperties.CheckBoxIndeterminate, guiRowId.toString());
|
761
|
+
if (indeterminate)
|
762
|
+
val = null;
|
763
|
+
}
|
757
764
|
val = this.task.ConvertValToNative(this.command.controlName, guiRowId, val);
|
758
765
|
this.command._mgValue.obj = val;
|
759
766
|
}
|
@@ -824,15 +831,11 @@ class BaseMagicConfirmComponent {
|
|
824
831
|
}
|
825
832
|
}
|
826
833
|
BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
|
827
|
-
BaseMagicConfirmComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { }
|
834
|
+
BaseMagicConfirmComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicConfirmComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicConfirmComponent_Template(rf, ctx) { } });
|
828
835
|
(function () {
|
829
836
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
|
830
837
|
type: Component,
|
831
|
-
args: [{
|
832
|
-
selector: 'mg-base-alert',
|
833
|
-
template: '',
|
834
|
-
styles: ['']
|
835
|
-
}]
|
838
|
+
args: [{ selector: 'mg-base-alert', template: '' }]
|
836
839
|
}], null, { title: [{
|
837
840
|
type: Input
|
838
841
|
}], message: [{
|
@@ -851,15 +854,11 @@ class BaseMagicAlertComponent {
|
|
851
854
|
}
|
852
855
|
}
|
853
856
|
BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
|
854
|
-
BaseMagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { }
|
857
|
+
BaseMagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMagicAlertComponent, selectors: [["mg-base-alert"]], inputs: { title: "title", message: "message" }, outputs: { onClose: "onClose" }, decls: 0, vars: 0, template: function BaseMagicAlertComponent_Template(rf, ctx) { } });
|
855
858
|
(function () {
|
856
859
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
|
857
860
|
type: Component,
|
858
|
-
args: [{
|
859
|
-
selector: 'mg-base-alert',
|
860
|
-
template: '',
|
861
|
-
styles: ['']
|
862
|
-
}]
|
861
|
+
args: [{ selector: 'mg-base-alert', template: '' }]
|
863
862
|
}], null, { title: [{
|
864
863
|
type: Input
|
865
864
|
}], message: [{
|
@@ -993,13 +992,11 @@ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlay
|
|
993
992
|
i0.ɵɵelement(6, "div", 5);
|
994
993
|
i0.ɵɵelementEnd();
|
995
994
|
}
|
996
|
-
},
|
995
|
+
}, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
|
997
996
|
(function () {
|
998
997
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
|
999
998
|
type: Component,
|
1000
|
-
args: [{
|
1001
|
-
selector: 'app-magic-overlay-container-wrapper',
|
1002
|
-
template: `
|
999
|
+
args: [{ selector: 'app-magic-overlay-container-wrapper', template: `
|
1003
1000
|
<div>
|
1004
1001
|
<div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" magicFocus></div>
|
1005
1002
|
<div class="overlay-container-wrapper-background" #overlayContainerWrapper>
|
@@ -1008,19 +1005,7 @@ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlay
|
|
1008
1005
|
</div>
|
1009
1006
|
<div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
|
1010
1007
|
</div>
|
1011
|
-
`,
|
1012
|
-
styles: [`
|
1013
|
-
.overlay-container-wrapper-background {
|
1014
|
-
/* modal background fixed across whole screen */
|
1015
|
-
position: fixed;
|
1016
|
-
top: 0;
|
1017
|
-
z-index: 999;
|
1018
|
-
right: 0;
|
1019
|
-
bottom: 0;
|
1020
|
-
left: 0;
|
1021
|
-
}
|
1022
|
-
`]
|
1023
|
-
}]
|
1008
|
+
`, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
|
1024
1009
|
}], function () { return [{ type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: i0.Compiler }]; }, { Component: [{
|
1025
1010
|
type: Input
|
1026
1011
|
}], Parameters: [{
|
@@ -1082,7 +1067,7 @@ function MagicOverlayContainer_button_2_Template(rf, ctx) {
|
|
1082
1067
|
if (rf & 1) {
|
1083
1068
|
const _r5 = i0.ɵɵgetCurrentView();
|
1084
1069
|
i0.ɵɵelementStart(0, "button", 8);
|
1085
|
-
i0.ɵɵlistener("click", function MagicOverlayContainer_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.OnClose(); });
|
1070
|
+
i0.ɵɵlistener("click", function MagicOverlayContainer_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.OnClose()); });
|
1086
1071
|
i0.ɵɵtext(1, "X");
|
1087
1072
|
i0.ɵɵelementEnd();
|
1088
1073
|
}
|
@@ -1093,7 +1078,7 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) {
|
|
1093
1078
|
i0.ɵɵelementStart(0, "div", 9, 10);
|
1094
1079
|
i0.ɵɵtext(2);
|
1095
1080
|
i0.ɵɵelementStart(3, "button", 11);
|
1096
|
-
i0.ɵɵlistener("click", function MagicOverlayContainer_div_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.OnClose(); });
|
1081
|
+
i0.ɵɵlistener("click", function MagicOverlayContainer_div_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r7.OnClose()); });
|
1097
1082
|
i0.ɵɵtext(4, "X");
|
1098
1083
|
i0.ɵɵelementEnd()();
|
1099
1084
|
}
|
@@ -1206,7 +1191,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
|
|
1206
1191
|
i0.ɵɵadvance(1);
|
1207
1192
|
i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
|
1208
1193
|
}
|
1209
|
-
},
|
1194
|
+
}, 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}"] });
|
1210
1195
|
(function () {
|
1211
1196
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
|
1212
1197
|
type: Component,
|
@@ -1281,46 +1266,14 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
|
|
1281
1266
|
(function () {
|
1282
1267
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicAlertComponent, [{
|
1283
1268
|
type: Component,
|
1284
|
-
args: [{
|
1285
|
-
selector: 'sample-magic-alert-component',
|
1286
|
-
template: `<div>
|
1269
|
+
args: [{ selector: 'sample-magic-alert-component', template: `<div>
|
1287
1270
|
<div class="mg-message-background">
|
1288
1271
|
<h2> {{title}}</h2>
|
1289
1272
|
<p>{{message}} </p>
|
1290
1273
|
|
1291
1274
|
<button (click)="OnClose()">OK</button>
|
1292
1275
|
</div>
|
1293
|
-
</div>`,
|
1294
|
-
styles: [`
|
1295
|
-
.mg-message-background {
|
1296
|
-
background-color: #F5F5F5;
|
1297
|
-
text-align: center;
|
1298
|
-
width: 40%;
|
1299
|
-
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
1300
|
-
padding: 17px;
|
1301
|
-
border-radius: 5px;
|
1302
|
-
text-align: center;
|
1303
|
-
margin-top: 10% ;
|
1304
|
-
margin-left: auto;
|
1305
|
-
margin-right: auto;
|
1306
|
-
border: 1px solid gray;
|
1307
|
-
}
|
1308
|
-
|
1309
|
-
button {
|
1310
|
-
background-color: #8CD4F5;
|
1311
|
-
color: white;
|
1312
|
-
border: none;
|
1313
|
-
box-shadow: none;
|
1314
|
-
font-size: 17px;
|
1315
|
-
font-weight: 500;
|
1316
|
-
-webkit-border-radius: 4px;
|
1317
|
-
border-radius: 5px;
|
1318
|
-
padding: 10px 32px;
|
1319
|
-
margin: 26px 5px 0 5px;
|
1320
|
-
cursor: pointer;
|
1321
|
-
}
|
1322
|
-
`]
|
1323
|
-
}]
|
1276
|
+
</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;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}\n"] }]
|
1324
1277
|
}], null, null);
|
1325
1278
|
})();
|
1326
1279
|
|
@@ -1353,9 +1306,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
|
|
1353
1306
|
(function () {
|
1354
1307
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
|
1355
1308
|
type: Component,
|
1356
|
-
args: [{
|
1357
|
-
selector: 'sample-magic-confirmation-box',
|
1358
|
-
template: `<div>
|
1309
|
+
args: [{ selector: 'sample-magic-confirmation-box', template: `<div>
|
1359
1310
|
<div class="mg-message-background">
|
1360
1311
|
<h2> {{title}}</h2>
|
1361
1312
|
{{message}}
|
@@ -1365,41 +1316,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
|
|
1365
1316
|
<button (click)="OnClose(true)">OK</button>
|
1366
1317
|
<button class="cancel" (click)="OnClose(false)">Cancel</button>
|
1367
1318
|
</div>
|
1368
|
-
</div>`,
|
1369
|
-
styles: [`
|
1370
|
-
.mg-message-background {
|
1371
|
-
background-color: #F5F5F5;
|
1372
|
-
text-align: center;
|
1373
|
-
width: 40%;
|
1374
|
-
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
1375
|
-
padding: 17px;
|
1376
|
-
border-radius: 5px;
|
1377
|
-
text-align: center;
|
1378
|
-
margin-top: 10% ;
|
1379
|
-
margin-left: auto;
|
1380
|
-
margin-right: auto;
|
1381
|
-
border: 1px solid gray;
|
1382
|
-
}
|
1383
|
-
|
1384
|
-
button {
|
1385
|
-
background-color: #8CD4F5;
|
1386
|
-
color: white;
|
1387
|
-
border: none;
|
1388
|
-
box-shadow: none;
|
1389
|
-
font-size: 17px;
|
1390
|
-
font-weight: 500;
|
1391
|
-
-webkit-border-radius: 4px;
|
1392
|
-
border-radius: 5px;
|
1393
|
-
padding: 10px 32px;
|
1394
|
-
margin: 26px 5px 0 5px;
|
1395
|
-
cursor: pointer;
|
1396
|
-
}
|
1397
|
-
|
1398
|
-
button.cancel {
|
1399
|
-
background-color: #C1C1C1;
|
1400
|
-
}
|
1401
|
-
`]
|
1402
|
-
}]
|
1319
|
+
</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;border-radius:5px;padding:10px 32px;margin:26px 5px 0;cursor:pointer}button.cancel{background-color:#c1c1c1}\n"] }]
|
1403
1320
|
}], null, null);
|
1404
1321
|
})();
|
1405
1322
|
|
@@ -1629,6 +1546,7 @@ class TaskMagicService {
|
|
1629
1546
|
this.OnSelectedRowChanged = new EventEmitter();
|
1630
1547
|
this.customPropertiesSubject = new Subject();
|
1631
1548
|
this.recordsCountChangeSubject = new Subject();
|
1549
|
+
this.mgLoadSubject = new Subject();
|
1632
1550
|
this.oldPageSize = 0;
|
1633
1551
|
this.Records.setGuiTopIndex(0);
|
1634
1552
|
this.mgInputDateFormat = null;
|
@@ -1881,6 +1799,11 @@ class TaskMagicService {
|
|
1881
1799
|
}
|
1882
1800
|
}
|
1883
1801
|
break;
|
1802
|
+
case CommandType.SET_CHUNK_SIZE:
|
1803
|
+
if (!isUndefined(command.number)) {
|
1804
|
+
this.tableService.setChunkSize(command.number);
|
1805
|
+
}
|
1806
|
+
break;
|
1884
1807
|
case CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW:
|
1885
1808
|
this.updateRecordsBeforeCurrentView(command.number);
|
1886
1809
|
break;
|
@@ -1908,7 +1831,9 @@ class TaskMagicService {
|
|
1908
1831
|
break;
|
1909
1832
|
case CommandType.SET_PROPERTY:
|
1910
1833
|
this.handleSetProperty(command, isTableChild);
|
1911
|
-
if (command.Operation == HtmlProperties.ReadOnly
|
1834
|
+
if (command.Operation == HtmlProperties.ReadOnly ||
|
1835
|
+
command.Operation == HtmlProperties.ItemsList ||
|
1836
|
+
command.Operation == HtmlProperties.CheckBoxIndeterminate)
|
1912
1837
|
this.refreshDom.next(command);
|
1913
1838
|
break;
|
1914
1839
|
case CommandType.PROP_SET_USER_PROPERTY:
|
@@ -1963,6 +1888,9 @@ class TaskMagicService {
|
|
1963
1888
|
case CommandType.SET_FOCUS:
|
1964
1889
|
this.refreshDom.next(command);
|
1965
1890
|
break;
|
1891
|
+
case CommandType.SET_WC_IDLE:
|
1892
|
+
this.mgLoadSubject.next();
|
1893
|
+
break;
|
1966
1894
|
}
|
1967
1895
|
}
|
1968
1896
|
customValidator(rowid, id) {
|
@@ -2145,6 +2073,16 @@ class TaskMagicService {
|
|
2145
2073
|
if (typeof (event) == 'boolean') {
|
2146
2074
|
guiEvent.Value = event;
|
2147
2075
|
}
|
2076
|
+
else if (typeof (event) == 'string') {
|
2077
|
+
if (event == "unchecked") {
|
2078
|
+
guiEvent.Value = false;
|
2079
|
+
}
|
2080
|
+
else if (event == 'indeterminate')
|
2081
|
+
guiEvent.Value = null;
|
2082
|
+
else if (event == 'checked') {
|
2083
|
+
guiEvent.Value = true;
|
2084
|
+
}
|
2085
|
+
}
|
2148
2086
|
else {
|
2149
2087
|
if (typeof event.target === 'undefined')
|
2150
2088
|
guiEvent.Value = (event).checked;
|
@@ -2161,10 +2099,10 @@ class TaskMagicService {
|
|
2161
2099
|
mgOnRadioSelectionChanged(idx) {
|
2162
2100
|
let result = this.getFormControl('0', idx);
|
2163
2101
|
let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
|
2164
|
-
if (typeof result.value !== '
|
2102
|
+
if (typeof result.value !== 'number')
|
2165
2103
|
guiEvent.Value = result.value.index;
|
2166
2104
|
else
|
2167
|
-
guiEvent.Value = result.value;
|
2105
|
+
guiEvent.Value = result.value.toString();
|
2168
2106
|
this.insertEvent(guiEvent);
|
2169
2107
|
}
|
2170
2108
|
close() {
|
@@ -2225,7 +2163,10 @@ class TableMagicService {
|
|
2225
2163
|
refreshDataSource() {
|
2226
2164
|
}
|
2227
2165
|
getPageSize() {
|
2228
|
-
return
|
2166
|
+
return this.chunkSize;
|
2167
|
+
}
|
2168
|
+
setChunkSize(size) {
|
2169
|
+
this.chunkSize = size;
|
2229
2170
|
}
|
2230
2171
|
getMaxRowsInTable() {
|
2231
2172
|
return this.task.Records.list.length;
|
@@ -2313,6 +2254,9 @@ const SYSTEM_BG = 4;
|
|
2313
2254
|
const SYSTEM_FG_AND_SYSTEM_BG = 6;
|
2314
2255
|
const TRANSPERENT_BG = 1;
|
2315
2256
|
class MagicColorService {
|
2257
|
+
getColorFilePath() {
|
2258
|
+
return 'assets/' + this.colorFileName;
|
2259
|
+
}
|
2316
2260
|
constructor(http, colorFile1 = 'clr_rnt.eng') {
|
2317
2261
|
this.http = http;
|
2318
2262
|
this.colorFileName = 'clr_rnt.eng';
|
@@ -2322,9 +2266,6 @@ class MagicColorService {
|
|
2322
2266
|
else
|
2323
2267
|
this.colorFileName = 'clr_rnt.eng';
|
2324
2268
|
}
|
2325
|
-
getColorFilePath() {
|
2326
|
-
return 'assets/' + this.colorFileName;
|
2327
|
-
}
|
2328
2269
|
getColorData() {
|
2329
2270
|
if (!this.colorsData) {
|
2330
2271
|
this.http.get(this.getColorFilePath(), { responseType: 'text' }).subscribe(resp => {
|
@@ -2406,6 +2347,8 @@ class AccessorMagicService {
|
|
2406
2347
|
this.task = task;
|
2407
2348
|
this.magicColor = magicColor;
|
2408
2349
|
this.Logger = null;
|
2350
|
+
this.hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
|
2351
|
+
this.hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
|
2409
2352
|
this.Logger = Logger.Instance;
|
2410
2353
|
}
|
2411
2354
|
checkIsReadOnly(controlId) {
|
@@ -2641,8 +2584,30 @@ class AccessorMagicService {
|
|
2641
2584
|
let c = this.task.getFormControl(rowId, id);
|
2642
2585
|
if (c.hasError('required'))
|
2643
2586
|
return 'Control must be updated.';
|
2644
|
-
if (c.hasError('pattern'))
|
2645
|
-
|
2587
|
+
if (c.hasError('pattern')) {
|
2588
|
+
if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
|
2589
|
+
return 'Value must be non-negative';
|
2590
|
+
if (c.errors.pattern.requiredPattern.includes('.')) {
|
2591
|
+
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[0];
|
2592
|
+
const decimalFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[1];
|
2593
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2594
|
+
const actualDecimalLimit = c.errors.pattern.requiredPattern.match(/(?:[^,]+,){2}(\d+)/)[1];
|
2595
|
+
if (numericFormat.length > actualNumericLimit || decimalFormat.length > actualDecimalLimit) {
|
2596
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + actualDecimalLimit + " digits";
|
2597
|
+
}
|
2598
|
+
}
|
2599
|
+
else if (!c.errors.pattern.requiredPattern.includes('.') && !Number.isInteger(c.errors.pattern.actualValue)) {
|
2600
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2601
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
|
2602
|
+
}
|
2603
|
+
else {
|
2604
|
+
const numericFormat = Math.abs(c.errors.pattern.actualValue).toString();
|
2605
|
+
const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
|
2606
|
+
if (numericFormat.length > actualNumericLimit) {
|
2607
|
+
return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
|
2608
|
+
}
|
2609
|
+
}
|
2610
|
+
}
|
2646
2611
|
if (c.hasError('rangevalidator'))
|
2647
2612
|
return c.errors.rangevalidator.errorMsg;
|
2648
2613
|
if (c.hasError('maxlength'))
|
@@ -2782,6 +2747,9 @@ class TaskBaseMagicComponent {
|
|
2782
2747
|
this.task.recordsCountChangeSubject.pipe().subscribe(value => {
|
2783
2748
|
this.RecordsCountChanged(value);
|
2784
2749
|
});
|
2750
|
+
this.task.mgLoadSubject.pipe().subscribe(value => {
|
2751
|
+
this.mgOnLoad();
|
2752
|
+
});
|
2785
2753
|
}
|
2786
2754
|
createFormControlsAccessor(formGroup) { }
|
2787
2755
|
setInputDateFormat() { }
|
@@ -2789,11 +2757,13 @@ class TaskBaseMagicComponent {
|
|
2789
2757
|
}
|
2790
2758
|
RecordsCountChanged(recordsCount) {
|
2791
2759
|
}
|
2760
|
+
mgOnLoad() {
|
2761
|
+
}
|
2792
2762
|
ngAfterViewInit() {
|
2793
2763
|
this.mgSub.init();
|
2794
2764
|
}
|
2795
2765
|
ngAfterContentChecked() {
|
2796
|
-
if (this.task.oldPageSize != this.tableService.getPageSize()) {
|
2766
|
+
if (!isNullOrUndefined(this.tableService.getPageSize()) && this.task.oldPageSize != this.tableService.getPageSize()) {
|
2797
2767
|
this.task.resize(this.tableService.getPageSize(), 0);
|
2798
2768
|
this.task.oldPageSize = this.tableService.getPageSize();
|
2799
2769
|
}
|
@@ -2875,6 +2845,16 @@ RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, sele
|
|
2875
2845
|
})();
|
2876
2846
|
|
2877
2847
|
class MagicDirective {
|
2848
|
+
set magic(val) {
|
2849
|
+
this.id = val;
|
2850
|
+
this.selector = "magic";
|
2851
|
+
}
|
2852
|
+
;
|
2853
|
+
set eventsOnly(val) {
|
2854
|
+
console.log("eventsOnly");
|
2855
|
+
this.eventsOnlyVal = true;
|
2856
|
+
}
|
2857
|
+
;
|
2878
2858
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
2879
2859
|
this._task = _task;
|
2880
2860
|
this.element = element;
|
@@ -2887,16 +2867,6 @@ class MagicDirective {
|
|
2887
2867
|
if (!(typeof magicRow === "undefined" || magicRow === null))
|
2888
2868
|
this.rowId = magicRow.rowId;
|
2889
2869
|
}
|
2890
|
-
set magic(val) {
|
2891
|
-
this.id = val;
|
2892
|
-
this.selector = "magic";
|
2893
|
-
}
|
2894
|
-
;
|
2895
|
-
set eventsOnly(val) {
|
2896
|
-
console.log("eventsOnly");
|
2897
|
-
this.eventsOnlyVal = true;
|
2898
|
-
}
|
2899
|
-
;
|
2900
2870
|
get task() {
|
2901
2871
|
return this._task;
|
2902
2872
|
}
|
@@ -3076,11 +3046,11 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
|
|
3076
3046
|
})();
|
3077
3047
|
|
3078
3048
|
class NoControlMagicDirective extends MagicDirective {
|
3049
|
+
set magic(val) { this.id = val; this.selector = 'magicnc'; }
|
3050
|
+
;
|
3079
3051
|
constructor(_task, element, renderer, vcRef, magicRow) {
|
3080
3052
|
super(_task, element, renderer, vcRef, magicRow);
|
3081
3053
|
}
|
3082
|
-
set magic(val) { this.id = val; this.selector = 'magicnc'; }
|
3083
|
-
;
|
3084
3054
|
regEvents() {
|
3085
3055
|
super.regEvents();
|
3086
3056
|
if (this.htmlElement instanceof HTMLSelectElement) {
|
@@ -3363,6 +3333,7 @@ class MgformatMagicDirective {
|
|
3363
3333
|
constructor(magicDir, _task) {
|
3364
3334
|
this.magicDir = magicDir;
|
3365
3335
|
this._task = _task;
|
3336
|
+
this.datePasteFlag = false;
|
3366
3337
|
}
|
3367
3338
|
ngAfterViewInit() {
|
3368
3339
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
@@ -3376,9 +3347,170 @@ class MgformatMagicDirective {
|
|
3376
3347
|
onFocusEvent($event) {
|
3377
3348
|
this.calculatePattern();
|
3378
3349
|
}
|
3379
|
-
|
3350
|
+
onPaste(event) {
|
3351
|
+
this.datePasteFlag = true;
|
3352
|
+
}
|
3353
|
+
onInputEvent(event) {
|
3354
|
+
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
3355
|
+
if (attr == StorageAttribute.DATE) {
|
3356
|
+
if (!this.datePasteFlag)
|
3357
|
+
this.dateMasking(event);
|
3358
|
+
this.datePasteFlag = false;
|
3359
|
+
}
|
3380
3360
|
this.calculatePattern();
|
3381
3361
|
}
|
3362
|
+
dateMasking(event) {
|
3363
|
+
const input = event.target;
|
3364
|
+
let cursorPos = event.target.selectionStart;
|
3365
|
+
const separator = this._task.mgInputDateFormat.includes('/') ? '/' : '-';
|
3366
|
+
if (cursorPos >= input.value.length) {
|
3367
|
+
const value = input.value.replace(/[^a-zA-Z0-9/-]/g, '');
|
3368
|
+
if (this._task.mgInputDateFormat == "dd/MM/yyyy" || this._task.mgInputDateFormat == "MM/dd/yyyy" || this._task.mgInputDateFormat == "dd-MM-yyyy" || this._task.mgInputDateFormat == "MM-dd-yyyy") {
|
3369
|
+
if (value.length == 1 && value[0] == separator)
|
3370
|
+
input.value = '01' + separator;
|
3371
|
+
else if (value.length == 2 && value[1] == separator)
|
3372
|
+
input.value = 0 + value;
|
3373
|
+
else if (value.length == 3 && value[2] != separator)
|
3374
|
+
input.value = value.slice(0, 2) + separator + value.slice(2);
|
3375
|
+
else if (value.length == 4 && value[3] == separator)
|
3376
|
+
input.value = value.slice(0, 3) + '01' + value.slice(3);
|
3377
|
+
else if (value.length == 5 && value[4] == separator)
|
3378
|
+
input.value = value.slice(0, 3) + '0' + value.slice(3);
|
3379
|
+
else if (value.length == 6 && value[5] != separator)
|
3380
|
+
input.value = value.slice(0, 5) + separator + value.slice(5);
|
3381
|
+
else if (value.length >= 10)
|
3382
|
+
input.value = value.slice(0, 10);
|
3383
|
+
}
|
3384
|
+
else if (this._task.mgInputDateFormat == "yyyy/MM/dd" || this._task.mgInputDateFormat == "yyyy/dd/MM" || this._task.mgInputDateFormat == "yyyy-MM-dd" || this._task.mgInputDateFormat == "yyyy-dd-MM") {
|
3385
|
+
if (value.length == 1 && value[0] == separator)
|
3386
|
+
input.value = '0000' + separator;
|
3387
|
+
else if (value.length == 2 && value[1] == separator)
|
3388
|
+
input.value = '000' + value.slice(0);
|
3389
|
+
else if (value.length == 3 && value[2] == separator)
|
3390
|
+
input.value = '00' + value.slice(0);
|
3391
|
+
else if (value.length == 4 && value[3] == separator)
|
3392
|
+
input.value = '0' + value.slice(0);
|
3393
|
+
else if (value.length == 5 && value[4] != separator)
|
3394
|
+
input.value = value.slice(0, 4) + separator + value.slice(4);
|
3395
|
+
else if (value.length == 6 && value[5] == separator)
|
3396
|
+
input.value = value.slice(0, 5) + '01' + value.slice(5);
|
3397
|
+
else if (value.length == 7 && value[6] == separator)
|
3398
|
+
input.value = value.slice(0, 5) + '0' + value.slice(5);
|
3399
|
+
else if (value.length == 8 && value[7] != separator)
|
3400
|
+
input.value = value.slice(0, 7) + separator + value.slice(7);
|
3401
|
+
else if (value.length >= 10)
|
3402
|
+
input.value = value.slice(0, 10);
|
3403
|
+
}
|
3404
|
+
else if (this._task.mgInputDateFormat == "dd/MM/yy" || this._task.mgInputDateFormat == "yy/MM/dd" || this._task.mgInputDateFormat == "MM/dd/yy" || this._task.mgInputDateFormat == "yy/dd/MM" || this._task.mgInputDateFormat == "dd-MM-yy" || this._task.mgInputDateFormat == "yy-MM-dd" || this._task.mgInputDateFormat == "MM-dd-yy" || this._task.mgInputDateFormat == "yy-dd-MM") {
|
3405
|
+
if (value.length == 1 && value[0] == separator)
|
3406
|
+
input.value = '01' + separator;
|
3407
|
+
else if (value.length == 2 && value[1] == separator)
|
3408
|
+
input.value = 0 + value;
|
3409
|
+
else if (value.length == 3 && value[2] != separator)
|
3410
|
+
input.value = value.slice(0, 2) + separator + value.slice(2);
|
3411
|
+
else if (value.length == 4 && value[3] == separator)
|
3412
|
+
input.value = value.slice(0, 3) + '01' + value.slice(3);
|
3413
|
+
else if (value.length == 5 && value[4] == separator)
|
3414
|
+
input.value = value.slice(0, 3) + '0' + value.slice(3);
|
3415
|
+
else if (value.length == 6 && value[5] != separator)
|
3416
|
+
input.value = value.slice(0, 5) + separator + value.slice(5);
|
3417
|
+
else if (value.length >= 8)
|
3418
|
+
input.value = value.slice(0, 8);
|
3419
|
+
}
|
3420
|
+
else if (this._task.mgInputDateFormat == "dd/MMM/yy" || this._task.mgInputDateFormat == "dd-MMM-yy") {
|
3421
|
+
if (value.length == 1 && value[0] == separator)
|
3422
|
+
input.value = '01' + separator;
|
3423
|
+
else if (value.length == 2 && value[1] == separator)
|
3424
|
+
input.value = 0 + value;
|
3425
|
+
else if (value.length == 3 && value[2] != separator)
|
3426
|
+
input.value = value.slice(0, 2) + separator + value.slice(2);
|
3427
|
+
else if (value.length == 7 && value[6] != separator)
|
3428
|
+
input.value = value.slice(0, 6) + separator + value.slice(6);
|
3429
|
+
else if (value.length >= 9)
|
3430
|
+
input.value = value.slice(0, 9);
|
3431
|
+
}
|
3432
|
+
else if (this._task.mgInputDateFormat == "dd/MMM/yyyy" || this._task.mgInputDateFormat == "dd-MMM-yyyy") {
|
3433
|
+
if (value.length == 1 && value[0] == separator)
|
3434
|
+
input.value = '01' + separator;
|
3435
|
+
else if (value.length == 2 && value[1] == separator)
|
3436
|
+
input.value = 0 + value;
|
3437
|
+
else if (value.length == 3 && value[2] != separator)
|
3438
|
+
input.value = value.slice(0, 2) + separator + value.slice(2);
|
3439
|
+
else if (value.length == 7 && value[6] != separator)
|
3440
|
+
input.value = value.slice(0, 6) + separator + value.slice(6);
|
3441
|
+
else if (value.length >= 11)
|
3442
|
+
input.value = value.slice(0, 11);
|
3443
|
+
}
|
3444
|
+
else if (this._task.mgInputDateFormat == "yy/dd/MMM" || this._task.mgInputDateFormat == "yy-dd-MMM") {
|
3445
|
+
if (value.length == 1 && value[0] == separator)
|
3446
|
+
input.value = '00' + separator;
|
3447
|
+
else if (value.length == 2 && value[1] == separator)
|
3448
|
+
input.value = 0 + value;
|
3449
|
+
else if (value.length == 3 && value[2] != separator)
|
3450
|
+
input.value = value.slice(0, 2) + separator + value.slice(2);
|
3451
|
+
else if (value.length == 4 && value[3] == separator)
|
3452
|
+
input.value = value.slice(0, 3) + '01' + value.slice(3);
|
3453
|
+
else if (value.length == 5 && value[4] == separator)
|
3454
|
+
input.value = value.slice(0, 3) + '0' + value.slice(3);
|
3455
|
+
else if (value.length == 6 && value[5] != separator)
|
3456
|
+
input.value = value.slice(0, 5) + separator + value.slice(5);
|
3457
|
+
else if (value.length >= 9)
|
3458
|
+
input.value = value.slice(0, 9);
|
3459
|
+
}
|
3460
|
+
else if (this._task.mgInputDateFormat == "yyyy/dd/MMM" || this._task.mgInputDateFormat == "yyyy-dd-MMM") {
|
3461
|
+
if (value.length == 1 && value[0] == separator)
|
3462
|
+
input.value = '0000' + separator;
|
3463
|
+
else if (value.length == 2 && value[1] == separator)
|
3464
|
+
input.value = '000' + value.slice(0);
|
3465
|
+
else if (value.length == 3 && value[2] == separator)
|
3466
|
+
input.value = '00' + value.slice(0);
|
3467
|
+
else if (value.length == 4 && value[3] == separator)
|
3468
|
+
input.value = '0' + value.slice(0);
|
3469
|
+
else if (value.length == 5 && value[4] != separator)
|
3470
|
+
input.value = value.slice(0, 4) + separator + value.slice(4);
|
3471
|
+
else if (value.length == 6 && value[5] == separator)
|
3472
|
+
input.value = value.slice(0, 5) + '01' + value.slice(5);
|
3473
|
+
else if (value.length == 7 && value[6] == separator)
|
3474
|
+
input.value = value.slice(0, 5) + '0' + value.slice(5);
|
3475
|
+
else if (value.length == 8 && value[7] != separator)
|
3476
|
+
input.value = value.slice(0, 7) + separator + value.slice(7);
|
3477
|
+
else if (value.length >= 11)
|
3478
|
+
input.value = value.slice(0, 11);
|
3479
|
+
}
|
3480
|
+
else if (this._task.mgInputDateFormat == "MMM/dd/yy" || this._task.mgInputDateFormat == "MMM-dd-yy") {
|
3481
|
+
if (value.length == 4 && value[3] != separator)
|
3482
|
+
input.value = value.slice(0, 3) + separator + value.slice(3);
|
3483
|
+
else if (value.length == 5 && value[4] == separator)
|
3484
|
+
input.value = value.slice(0, 4) + '01' + value.slice(4);
|
3485
|
+
else if (value.length == 6 && value[5] == separator)
|
3486
|
+
input.value = value.slice(0, 4) + '0' + value.slice(4);
|
3487
|
+
else if (value.length == 7 && value[6] != separator)
|
3488
|
+
input.value = value.slice(0, 6) + separator + value.slice(6);
|
3489
|
+
else if (value.length >= 9)
|
3490
|
+
input.value = value.slice(0, 9);
|
3491
|
+
}
|
3492
|
+
else if (this._task.mgInputDateFormat == "MMM/dd/yyyy" || this._task.mgInputDateFormat == "MMM-dd-yyyy") {
|
3493
|
+
if (value.length == 4 && value[3] != separator)
|
3494
|
+
input.value = value.slice(0, 3) + separator + value.slice(3);
|
3495
|
+
else if (value.length == 5 && value[4] == separator)
|
3496
|
+
input.value = value.slice(0, 4) + '01' + value.slice(4);
|
3497
|
+
else if (value.length == 6 && value[5] == separator)
|
3498
|
+
input.value = value.slice(0, 4) + '0' + value.slice(4);
|
3499
|
+
else if (value.length == 7 && value[6] != separator)
|
3500
|
+
input.value = value.slice(0, 6) + separator + value.slice(6);
|
3501
|
+
else if (value.length >= 11)
|
3502
|
+
input.value = value.slice(0, 11);
|
3503
|
+
}
|
3504
|
+
}
|
3505
|
+
if (cursorPos < input.value.length && input.value.length > this._task.mgInputDateFormat.length) {
|
3506
|
+
let inputDate = input.value;
|
3507
|
+
let start = input.selectionStart - 1;
|
3508
|
+
let end = input.selectionEnd - 1;
|
3509
|
+
let indexToRemove = input.selectionStart - 1;
|
3510
|
+
input.value = inputDate.slice(0, indexToRemove) + inputDate.slice(indexToRemove + 1);
|
3511
|
+
input.setSelectionRange(start, end);
|
3512
|
+
}
|
3513
|
+
}
|
3382
3514
|
onChangeEvent($event) {
|
3383
3515
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3384
3516
|
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
@@ -3392,6 +3524,170 @@ class MgformatMagicDirective {
|
|
3392
3524
|
break;
|
3393
3525
|
}
|
3394
3526
|
}
|
3527
|
+
onBlurEvent(event) {
|
3528
|
+
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3529
|
+
let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
|
3530
|
+
const century = Environment.Instance.GetCentury(LastFocusedManager.Instance.getCurrTask().getCompIdx());
|
3531
|
+
if (attr == StorageAttribute.DATE)
|
3532
|
+
this.formatDateWithCentury(event.target.value, century, control);
|
3533
|
+
}
|
3534
|
+
formatDateWithCentury(userInput, century, control) {
|
3535
|
+
const dateFormat = this._task.mgInputDateFormat;
|
3536
|
+
const separator = userInput.includes('/') ? '/' : "-";
|
3537
|
+
let centuryVal = parseInt(century.toString().slice(0, 2));
|
3538
|
+
if (userInput.length == 0)
|
3539
|
+
return;
|
3540
|
+
if ((dateFormat == 'dd/MMM/yyyy' || dateFormat == 'dd-MMM-yyyy')) {
|
3541
|
+
const dateArray = userInput.split(separator);
|
3542
|
+
const [day, month, year] = this.getDateSegments1(dateArray);
|
3543
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3544
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3545
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3546
|
+
}
|
3547
|
+
}
|
3548
|
+
else if ((dateFormat == 'dd/MM/yyyy' || dateFormat == 'dd-MM-yyyy' || dateFormat == 'd/M/yyyy' || dateFormat == 'd-M-yyyy')) {
|
3549
|
+
const dateArray = userInput.split(separator);
|
3550
|
+
const [day, month, year] = this.getDateSegments1(dateArray);
|
3551
|
+
if ((day < 32 && month < 13)) {
|
3552
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3553
|
+
}
|
3554
|
+
}
|
3555
|
+
else if ((dateFormat == 'MM/dd/yyyy' || dateFormat == 'MM-dd-yyyy' || dateFormat == 'M/d/yyyy' || dateFormat == 'M-d-yyyy')) {
|
3556
|
+
const dateArray = userInput.split(separator);
|
3557
|
+
const [day, month, year] = this.getDateSegments2(dateArray);
|
3558
|
+
if ((day < 32 && month < 13)) {
|
3559
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3560
|
+
}
|
3561
|
+
}
|
3562
|
+
else if ((dateFormat == 'MMM/dd/yyyy' || dateFormat == 'MMM-dd-yyyy')) {
|
3563
|
+
const dateArray = userInput.split(separator);
|
3564
|
+
const [day, month, year] = this.getDateSegments2(dateArray);
|
3565
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3566
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3567
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3568
|
+
}
|
3569
|
+
}
|
3570
|
+
else if ((dateFormat == 'yyyy/MM/dd' || dateFormat == 'yyyy-MM-dd')) {
|
3571
|
+
const dateArray = userInput.split(separator);
|
3572
|
+
const [day, month, year] = this.getDateSegments3(dateArray);
|
3573
|
+
if ((day < 32 && month < 13)) {
|
3574
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3575
|
+
}
|
3576
|
+
}
|
3577
|
+
else if ((dateFormat == 'yyyy/dd/MM' || dateFormat == 'yyyy-dd-MM')) {
|
3578
|
+
const dateArray = userInput.split(separator);
|
3579
|
+
const [day, month, year] = this.getDateSegments4(dateArray);
|
3580
|
+
if ((day < 32 && month < 13)) {
|
3581
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3582
|
+
}
|
3583
|
+
}
|
3584
|
+
else if ((dateFormat == 'yyyy/dd/MMM' || dateFormat == 'yyyy-dd-MMM')) {
|
3585
|
+
const dateArray = userInput.split(separator);
|
3586
|
+
const [day, month, year] = this.getDateSegments4(dateArray);
|
3587
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3588
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3589
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3590
|
+
}
|
3591
|
+
}
|
3592
|
+
else if ((dateFormat == 'dd/MM/yy' || dateFormat == 'dd-MM-yy' || dateFormat == 'd/M/yy' || dateFormat == 'd-M-yy')) {
|
3593
|
+
const dateArray = userInput.split(separator);
|
3594
|
+
const [day, month, year] = this.getDateSegments1(dateArray);
|
3595
|
+
if ((day < 32 && month < 13)) {
|
3596
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3597
|
+
}
|
3598
|
+
}
|
3599
|
+
else if ((dateFormat == 'MM/dd/yy' || dateFormat == 'MM-dd-yy' || dateFormat == 'M/d/yy' || dateFormat == 'M-d-yy')) {
|
3600
|
+
const dateArray = userInput.split(separator);
|
3601
|
+
const [day, month, year] = this.getDateSegments2(dateArray);
|
3602
|
+
if ((day < 32 && month < 13)) {
|
3603
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3604
|
+
}
|
3605
|
+
}
|
3606
|
+
else if ((dateFormat == 'yy/MM/dd' || dateFormat == 'yy-MM-dd')) {
|
3607
|
+
const dateArray = userInput.split(separator);
|
3608
|
+
const [day, month, year] = this.getDateSegments3(dateArray);
|
3609
|
+
if ((day < 32 && month < 13)) {
|
3610
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3611
|
+
}
|
3612
|
+
}
|
3613
|
+
else if ((dateFormat == 'yy/dd/MM' || dateFormat == 'yy-dd-MM')) {
|
3614
|
+
const dateArray = userInput.split(separator);
|
3615
|
+
const [day, month, year] = this.getDateSegments4(dateArray);
|
3616
|
+
if ((day < 32 && month < 13)) {
|
3617
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3618
|
+
}
|
3619
|
+
}
|
3620
|
+
else if ((dateFormat == 'dd/MMM/yy' || dateFormat == 'dd-MMM-yy')) {
|
3621
|
+
const dateArray = userInput.split(separator);
|
3622
|
+
const [day, month, year] = this.getDateSegments1(dateArray);
|
3623
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3624
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3625
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3626
|
+
}
|
3627
|
+
}
|
3628
|
+
else if ((dateFormat == 'yy/dd/MMM' || dateFormat == 'yy-dd-MMM')) {
|
3629
|
+
const dateArray = userInput.split(separator);
|
3630
|
+
const [day, month, year] = this.getDateSegments4(dateArray);
|
3631
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3632
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3633
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3634
|
+
}
|
3635
|
+
}
|
3636
|
+
else if ((dateFormat == 'MMM/dd/yy' || dateFormat == 'MMM-dd-yy')) {
|
3637
|
+
const dateArray = userInput.split(separator);
|
3638
|
+
const [day, month, year] = this.getDateSegments2(dateArray);
|
3639
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3640
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3641
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3642
|
+
}
|
3643
|
+
}
|
3644
|
+
else if ((dateFormat == 'yyyy/MMM/dd' || dateFormat == 'yyyy-MMM-dd' || dateFormat == 'yy/MMM/dd' || dateFormat == 'yy-MMM-dd')) {
|
3645
|
+
const dateArray = userInput.split(separator);
|
3646
|
+
const [day, month, year] = this.getDateSegments3(dateArray);
|
3647
|
+
const isMonthInNumber = !isNaN(Number(month));
|
3648
|
+
if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
|
3649
|
+
this.updateYear(day, month, year, separator, century, centuryVal, control);
|
3650
|
+
}
|
3651
|
+
}
|
3652
|
+
else if (dateFormat == 'yyyy/MM' || dateFormat == 'yyyy-MM') {
|
3653
|
+
const dateArray = userInput.split(separator);
|
3654
|
+
const month = dateArray[1];
|
3655
|
+
const year = Number(dateArray[0]);
|
3656
|
+
if (Number(month) < 13) {
|
3657
|
+
this.updateYear(1, month, year, separator, century, centuryVal, control);
|
3658
|
+
}
|
3659
|
+
}
|
3660
|
+
}
|
3661
|
+
updateYear(day, month, year, separator, century, centuryVal, control) {
|
3662
|
+
let updatedYear = year.toString().length === 2 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '' + year :
|
3663
|
+
year.toString().length === 1 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '0' + year :
|
3664
|
+
year;
|
3665
|
+
control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
|
3666
|
+
}
|
3667
|
+
getDateSegments1(dateArray) {
|
3668
|
+
const day = Number(dateArray[0]);
|
3669
|
+
const month = dateArray[1];
|
3670
|
+
const year = Number(dateArray[2]);
|
3671
|
+
return [day, month, year];
|
3672
|
+
}
|
3673
|
+
getDateSegments2(dateArray) {
|
3674
|
+
const day = Number(dateArray[1]);
|
3675
|
+
const month = dateArray[0];
|
3676
|
+
const year = Number(dateArray[2]);
|
3677
|
+
return [day, month, year];
|
3678
|
+
}
|
3679
|
+
getDateSegments3(dateArray) {
|
3680
|
+
const day = Number(dateArray[2]);
|
3681
|
+
const month = dateArray[1];
|
3682
|
+
const year = Number(dateArray[0]);
|
3683
|
+
return [day, month, year];
|
3684
|
+
}
|
3685
|
+
getDateSegments4(dateArray) {
|
3686
|
+
const day = Number(dateArray[1]);
|
3687
|
+
const month = dateArray[2];
|
3688
|
+
const year = Number(dateArray[0]);
|
3689
|
+
return [day, month, year];
|
3690
|
+
}
|
3395
3691
|
calculatePattern() {
|
3396
3692
|
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
3397
3693
|
if (control != null) {
|
@@ -3574,7 +3870,7 @@ class MgformatMagicDirective {
|
|
3574
3870
|
MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
3575
3871
|
MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
|
3576
3872
|
if (rf & 1) {
|
3577
|
-
i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("input", function MgformatMagicDirective_input_HostBindingHandler($event) { return ctx.onInputEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
|
3873
|
+
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); });
|
3578
3874
|
}
|
3579
3875
|
} });
|
3580
3876
|
(function () {
|
@@ -3586,12 +3882,18 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
|
|
3586
3882
|
}], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
|
3587
3883
|
type: HostListener,
|
3588
3884
|
args: ['focus', ['$event']]
|
3885
|
+
}], onPaste: [{
|
3886
|
+
type: HostListener,
|
3887
|
+
args: ['paste', ['$event']]
|
3589
3888
|
}], onInputEvent: [{
|
3590
3889
|
type: HostListener,
|
3591
3890
|
args: ['input', ['$event']]
|
3592
3891
|
}], onChangeEvent: [{
|
3593
3892
|
type: HostListener,
|
3594
3893
|
args: ['change', ['$event']]
|
3894
|
+
}], onBlurEvent: [{
|
3895
|
+
type: HostListener,
|
3896
|
+
args: ['blur', ['$event']]
|
3595
3897
|
}] });
|
3596
3898
|
})();
|
3597
3899
|
|
@@ -3706,14 +4008,14 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) {
|
|
3706
4008
|
}
|
3707
4009
|
}
|
3708
4010
|
class SubformMagicComponent {
|
4011
|
+
set magic(val) { this.id = val; }
|
4012
|
+
;
|
3709
4013
|
constructor(vcRef, mgSub) {
|
3710
4014
|
this.vcRef = vcRef;
|
3711
4015
|
this.mgSub = mgSub;
|
3712
4016
|
this.component = null;
|
3713
4017
|
this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
|
3714
4018
|
}
|
3715
|
-
set magic(val) { this.id = val; }
|
3716
|
-
;
|
3717
4019
|
get Component() {
|
3718
4020
|
return this.mgSub.mgGetComp(this.id);
|
3719
4021
|
}
|
@@ -3729,7 +4031,7 @@ SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicCompone
|
|
3729
4031
|
if (rf & 2) {
|
3730
4032
|
i0.ɵɵproperty("ngIf", ctx.Component);
|
3731
4033
|
}
|
3732
|
-
},
|
4034
|
+
}, dependencies: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
|
3733
4035
|
(function () {
|
3734
4036
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicComponent, [{
|
3735
4037
|
type: Component,
|
@@ -3778,13 +4080,6 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) {
|
|
3778
4080
|
}
|
3779
4081
|
const _c1 = ["*"];
|
3780
4082
|
class ErrorMagicComponent {
|
3781
|
-
constructor(_task, mgService, changeDetectorRef) {
|
3782
|
-
this._task = _task;
|
3783
|
-
this.mgService = mgService;
|
3784
|
-
this.changeDetectorRef = changeDetectorRef;
|
3785
|
-
this.defaultDisplay = true;
|
3786
|
-
this.rowId = "0";
|
3787
|
-
}
|
3788
4083
|
set magic(val) {
|
3789
4084
|
this.id = val;
|
3790
4085
|
}
|
@@ -3798,6 +4093,13 @@ class ErrorMagicComponent {
|
|
3798
4093
|
this.changeDetectorRef.detectChanges();
|
3799
4094
|
}
|
3800
4095
|
;
|
4096
|
+
constructor(_task, mgService, changeDetectorRef) {
|
4097
|
+
this._task = _task;
|
4098
|
+
this.mgService = mgService;
|
4099
|
+
this.changeDetectorRef = changeDetectorRef;
|
4100
|
+
this.defaultDisplay = true;
|
4101
|
+
this.rowId = "0";
|
4102
|
+
}
|
3801
4103
|
isEmpty(element) {
|
3802
4104
|
const nodes = element.childNodes;
|
3803
4105
|
for (let i = 0; i < nodes.length; i++) {
|
@@ -3846,7 +4148,7 @@ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent,
|
|
3846
4148
|
if (rf & 2) {
|
3847
4149
|
i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
|
3848
4150
|
}
|
3849
|
-
},
|
4151
|
+
}, dependencies: [i1.NgIf], encapsulation: 2 });
|
3850
4152
|
(function () {
|
3851
4153
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorMagicComponent, [{
|
3852
4154
|
type: Component,
|
@@ -3875,19 +4177,81 @@ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent,
|
|
3875
4177
|
})();
|
3876
4178
|
|
3877
4179
|
class CheckboxMagicDirective {
|
3878
|
-
constructor(magicDirective) {
|
4180
|
+
constructor(magicDirective, el, task) {
|
3879
4181
|
this.magicDirective = magicDirective;
|
4182
|
+
this.el = el;
|
4183
|
+
this.task = task;
|
4184
|
+
this.threeState = false;
|
4185
|
+
this.subscribeRefreshDom = null;
|
4186
|
+
this.isIndeterminate = false;
|
3880
4187
|
}
|
3881
4188
|
onChange($event) {
|
3882
|
-
|
4189
|
+
if (this.threeState) {
|
4190
|
+
this.handleThreeState();
|
4191
|
+
}
|
4192
|
+
else {
|
4193
|
+
this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
4194
|
+
}
|
4195
|
+
}
|
4196
|
+
ngOnInit() {
|
4197
|
+
if (this.threeState) {
|
4198
|
+
let guiEvent = getGuiEventObj("setAsThreeState", this.magicDirective.id, +this.magicDirective.rowId);
|
4199
|
+
this.task.insertEvent(guiEvent);
|
4200
|
+
this.el.nativeElement.indeterminate = this.isIndeterminate = this.task.getProperty(this.magicDirective.id, HtmlProperties.CheckBoxIndeterminate, this.magicDirective.rowId);
|
4201
|
+
this.regUpdatesUI();
|
4202
|
+
}
|
4203
|
+
}
|
4204
|
+
regUpdatesUI() {
|
4205
|
+
this.subscribeRefreshDom = this.task
|
4206
|
+
.refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c)))
|
4207
|
+
.subscribe(a => {
|
4208
|
+
let command = a;
|
4209
|
+
try {
|
4210
|
+
this.handleCommand(command);
|
4211
|
+
}
|
4212
|
+
catch (ex) {
|
4213
|
+
console.dir(ex);
|
4214
|
+
}
|
4215
|
+
});
|
4216
|
+
}
|
4217
|
+
handleCommand(command) {
|
4218
|
+
if (command.CommandType == CommandType.SET_PROPERTY &&
|
4219
|
+
command.Operation == HtmlProperties.CheckBoxIndeterminate) {
|
4220
|
+
this.isIndeterminate = this.el.nativeElement.indeterminate = command.obj1;
|
4221
|
+
}
|
4222
|
+
}
|
4223
|
+
handleThreeState() {
|
4224
|
+
let value = '';
|
4225
|
+
let prevCheckedValue = this.task.getValue(this.magicDirective.id, this.magicDirective.rowId);
|
4226
|
+
const checkbox = this.el.nativeElement;
|
4227
|
+
if (this.isIndeterminate) {
|
4228
|
+
checkbox.checked = false;
|
4229
|
+
checkbox.indeterminate = false;
|
4230
|
+
value = 'unchecked';
|
4231
|
+
}
|
4232
|
+
else if (prevCheckedValue) {
|
4233
|
+
checkbox.checked = false;
|
4234
|
+
checkbox.indeterminate = true;
|
4235
|
+
value = 'indeterminate';
|
4236
|
+
}
|
4237
|
+
else if (!prevCheckedValue) {
|
4238
|
+
checkbox.checked = true;
|
4239
|
+
checkbox.indeterminate = false;
|
4240
|
+
value = 'checked';
|
4241
|
+
}
|
4242
|
+
this.magicDirective.task.onCheckChanged(value, this.magicDirective.id, +this.magicDirective.rowId);
|
4243
|
+
}
|
4244
|
+
ngOnDestroy() {
|
4245
|
+
if (this.subscribeRefreshDom !== null)
|
4246
|
+
this.subscribeRefreshDom.unsubscribe();
|
3883
4247
|
}
|
3884
4248
|
}
|
3885
|
-
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
4249
|
+
CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
3886
4250
|
CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) {
|
3887
4251
|
if (rf & 1) {
|
3888
4252
|
i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
|
3889
4253
|
}
|
3890
|
-
} });
|
4254
|
+
}, inputs: { threeState: "threeState" } });
|
3891
4255
|
(function () {
|
3892
4256
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
|
3893
4257
|
type: Directive,
|
@@ -3896,7 +4260,9 @@ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirec
|
|
3896
4260
|
input[type=checkbox][magic]:not([noFormControl])
|
3897
4261
|
`,
|
3898
4262
|
}]
|
3899
|
-
}], function () { return [{ type: MagicDirective }]; }, {
|
4263
|
+
}], function () { return [{ type: MagicDirective }, { type: i0.ElementRef }, { type: TaskMagicService }]; }, { threeState: [{
|
4264
|
+
type: Input
|
4265
|
+
}], onChange: [{
|
3900
4266
|
type: HostListener,
|
3901
4267
|
args: ['change', ['$event']]
|
3902
4268
|
}] });
|
@@ -3905,10 +4271,18 @@ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirec
|
|
3905
4271
|
class ComboboxMagicDirective {
|
3906
4272
|
constructor(magicDirective) {
|
3907
4273
|
this.magicDirective = magicDirective;
|
4274
|
+
this.magicDirective.task.refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c))).subscribe(value => {
|
4275
|
+
let command = value;
|
4276
|
+
if (command.Operation === HtmlProperties.ItemsList)
|
4277
|
+
this.onComboboxItemsListChanged();
|
4278
|
+
});
|
3908
4279
|
}
|
3909
4280
|
onChange($event) {
|
3910
4281
|
this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
|
3911
4282
|
}
|
4283
|
+
onComboboxItemsListChanged() {
|
4284
|
+
this.magicDirective.task.refreshView();
|
4285
|
+
}
|
3912
4286
|
}
|
3913
4287
|
ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
|
3914
4288
|
ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) {
|
@@ -4100,14 +4474,11 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
|
|
4100
4474
|
i0.ɵɵadvance(3);
|
4101
4475
|
i0.ɵɵproperty("ngIf", ctx.showSpinner);
|
4102
4476
|
}
|
4103
|
-
},
|
4477
|
+
}, dependencies: [i1.NgIf, i1.NgTemplateOutlet, i3.DynamicComponent, i3.DynamicIoDirective, MagicViewContainerRef], styles: [".mgSpinnerClass[_ngcontent-%COMP%]{border:10px solid #cccccc;border-top:10px solid black;border-radius:50%;position:fixed;margin:auto;inset:0;width:100px;height:100px;animation:_ngcontent-%COMP%_spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"] });
|
4104
4478
|
(function () {
|
4105
4479
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
|
4106
4480
|
type: Component,
|
4107
|
-
args: [{
|
4108
|
-
selector: 'magic-root',
|
4109
|
-
providers: [],
|
4110
|
-
template: `
|
4481
|
+
args: [{ selector: 'magic-root', providers: [], template: `
|
4111
4482
|
<div #magicRoot>
|
4112
4483
|
<ndc-dynamic
|
4113
4484
|
*ngIf = "RootComponent !== null"
|
@@ -4126,38 +4497,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
|
|
4126
4497
|
<ng-template #defaultSpinner>
|
4127
4498
|
<div class="mgSpinnerClass"></div>
|
4128
4499
|
</ng-template>
|
4129
|
-
`,
|
4130
|
-
styles: [`
|
4131
|
-
.mgSpinnerClass {
|
4132
|
-
border: 10px solid #cccccc; /* Light grey */
|
4133
|
-
border-top: 10px solid black; /* Blue */
|
4134
|
-
border-radius: 50%;
|
4135
|
-
position: fixed;
|
4136
|
-
margin: auto;
|
4137
|
-
top: 0;
|
4138
|
-
right: 0;
|
4139
|
-
bottom: 0;
|
4140
|
-
left: 0;
|
4141
|
-
width: 100px;
|
4142
|
-
height: 100px;
|
4143
|
-
animation: spin 2s linear infinite;
|
4144
|
-
}
|
4145
|
-
.spinner-background {
|
4146
|
-
/* background fixed across whole screen */
|
4147
|
-
position: fixed;
|
4148
|
-
top: 0;
|
4149
|
-
right: 0;
|
4150
|
-
bottom: 0;
|
4151
|
-
z-index: 1000;
|
4152
|
-
left: 0;
|
4153
|
-
opacity: 0.5;
|
4154
|
-
}
|
4155
|
-
@keyframes spin {
|
4156
|
-
0% { transform: rotate(0deg); }
|
4157
|
-
100% { transform: rotate(360deg); }
|
4158
|
-
}
|
4159
|
-
`]
|
4160
|
-
}]
|
4500
|
+
`, 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"] }]
|
4161
4501
|
}], function () {
|
4162
4502
|
return [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: ExitMagicService, decorators: [{
|
4163
4503
|
type: Optional
|
@@ -4298,12 +4638,33 @@ const DATE_VALUE_ACCESSOR = {
|
|
4298
4638
|
multi: true
|
4299
4639
|
};
|
4300
4640
|
class DateValueAccessor {
|
4301
|
-
|
4641
|
+
onBlurEvent(event) {
|
4642
|
+
const century = Environment.Instance.GetCentury(LastFocusedManager.Instance.getCurrTask().getCompIdx());
|
4643
|
+
let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
|
4644
|
+
this.formatDateWithCentury(event.target.value, century, control);
|
4645
|
+
}
|
4646
|
+
constructor(renderer, elementRef, magicDir, _task) {
|
4302
4647
|
this.renderer = renderer;
|
4303
4648
|
this.elementRef = elementRef;
|
4649
|
+
this.magicDir = magicDir;
|
4650
|
+
this._task = _task;
|
4304
4651
|
this.onChange = (_) => { };
|
4305
4652
|
this.onTouched = () => { };
|
4306
4653
|
}
|
4654
|
+
formatDateWithCentury(userInput, century, control) {
|
4655
|
+
const separator = userInput.includes('/') ? '/' : "-";
|
4656
|
+
let centuryVal = parseInt(century.toString().slice(0, 2));
|
4657
|
+
if (userInput.length == 0)
|
4658
|
+
return;
|
4659
|
+
const dateArray = userInput.split(separator);
|
4660
|
+
const day = Number(dateArray[2]);
|
4661
|
+
const month = Number(dateArray[1]);
|
4662
|
+
const year = Number(dateArray[0]);
|
4663
|
+
let updatedYear = year.toString().length === 2 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '' + year :
|
4664
|
+
year.toString().length === 1 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '0' + year :
|
4665
|
+
year;
|
4666
|
+
control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
|
4667
|
+
}
|
4307
4668
|
writeValue(value) {
|
4308
4669
|
if (!value) {
|
4309
4670
|
this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
|
@@ -4323,10 +4684,10 @@ class DateValueAccessor {
|
|
4323
4684
|
this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
|
4324
4685
|
}
|
4325
4686
|
}
|
4326
|
-
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
|
4687
|
+
DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
|
4327
4688
|
DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) {
|
4328
4689
|
if (rf & 1) {
|
4329
|
-
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.
|
4690
|
+
i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
|
4330
4691
|
}
|
4331
4692
|
}, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
|
4332
4693
|
(function () {
|
@@ -4336,16 +4697,24 @@ DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, sele
|
|
4336
4697
|
selector: "[dateInput]",
|
4337
4698
|
providers: [DATE_VALUE_ACCESSOR]
|
4338
4699
|
}]
|
4339
|
-
}], function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, { onChange: [{
|
4700
|
+
}], function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: MagicDirective }, { type: TaskMagicService }]; }, { onChange: [{
|
4340
4701
|
type: HostListener,
|
4341
4702
|
args: ["input", ["$event.target.valueAsDate"]]
|
4342
4703
|
}], onTouched: [{
|
4343
4704
|
type: HostListener,
|
4344
4705
|
args: ["blur", []]
|
4706
|
+
}], onBlurEvent: [{
|
4707
|
+
type: HostListener,
|
4708
|
+
args: ['blur', ['$event']]
|
4345
4709
|
}] });
|
4346
4710
|
})();
|
4347
4711
|
|
4348
4712
|
class NonMagicControlDirective {
|
4713
|
+
set magic(val) {
|
4714
|
+
this.id = val;
|
4715
|
+
this.selector = 'NonMagicControl';
|
4716
|
+
}
|
4717
|
+
;
|
4349
4718
|
constructor(_task, element, renderer, vcRef) {
|
4350
4719
|
this._task = _task;
|
4351
4720
|
this.element = element;
|
@@ -4355,11 +4724,6 @@ class NonMagicControlDirective {
|
|
4355
4724
|
this.eventsOnlyVal = false;
|
4356
4725
|
this.htmlElement = this.element.nativeElement;
|
4357
4726
|
}
|
4358
|
-
set magic(val) {
|
4359
|
-
this.id = val;
|
4360
|
-
this.selector = 'NonMagicControl';
|
4361
|
-
}
|
4362
|
-
;
|
4363
4727
|
get task() {
|
4364
4728
|
return this._task;
|
4365
4729
|
}
|
@@ -4391,6 +4755,38 @@ NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlD
|
|
4391
4755
|
}] });
|
4392
4756
|
})();
|
4393
4757
|
|
4758
|
+
class Time24MagicPipe {
|
4759
|
+
constructor(_task) {
|
4760
|
+
this._task = _task;
|
4761
|
+
}
|
4762
|
+
transform(value, controlId) {
|
4763
|
+
let mask = this._task.GetControlPictureMask(controlId).getMask();
|
4764
|
+
if (typeof value !== "undefined" && mask !== null) {
|
4765
|
+
const date = new Date(value);
|
4766
|
+
const hours = date.getHours().toString().padStart(2, '0');
|
4767
|
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
4768
|
+
const seconds = date.getSeconds().toString().padStart(2, '0');
|
4769
|
+
if (mask.length == 5) {
|
4770
|
+
return `${hours}:${minutes}`;
|
4771
|
+
}
|
4772
|
+
else if (mask.length > 5) {
|
4773
|
+
return `${hours}:${minutes}:${seconds}`;
|
4774
|
+
}
|
4775
|
+
}
|
4776
|
+
return value;
|
4777
|
+
}
|
4778
|
+
}
|
4779
|
+
Time24MagicPipe.ɵfac = function Time24MagicPipe_Factory(t) { return new (t || Time24MagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
|
4780
|
+
Time24MagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true });
|
4781
|
+
(function () {
|
4782
|
+
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
|
4783
|
+
type: Pipe,
|
4784
|
+
args: [{
|
4785
|
+
name: 'magicTime24'
|
4786
|
+
}]
|
4787
|
+
}], function () { return [{ type: TaskMagicService }]; }, null);
|
4788
|
+
})();
|
4789
|
+
|
4394
4790
|
const decs = [
|
4395
4791
|
MagicDirective,
|
4396
4792
|
CheckboxMagicDirective,
|
@@ -4419,26 +4815,25 @@ const decs = [
|
|
4419
4815
|
RangeValidatorMagicDirective,
|
4420
4816
|
NonMagicControlDirective,
|
4421
4817
|
MagicFocusDirective,
|
4422
|
-
MagicViewContainerRef
|
4818
|
+
MagicViewContainerRef,
|
4819
|
+
Time24MagicPipe
|
4423
4820
|
];
|
4424
4821
|
class MagicModule {
|
4425
4822
|
}
|
4426
4823
|
MagicModule.ɵfac = function MagicModule_Factory(t) { return new (t || MagicModule)(); };
|
4427
4824
|
MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
|
4428
|
-
MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [
|
4429
|
-
|
4430
|
-
|
4431
|
-
|
4432
|
-
|
4433
|
-
|
4434
|
-
HttpClientModule
|
4435
|
-
]] });
|
4825
|
+
MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [CommonModule,
|
4826
|
+
FormsModule,
|
4827
|
+
ReactiveFormsModule,
|
4828
|
+
RouterModule,
|
4829
|
+
DynamicModule,
|
4830
|
+
HttpClientModule, MaskitoModule] });
|
4436
4831
|
(function () {
|
4437
4832
|
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
|
4438
4833
|
type: NgModule,
|
4439
4834
|
args: [{
|
4440
4835
|
declarations: [...decs],
|
4441
|
-
exports: [...decs],
|
4836
|
+
exports: [...decs, MaskitoModule],
|
4442
4837
|
entryComponents: [],
|
4443
4838
|
imports: [
|
4444
4839
|
CommonModule,
|
@@ -4480,7 +4875,8 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
|
|
4480
4875
|
RangeValidatorMagicDirective,
|
4481
4876
|
NonMagicControlDirective,
|
4482
4877
|
MagicFocusDirective,
|
4483
|
-
MagicViewContainerRef
|
4878
|
+
MagicViewContainerRef,
|
4879
|
+
Time24MagicPipe], imports: [CommonModule,
|
4484
4880
|
FormsModule,
|
4485
4881
|
ReactiveFormsModule,
|
4486
4882
|
RouterModule,
|
@@ -4512,7 +4908,8 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
|
|
4512
4908
|
RangeValidatorMagicDirective,
|
4513
4909
|
NonMagicControlDirective,
|
4514
4910
|
MagicFocusDirective,
|
4515
|
-
MagicViewContainerRef
|
4911
|
+
MagicViewContainerRef,
|
4912
|
+
Time24MagicPipe, MaskitoModule] });
|
4516
4913
|
})();
|
4517
4914
|
|
4518
4915
|
const MG_FORMATS = {
|
@@ -4699,5 +5096,5 @@ class ModalFormDefinition {
|
|
4699
5096
|
}
|
4700
5097
|
}
|
4701
5098
|
|
4702
|
-
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, TimeMagicPipe, TitleMagicService, basicMagicProviders, confirmationBox, magicProviders, matDateProviders, utils };
|
5099
|
+
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 };
|
4703
5100
|
//# sourceMappingURL=magic-xpa-angular.mjs.map
|