@magic-xpa/angular 4.1000.0-dev4100.43 → 4.1000.0-dev4100.436

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.
Files changed (68) hide show
  1. package/esm2020/index.mjs +2 -1
  2. package/esm2020/src/magic.core.module.mjs +16 -13
  3. package/esm2020/src/services/accessor.magic.service.mjs +28 -3
  4. package/esm2020/src/services/magic-color.service.mjs +4 -4
  5. package/esm2020/src/services/subform.magic.service.mjs +1 -1
  6. package/esm2020/src/services/table.magic.service.mjs +5 -2
  7. package/esm2020/src/services/task.magics.service.mjs +29 -5
  8. package/esm2020/src/ui/GuiInteractiveExecutor.mjs +7 -2
  9. package/esm2020/src/ui/components/base-magic-alert.component.mjs +3 -7
  10. package/esm2020/src/ui/components/base-magic-confirm.component.mjs +3 -7
  11. package/esm2020/src/ui/components/magic-alert.component.mjs +3 -35
  12. package/esm2020/src/ui/components/magic-confirmation-box.component.mjs +3 -39
  13. package/esm2020/src/ui/directives/NonMagicControlDirective.mjs +6 -6
  14. package/esm2020/src/ui/directives/magic/checkbox.magic.directive.mjs +76 -7
  15. package/esm2020/src/ui/directives/magic/combobox.magic.directive.mjs +11 -1
  16. package/esm2020/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.mjs +34 -5
  17. package/esm2020/src/ui/directives/magic/nocontrol.magic.directive.mjs +3 -3
  18. package/esm2020/src/ui/directives/magic.directive.mjs +11 -11
  19. package/esm2020/src/ui/directives/mgformat.magic.directive.mjs +336 -3
  20. package/esm2020/src/ui/magic-modal/base-magic-overlay-container.mjs +1 -1
  21. package/esm2020/src/ui/magic-modal/magic-overlay-container-wrapper.mjs +4 -18
  22. package/esm2020/src/ui/magic-modal/magic-overlay-container.mjs +4 -4
  23. package/esm2020/src/ui/magic-root.component.mjs +4 -38
  24. package/esm2020/src/ui/mgerror.magic.component.mjs +9 -9
  25. package/esm2020/src/ui/pipes/time24.magic.pipe.mjs +34 -0
  26. package/esm2020/src/ui/router-container.magic.component.mjs +4 -4
  27. package/esm2020/src/ui/subform.magic.component.mjs +4 -4
  28. package/esm2020/src/ui/task-base.magic.component.mjs +8 -2
  29. package/fesm2015/magic-xpa-angular.mjs +609 -209
  30. package/fesm2015/magic-xpa-angular.mjs.map +1 -1
  31. package/fesm2020/magic-xpa-angular.mjs +607 -209
  32. package/fesm2020/magic-xpa-angular.mjs.map +1 -1
  33. package/index.d.ts +1 -0
  34. package/package.json +11 -8
  35. package/src/magic.core.module.d.ts +8 -6
  36. package/src/services/accessor.magic.service.d.ts +3 -0
  37. package/src/services/table.magic.service.d.ts +2 -0
  38. package/src/services/task.magics.service.d.ts +1 -0
  39. package/src/ui/components/base-magic-alert.component.d.ts +1 -1
  40. package/src/ui/components/base-magic-confirm.component.d.ts +1 -1
  41. package/src/ui/components/magic-alert.component.d.ts +1 -1
  42. package/src/ui/components/magic-confirmation-box.component.d.ts +1 -1
  43. package/src/ui/directives/NonMagicControlDirective.d.ts +1 -1
  44. package/src/ui/directives/magic/checkbox-noformcontrol.magic.directive.d.ts +1 -1
  45. package/src/ui/directives/magic/checkbox.magic.directive.d.ts +15 -2
  46. package/src/ui/directives/magic/combobox.magic.directive.d.ts +2 -1
  47. package/src/ui/directives/magic/form-controls/control-value-accessors/checkbox.cva.directive.d.ts +1 -1
  48. package/src/ui/directives/magic/form-controls/control-value-accessors/date.cva.directive.d.ts +9 -3
  49. package/src/ui/directives/magic/form-controls/control-value-accessors/default.cva.directive.d.ts +1 -1
  50. package/src/ui/directives/magic/input.noformcontrol.magic.directive.d.ts +1 -1
  51. package/src/ui/directives/magic/nocontrol.magic.directive.d.ts +1 -1
  52. package/src/ui/directives/magic/row.magic.directive.d.ts +1 -1
  53. package/src/ui/directives/magic-focus.directive.d.ts +1 -1
  54. package/src/ui/directives/magic.directive.d.ts +2 -2
  55. package/src/ui/directives/magicViewContainerRef.directive.d.ts +1 -1
  56. package/src/ui/directives/mgformat.magic.directive.d.ts +12 -2
  57. package/src/ui/directives/range-validator.magic.directive.d.ts +1 -1
  58. package/src/ui/magic-modal/magic-overlay-container-wrapper.d.ts +1 -1
  59. package/src/ui/magic-modal/magic-overlay-container.d.ts +1 -1
  60. package/src/ui/magic-root.component.d.ts +1 -1
  61. package/src/ui/mgerror.magic.component.d.ts +1 -1
  62. package/src/ui/pipes/date.magic.pipe.d.ts +1 -1
  63. package/src/ui/pipes/time.magic.pipe.d.ts +1 -1
  64. package/src/ui/pipes/time24.magic.pipe.d.ts +10 -0
  65. package/src/ui/router-container.magic.component.d.ts +1 -1
  66. package/src/ui/subform.magic.component.d.ts +1 -1
  67. package/src/ui/task-base.magic.component.d.ts +2 -1
  68. package/magic-xpa-angular.d.ts +0 -2
@@ -8,8 +8,8 @@ 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, HtmlProperties, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
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';
@@ -17,6 +17,8 @@ import { __decorate, __metadata } from 'tslib';
17
17
  import * as i1$1 from '@angular/platform-browser';
18
18
  import * as i1$2 from '@angular/common/http';
19
19
  import { HttpClientModule } from '@angular/common/http';
20
+ import { maskitoTimeOptionsGenerator } from '@maskito/kit';
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
 
@@ -596,6 +598,9 @@ SubformMagicService.ɵprov = i0.ɵɵdefineInjectable({ token: SubformMagicServic
596
598
  }], function () { return [{ 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); })();
597
599
 
598
600
  class RouterContainerMagicComponent {
601
+ static get LastRoute() {
602
+ return RouterContainerMagicComponent.lastRoute;
603
+ }
599
604
  constructor(activatedRoute, router, magic, containerTaskService, componentFactoryResolver, viewContainerRef, componentList, pendingCommandsCollector, routerCommandsMagicService) {
600
605
  this.activatedRoute = activatedRoute;
601
606
  this.router = router;
@@ -609,9 +614,6 @@ class RouterContainerMagicComponent {
609
614
  this.componentRef = null;
610
615
  this.parentMgSubformService = null;
611
616
  }
612
- static get LastRoute() {
613
- return RouterContainerMagicComponent.lastRoute;
614
- }
615
617
  ngOnInit() {
616
618
  let subformMagicService = SubformMagicService.currentCallerMgSubformServiceRef;
617
619
  let currentActiveRoute = SubformMagicService.getRelativeRoute(this.activatedRoute);
@@ -738,6 +740,11 @@ class GuiInteractiveExecutor {
738
740
  }
739
741
  else if (this.task.isTableControl(this.command.controlName))
740
742
  val = this.task.getValue(this.command.controlName, guiRowId.toString());
743
+ if (this.command._boolVal) {
744
+ const indeterminate = this.task.getProperty(this.command.controlName, HtmlProperties.CheckBoxIndeterminate, guiRowId.toString());
745
+ if (indeterminate)
746
+ val = null;
747
+ }
741
748
  val = this.task.ConvertValToNative(this.command.controlName, guiRowId, val);
742
749
  this.command._mgValue.obj = val;
743
750
  }
@@ -820,7 +827,7 @@ const _c1$1 = ["modalForeground"];
820
827
  function MagicOverlayContainer_button_2_Template(rf, ctx) { if (rf & 1) {
821
828
  const _r5 = i0.ɵɵgetCurrentView();
822
829
  i0.ɵɵelementStart(0, "button", 8);
823
- i0.ɵɵlistener("click", function MagicOverlayContainer_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.OnClose(); });
830
+ 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()); });
824
831
  i0.ɵɵtext(1, "X");
825
832
  i0.ɵɵelementEnd();
826
833
  } }
@@ -829,7 +836,7 @@ function MagicOverlayContainer_div_5_Template(rf, ctx) { if (rf & 1) {
829
836
  i0.ɵɵelementStart(0, "div", 9, 10);
830
837
  i0.ɵɵtext(2);
831
838
  i0.ɵɵelementStart(3, "button", 11);
832
- i0.ɵɵlistener("click", function MagicOverlayContainer_div_5_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.OnClose(); });
839
+ 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()); });
833
840
  i0.ɵɵtext(4, "X");
834
841
  i0.ɵɵelementEnd()();
835
842
  } if (rf & 2) {
@@ -934,7 +941,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
934
941
  i0.ɵɵproperty("ngIf", ctx.getShowTitleBar());
935
942
  i0.ɵɵadvance(1);
936
943
  i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
937
- } }, directives: [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}"] });
944
+ } }, 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}"] });
938
945
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
939
946
  type: Component,
940
947
  args: [{ selector: 'app-magic-overlay-container', template: `
@@ -988,14 +995,10 @@ class BaseMagicConfirmComponent {
988
995
  }
989
996
  }
990
997
  BaseMagicConfirmComponent.ɵfac = function BaseMagicConfirmComponent_Factory(t) { return new (t || BaseMagicConfirmComponent)(); };
991
- 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) { }, styles: [""] });
998
+ 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) { } });
992
999
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicConfirmComponent, [{
993
1000
  type: Component,
994
- args: [{
995
- selector: 'mg-base-alert',
996
- template: '',
997
- styles: ['']
998
- }]
1001
+ args: [{ selector: 'mg-base-alert', template: '' }]
999
1002
  }], null, { title: [{
1000
1003
  type: Input
1001
1004
  }], message: [{
@@ -1013,14 +1016,10 @@ class BaseMagicAlertComponent {
1013
1016
  }
1014
1017
  }
1015
1018
  BaseMagicAlertComponent.ɵfac = function BaseMagicAlertComponent_Factory(t) { return new (t || BaseMagicAlertComponent)(); };
1016
- 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) { }, styles: [""] });
1019
+ 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) { } });
1017
1020
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMagicAlertComponent, [{
1018
1021
  type: Component,
1019
- args: [{
1020
- selector: 'mg-base-alert',
1021
- template: '',
1022
- styles: ['']
1023
- }]
1022
+ args: [{ selector: 'mg-base-alert', template: '' }]
1024
1023
  }], null, { title: [{
1025
1024
  type: Input
1026
1025
  }], message: [{
@@ -1128,12 +1127,10 @@ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlay
1128
1127
  i0.ɵɵelementEnd();
1129
1128
  i0.ɵɵelement(6, "div", 5);
1130
1129
  i0.ɵɵelementEnd();
1131
- } }, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
1130
+ } }, dependencies: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
1132
1131
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
1133
1132
  type: Component,
1134
- args: [{
1135
- selector: 'app-magic-overlay-container-wrapper',
1136
- template: `
1133
+ args: [{ selector: 'app-magic-overlay-container-wrapper', template: `
1137
1134
  <div>
1138
1135
  <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" magicFocus></div>
1139
1136
  <div class="overlay-container-wrapper-background" #overlayContainerWrapper>
@@ -1142,19 +1139,7 @@ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlay
1142
1139
  </div>
1143
1140
  <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>
1144
1141
  </div>
1145
- `,
1146
- styles: [`
1147
- .overlay-container-wrapper-background {
1148
- /* modal background fixed across whole screen */
1149
- position: fixed;
1150
- top: 0;
1151
- z-index: 999;
1152
- right: 0;
1153
- bottom: 0;
1154
- left: 0;
1155
- }
1156
- `]
1157
- }]
1142
+ `, styles: [".overlay-container-wrapper-background{position:fixed;z-index:999;inset:0}\n"] }]
1158
1143
  }], function () { return [{ type: ComponentListMagicService }, { type: MagicLazyLoaderService }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: i0.Compiler }]; }, { Component: [{
1159
1144
  type: Input
1160
1145
  }], Parameters: [{
@@ -1190,46 +1175,14 @@ MagicAlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicAlertComponent,
1190
1175
  } }, styles: [".mg-message-background[_ngcontent-%COMP%]{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[_ngcontent-%COMP%]{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}"] });
1191
1176
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicAlertComponent, [{
1192
1177
  type: Component,
1193
- args: [{
1194
- selector: 'sample-magic-alert-component',
1195
- template: `<div>
1178
+ args: [{ selector: 'sample-magic-alert-component', template: `<div>
1196
1179
  <div class="mg-message-background">
1197
1180
  <h2> {{title}}</h2>
1198
1181
  <p>{{message}} </p>
1199
1182
 
1200
1183
  <button (click)="OnClose()">OK</button>
1201
1184
  </div>
1202
- </div>`,
1203
- styles: [`
1204
- .mg-message-background {
1205
- background-color: #F5F5F5;
1206
- text-align: center;
1207
- width: 40%;
1208
- font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
1209
- padding: 17px;
1210
- border-radius: 5px;
1211
- text-align: center;
1212
- margin-top: 10% ;
1213
- margin-left: auto;
1214
- margin-right: auto;
1215
- border: 1px solid gray;
1216
- }
1217
-
1218
- button {
1219
- background-color: #8CD4F5;
1220
- color: white;
1221
- border: none;
1222
- box-shadow: none;
1223
- font-size: 17px;
1224
- font-weight: 500;
1225
- -webkit-border-radius: 4px;
1226
- border-radius: 5px;
1227
- padding: 10px 32px;
1228
- margin: 26px 5px 0 5px;
1229
- cursor: pointer;
1230
- }
1231
- `]
1232
- }]
1185
+ </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"] }]
1233
1186
  }], null, null); })();
1234
1187
 
1235
1188
  class MagicConfirmationBoxComponent extends BaseMagicConfirmComponent {
@@ -1257,9 +1210,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
1257
1210
  } }, styles: [".mg-message-background[_ngcontent-%COMP%]{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[_ngcontent-%COMP%]{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[_ngcontent-%COMP%]{background-color:#c1c1c1}"] });
1258
1211
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicConfirmationBoxComponent, [{
1259
1212
  type: Component,
1260
- args: [{
1261
- selector: 'sample-magic-confirmation-box',
1262
- template: `<div>
1213
+ args: [{ selector: 'sample-magic-confirmation-box', template: `<div>
1263
1214
  <div class="mg-message-background">
1264
1215
  <h2> {{title}}</h2>
1265
1216
  {{message}}
@@ -1269,41 +1220,7 @@ MagicConfirmationBoxComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicConfir
1269
1220
  <button (click)="OnClose(true)">OK</button>
1270
1221
  <button class="cancel" (click)="OnClose(false)">Cancel</button>
1271
1222
  </div>
1272
- </div>`,
1273
- styles: [`
1274
- .mg-message-background {
1275
- background-color: #F5F5F5;
1276
- text-align: center;
1277
- width: 40%;
1278
- font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
1279
- padding: 17px;
1280
- border-radius: 5px;
1281
- text-align: center;
1282
- margin-top: 10% ;
1283
- margin-left: auto;
1284
- margin-right: auto;
1285
- border: 1px solid gray;
1286
- }
1287
-
1288
- button {
1289
- background-color: #8CD4F5;
1290
- color: white;
1291
- border: none;
1292
- box-shadow: none;
1293
- font-size: 17px;
1294
- font-weight: 500;
1295
- -webkit-border-radius: 4px;
1296
- border-radius: 5px;
1297
- padding: 10px 32px;
1298
- margin: 26px 5px 0 5px;
1299
- cursor: pointer;
1300
- }
1301
-
1302
- button.cancel {
1303
- background-color: #C1C1C1;
1304
- }
1305
- `]
1306
- }]
1223
+ </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"] }]
1307
1224
  }], null, null); })();
1308
1225
 
1309
1226
  class ConfirmationComponentsMagicProvider {
@@ -1569,6 +1486,7 @@ class TaskMagicService {
1569
1486
  this.OnSelectedRowChanged = new EventEmitter();
1570
1487
  this.customPropertiesSubject = new Subject();
1571
1488
  this.recordsCountChangeSubject = new Subject();
1489
+ this.mgLoadSubject = new Subject();
1572
1490
  this.oldPageSize = 0;
1573
1491
  this.Records.setGuiTopIndex(0);
1574
1492
  this.mgInputDateFormat = null;
@@ -1821,6 +1739,11 @@ class TaskMagicService {
1821
1739
  }
1822
1740
  }
1823
1741
  break;
1742
+ case CommandType.SET_CHUNK_SIZE:
1743
+ if (!isUndefined(command.number)) {
1744
+ this.tableService.setChunkSize(command.number);
1745
+ }
1746
+ break;
1824
1747
  case CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW:
1825
1748
  this.updateRecordsBeforeCurrentView(command.number);
1826
1749
  break;
@@ -1848,7 +1771,9 @@ class TaskMagicService {
1848
1771
  break;
1849
1772
  case CommandType.SET_PROPERTY:
1850
1773
  this.handleSetProperty(command, isTableChild);
1851
- if (command.Operation == HtmlProperties.ReadOnly)
1774
+ if (command.Operation == HtmlProperties.ReadOnly ||
1775
+ command.Operation == HtmlProperties.ItemsList ||
1776
+ command.Operation == HtmlProperties.CheckBoxIndeterminate)
1852
1777
  this.refreshDom.next(command);
1853
1778
  break;
1854
1779
  case CommandType.PROP_SET_USER_PROPERTY:
@@ -1903,6 +1828,9 @@ class TaskMagicService {
1903
1828
  case CommandType.SET_FOCUS:
1904
1829
  this.refreshDom.next(command);
1905
1830
  break;
1831
+ case CommandType.SET_WC_IDLE:
1832
+ this.mgLoadSubject.next();
1833
+ break;
1906
1834
  }
1907
1835
  }
1908
1836
  customValidator(rowid, id) {
@@ -1961,7 +1889,10 @@ class TaskMagicService {
1961
1889
  return val;
1962
1890
  }
1963
1891
  case StorageAttribute.NUMERIC:
1964
- return +val;
1892
+ if (isUndefined(val))
1893
+ return val;
1894
+ else
1895
+ return (val != null) ? +val : null;
1965
1896
  default:
1966
1897
  return val;
1967
1898
  }
@@ -2082,6 +2013,16 @@ class TaskMagicService {
2082
2013
  if (typeof (event) == 'boolean') {
2083
2014
  guiEvent.Value = event;
2084
2015
  }
2016
+ else if (typeof (event) == 'string') {
2017
+ if (event == "unchecked") {
2018
+ guiEvent.Value = false;
2019
+ }
2020
+ else if (event == 'indeterminate')
2021
+ guiEvent.Value = null;
2022
+ else if (event == 'checked') {
2023
+ guiEvent.Value = true;
2024
+ }
2025
+ }
2085
2026
  else {
2086
2027
  if (typeof event.target === 'undefined')
2087
2028
  guiEvent.Value = (event).checked;
@@ -2098,10 +2039,10 @@ class TaskMagicService {
2098
2039
  mgOnRadioSelectionChanged(idx) {
2099
2040
  let result = this.getFormControl('0', idx);
2100
2041
  let guiEvent = getGuiEventObj('selectionchanged', idx, 0);
2101
- if (typeof result.value !== 'string')
2042
+ if (typeof result.value !== 'number')
2102
2043
  guiEvent.Value = result.value.index;
2103
2044
  else
2104
- guiEvent.Value = result.value;
2045
+ guiEvent.Value = result.value.toString();
2105
2046
  this.insertEvent(guiEvent);
2106
2047
  }
2107
2048
  close() {
@@ -2160,7 +2101,10 @@ class TableMagicService {
2160
2101
  refreshDataSource() {
2161
2102
  }
2162
2103
  getPageSize() {
2163
- return 10;
2104
+ return this.chunkSize;
2105
+ }
2106
+ setChunkSize(size) {
2107
+ this.chunkSize = size;
2164
2108
  }
2165
2109
  getMaxRowsInTable() {
2166
2110
  return this.task.Records.list.length;
@@ -2244,6 +2188,9 @@ const SYSTEM_BG = 4;
2244
2188
  const SYSTEM_FG_AND_SYSTEM_BG = 6;
2245
2189
  const TRANSPERENT_BG = 1;
2246
2190
  class MagicColorService {
2191
+ getColorFilePath() {
2192
+ return 'assets/' + this.colorFileName;
2193
+ }
2247
2194
  constructor(http, colorFile1 = 'clr_rnt.eng') {
2248
2195
  this.http = http;
2249
2196
  this.colorFileName = 'clr_rnt.eng';
@@ -2253,9 +2200,6 @@ class MagicColorService {
2253
2200
  else
2254
2201
  this.colorFileName = 'clr_rnt.eng';
2255
2202
  }
2256
- getColorFilePath() {
2257
- return 'assets/' + this.colorFileName;
2258
- }
2259
2203
  getColorData() {
2260
2204
  if (!this.colorsData) {
2261
2205
  this.http.get(this.getColorFilePath(), { responseType: 'text' }).subscribe(resp => {
@@ -2333,6 +2277,8 @@ class AccessorMagicService {
2333
2277
  this.task = task;
2334
2278
  this.magicColor = magicColor;
2335
2279
  this.Logger = null;
2280
+ this.hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
2281
+ this.hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
2336
2282
  this.Logger = Logger.Instance;
2337
2283
  }
2338
2284
  checkIsReadOnly(controlId) {
@@ -2568,8 +2514,30 @@ class AccessorMagicService {
2568
2514
  let c = this.task.getFormControl(rowId, id);
2569
2515
  if (c.hasError('required'))
2570
2516
  return 'Control must be updated.';
2571
- if (c.hasError('pattern'))
2572
- return 'Required pattern is : ' + c.errors.pattern.requiredPattern;
2517
+ if (c.hasError('pattern')) {
2518
+ if (c.errors.pattern.actualValue < 0 && !c.errors.pattern.requiredPattern.includes('-'))
2519
+ return 'Value must be non-negative';
2520
+ if (c.errors.pattern.requiredPattern.includes('.')) {
2521
+ const numericFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[0];
2522
+ const decimalFormat = Math.abs(c.errors.pattern.actualValue).toString().split('.')[1];
2523
+ const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
2524
+ const actualDecimalLimit = c.errors.pattern.requiredPattern.match(/(?:[^,]+,){2}(\d+)/)[1];
2525
+ if (numericFormat.length > actualNumericLimit || decimalFormat.length > actualDecimalLimit) {
2526
+ return "Numeric format is limited to " + actualNumericLimit + "." + actualDecimalLimit + " digits";
2527
+ }
2528
+ }
2529
+ else if (!c.errors.pattern.requiredPattern.includes('.') && !Number.isInteger(c.errors.pattern.actualValue)) {
2530
+ const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
2531
+ return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
2532
+ }
2533
+ else {
2534
+ const numericFormat = Math.abs(c.errors.pattern.actualValue).toString();
2535
+ const actualNumericLimit = c.errors.pattern.requiredPattern.match(/,(\d+)/)[1];
2536
+ if (numericFormat.length > actualNumericLimit) {
2537
+ return "Numeric format is limited to " + actualNumericLimit + "." + 0 + " digits";
2538
+ }
2539
+ }
2540
+ }
2573
2541
  if (c.hasError('rangevalidator'))
2574
2542
  return c.errors.rangevalidator.errorMsg;
2575
2543
  if (c.hasError('maxlength'))
@@ -2705,6 +2673,9 @@ class TaskBaseMagicComponent {
2705
2673
  this.task.recordsCountChangeSubject.pipe().subscribe(value => {
2706
2674
  this.RecordsCountChanged(value);
2707
2675
  });
2676
+ this.task.mgLoadSubject.pipe().subscribe(value => {
2677
+ this.mgOnLoad();
2678
+ });
2708
2679
  }
2709
2680
  createFormControlsAccessor(formGroup) { }
2710
2681
  setInputDateFormat() { }
@@ -2712,11 +2683,13 @@ class TaskBaseMagicComponent {
2712
2683
  }
2713
2684
  RecordsCountChanged(recordsCount) {
2714
2685
  }
2686
+ mgOnLoad() {
2687
+ }
2715
2688
  ngAfterViewInit() {
2716
2689
  this.mgSub.init();
2717
2690
  }
2718
2691
  ngAfterContentChecked() {
2719
- if (this.task.oldPageSize != this.tableService.getPageSize()) {
2692
+ if (!isNullOrUndefined(this.tableService.getPageSize()) && this.task.oldPageSize != this.tableService.getPageSize()) {
2720
2693
  this.task.resize(this.tableService.getPageSize(), 0);
2721
2694
  this.task.oldPageSize = this.tableService.getPageSize();
2722
2695
  }
@@ -2792,6 +2765,16 @@ RowMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: RowMagicDirective, sele
2792
2765
  }] }); })();
2793
2766
 
2794
2767
  class MagicDirective {
2768
+ set magic(val) {
2769
+ this.id = val;
2770
+ this.selector = "magic";
2771
+ }
2772
+ ;
2773
+ set eventsOnly(val) {
2774
+ console.log("eventsOnly");
2775
+ this.eventsOnlyVal = true;
2776
+ }
2777
+ ;
2795
2778
  constructor(_task, element, renderer, vcRef, magicRow) {
2796
2779
  this._task = _task;
2797
2780
  this.element = element;
@@ -2804,16 +2787,6 @@ class MagicDirective {
2804
2787
  if (!(typeof magicRow === "undefined" || magicRow === null))
2805
2788
  this.rowId = magicRow.rowId;
2806
2789
  }
2807
- set magic(val) {
2808
- this.id = val;
2809
- this.selector = "magic";
2810
- }
2811
- ;
2812
- set eventsOnly(val) {
2813
- console.log("eventsOnly");
2814
- this.eventsOnlyVal = true;
2815
- }
2816
- ;
2817
2790
  get task() {
2818
2791
  return this._task;
2819
2792
  }
@@ -2989,11 +2962,11 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
2989
2962
  }] }); })();
2990
2963
 
2991
2964
  class NoControlMagicDirective extends MagicDirective {
2965
+ set magic(val) { this.id = val; this.selector = 'magicnc'; }
2966
+ ;
2992
2967
  constructor(_task, element, renderer, vcRef, magicRow) {
2993
2968
  super(_task, element, renderer, vcRef, magicRow);
2994
2969
  }
2995
- set magic(val) { this.id = val; this.selector = 'magicnc'; }
2996
- ;
2997
2970
  regEvents() {
2998
2971
  super.regEvents();
2999
2972
  if (this.htmlElement instanceof HTMLSelectElement) {
@@ -3270,6 +3243,7 @@ class MgformatMagicDirective {
3270
3243
  constructor(magicDir, _task) {
3271
3244
  this.magicDir = magicDir;
3272
3245
  this._task = _task;
3246
+ this.datePasteFlag = false;
3273
3247
  }
3274
3248
  ngAfterViewInit() {
3275
3249
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
@@ -3283,9 +3257,170 @@ class MgformatMagicDirective {
3283
3257
  onFocusEvent($event) {
3284
3258
  this.calculatePattern();
3285
3259
  }
3286
- onInputEvent($event) {
3260
+ onPaste(event) {
3261
+ this.datePasteFlag = true;
3262
+ }
3263
+ onInputEvent(event) {
3264
+ let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3265
+ if (attr == StorageAttribute.DATE) {
3266
+ if (!this.datePasteFlag)
3267
+ this.dateMasking(event);
3268
+ this.datePasteFlag = false;
3269
+ }
3287
3270
  this.calculatePattern();
3288
3271
  }
3272
+ dateMasking(event) {
3273
+ const input = event.target;
3274
+ let cursorPos = event.target.selectionStart;
3275
+ const separator = this._task.mgInputDateFormat.includes('/') ? '/' : '-';
3276
+ if (cursorPos >= input.value.length) {
3277
+ const value = input.value.replace(/[^a-zA-Z0-9/-]/g, '');
3278
+ 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") {
3279
+ if (value.length == 1 && value[0] == separator)
3280
+ input.value = '01' + separator;
3281
+ else if (value.length == 2 && value[1] == separator)
3282
+ input.value = 0 + value;
3283
+ else if (value.length == 3 && value[2] != separator)
3284
+ input.value = value.slice(0, 2) + separator + value.slice(2);
3285
+ else if (value.length == 4 && value[3] == separator)
3286
+ input.value = value.slice(0, 3) + '01' + value.slice(3);
3287
+ else if (value.length == 5 && value[4] == separator)
3288
+ input.value = value.slice(0, 3) + '0' + value.slice(3);
3289
+ else if (value.length == 6 && value[5] != separator)
3290
+ input.value = value.slice(0, 5) + separator + value.slice(5);
3291
+ else if (value.length >= 10)
3292
+ input.value = value.slice(0, 10);
3293
+ }
3294
+ 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") {
3295
+ if (value.length == 1 && value[0] == separator)
3296
+ input.value = '0000' + separator;
3297
+ else if (value.length == 2 && value[1] == separator)
3298
+ input.value = '000' + value.slice(0);
3299
+ else if (value.length == 3 && value[2] == separator)
3300
+ input.value = '00' + value.slice(0);
3301
+ else if (value.length == 4 && value[3] == separator)
3302
+ input.value = '0' + value.slice(0);
3303
+ else if (value.length == 5 && value[4] != separator)
3304
+ input.value = value.slice(0, 4) + separator + value.slice(4);
3305
+ else if (value.length == 6 && value[5] == separator)
3306
+ input.value = value.slice(0, 5) + '01' + value.slice(5);
3307
+ else if (value.length == 7 && value[6] == separator)
3308
+ input.value = value.slice(0, 5) + '0' + value.slice(5);
3309
+ else if (value.length == 8 && value[7] != separator)
3310
+ input.value = value.slice(0, 7) + separator + value.slice(7);
3311
+ else if (value.length >= 10)
3312
+ input.value = value.slice(0, 10);
3313
+ }
3314
+ 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") {
3315
+ if (value.length == 1 && value[0] == separator)
3316
+ input.value = '01' + separator;
3317
+ else if (value.length == 2 && value[1] == separator)
3318
+ input.value = 0 + value;
3319
+ else if (value.length == 3 && value[2] != separator)
3320
+ input.value = value.slice(0, 2) + separator + value.slice(2);
3321
+ else if (value.length == 4 && value[3] == separator)
3322
+ input.value = value.slice(0, 3) + '01' + value.slice(3);
3323
+ else if (value.length == 5 && value[4] == separator)
3324
+ input.value = value.slice(0, 3) + '0' + value.slice(3);
3325
+ else if (value.length == 6 && value[5] != separator)
3326
+ input.value = value.slice(0, 5) + separator + value.slice(5);
3327
+ else if (value.length >= 8)
3328
+ input.value = value.slice(0, 8);
3329
+ }
3330
+ else if (this._task.mgInputDateFormat == "dd/MMM/yy" || this._task.mgInputDateFormat == "dd-MMM-yy") {
3331
+ if (value.length == 1 && value[0] == separator)
3332
+ input.value = '01' + separator;
3333
+ else if (value.length == 2 && value[1] == separator)
3334
+ input.value = 0 + value;
3335
+ else if (value.length == 3 && value[2] != separator)
3336
+ input.value = value.slice(0, 2) + separator + value.slice(2);
3337
+ else if (value.length == 7 && value[6] != separator)
3338
+ input.value = value.slice(0, 6) + separator + value.slice(6);
3339
+ else if (value.length >= 9)
3340
+ input.value = value.slice(0, 9);
3341
+ }
3342
+ else if (this._task.mgInputDateFormat == "dd/MMM/yyyy" || this._task.mgInputDateFormat == "dd-MMM-yyyy") {
3343
+ if (value.length == 1 && value[0] == separator)
3344
+ input.value = '01' + separator;
3345
+ else if (value.length == 2 && value[1] == separator)
3346
+ input.value = 0 + value;
3347
+ else if (value.length == 3 && value[2] != separator)
3348
+ input.value = value.slice(0, 2) + separator + value.slice(2);
3349
+ else if (value.length == 7 && value[6] != separator)
3350
+ input.value = value.slice(0, 6) + separator + value.slice(6);
3351
+ else if (value.length >= 11)
3352
+ input.value = value.slice(0, 11);
3353
+ }
3354
+ else if (this._task.mgInputDateFormat == "yy/dd/MMM" || this._task.mgInputDateFormat == "yy-dd-MMM") {
3355
+ if (value.length == 1 && value[0] == separator)
3356
+ input.value = '00' + separator;
3357
+ else if (value.length == 2 && value[1] == separator)
3358
+ input.value = 0 + value;
3359
+ else if (value.length == 3 && value[2] != separator)
3360
+ input.value = value.slice(0, 2) + separator + value.slice(2);
3361
+ else if (value.length == 4 && value[3] == separator)
3362
+ input.value = value.slice(0, 3) + '01' + value.slice(3);
3363
+ else if (value.length == 5 && value[4] == separator)
3364
+ input.value = value.slice(0, 3) + '0' + value.slice(3);
3365
+ else if (value.length == 6 && value[5] != separator)
3366
+ input.value = value.slice(0, 5) + separator + value.slice(5);
3367
+ else if (value.length >= 9)
3368
+ input.value = value.slice(0, 9);
3369
+ }
3370
+ else if (this._task.mgInputDateFormat == "yyyy/dd/MMM" || this._task.mgInputDateFormat == "yyyy-dd-MMM") {
3371
+ if (value.length == 1 && value[0] == separator)
3372
+ input.value = '0000' + separator;
3373
+ else if (value.length == 2 && value[1] == separator)
3374
+ input.value = '000' + value.slice(0);
3375
+ else if (value.length == 3 && value[2] == separator)
3376
+ input.value = '00' + value.slice(0);
3377
+ else if (value.length == 4 && value[3] == separator)
3378
+ input.value = '0' + value.slice(0);
3379
+ else if (value.length == 5 && value[4] != separator)
3380
+ input.value = value.slice(0, 4) + separator + value.slice(4);
3381
+ else if (value.length == 6 && value[5] == separator)
3382
+ input.value = value.slice(0, 5) + '01' + value.slice(5);
3383
+ else if (value.length == 7 && value[6] == separator)
3384
+ input.value = value.slice(0, 5) + '0' + value.slice(5);
3385
+ else if (value.length == 8 && value[7] != separator)
3386
+ input.value = value.slice(0, 7) + separator + value.slice(7);
3387
+ else if (value.length >= 11)
3388
+ input.value = value.slice(0, 11);
3389
+ }
3390
+ else if (this._task.mgInputDateFormat == "MMM/dd/yy" || this._task.mgInputDateFormat == "MMM-dd-yy") {
3391
+ if (value.length == 4 && value[3] != separator)
3392
+ input.value = value.slice(0, 3) + separator + value.slice(3);
3393
+ else if (value.length == 5 && value[4] == separator)
3394
+ input.value = value.slice(0, 4) + '01' + value.slice(4);
3395
+ else if (value.length == 6 && value[5] == separator)
3396
+ input.value = value.slice(0, 4) + '0' + value.slice(4);
3397
+ else if (value.length == 7 && value[6] != separator)
3398
+ input.value = value.slice(0, 6) + separator + value.slice(6);
3399
+ else if (value.length >= 9)
3400
+ input.value = value.slice(0, 9);
3401
+ }
3402
+ else if (this._task.mgInputDateFormat == "MMM/dd/yyyy" || this._task.mgInputDateFormat == "MMM-dd-yyyy") {
3403
+ if (value.length == 4 && value[3] != separator)
3404
+ input.value = value.slice(0, 3) + separator + value.slice(3);
3405
+ else if (value.length == 5 && value[4] == separator)
3406
+ input.value = value.slice(0, 4) + '01' + value.slice(4);
3407
+ else if (value.length == 6 && value[5] == separator)
3408
+ input.value = value.slice(0, 4) + '0' + value.slice(4);
3409
+ else if (value.length == 7 && value[6] != separator)
3410
+ input.value = value.slice(0, 6) + separator + value.slice(6);
3411
+ else if (value.length >= 11)
3412
+ input.value = value.slice(0, 11);
3413
+ }
3414
+ }
3415
+ if (cursorPos < input.value.length && input.value.length > this._task.mgInputDateFormat.length) {
3416
+ let inputDate = input.value;
3417
+ let start = input.selectionStart - 1;
3418
+ let end = input.selectionEnd - 1;
3419
+ let indexToRemove = input.selectionStart - 1;
3420
+ input.value = inputDate.slice(0, indexToRemove) + inputDate.slice(indexToRemove + 1);
3421
+ input.setSelectionRange(start, end);
3422
+ }
3423
+ }
3289
3424
  onChangeEvent($event) {
3290
3425
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3291
3426
  let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -3299,6 +3434,170 @@ class MgformatMagicDirective {
3299
3434
  break;
3300
3435
  }
3301
3436
  }
3437
+ onBlurEvent(event) {
3438
+ let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3439
+ let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3440
+ const century = Environment.Instance.GetCentury(LastFocusedManager.Instance.getCurrTask().getCompIdx());
3441
+ if (attr == StorageAttribute.DATE)
3442
+ this.formatDateWithCentury(event.target.value, century, control);
3443
+ }
3444
+ formatDateWithCentury(userInput, century, control) {
3445
+ const dateFormat = this._task.mgInputDateFormat;
3446
+ const separator = userInput.includes('/') ? '/' : "-";
3447
+ let centuryVal = parseInt(century.toString().slice(0, 2));
3448
+ if (userInput.length == 0)
3449
+ return;
3450
+ if ((dateFormat == 'dd/MMM/yyyy' || dateFormat == 'dd-MMM-yyyy')) {
3451
+ const dateArray = userInput.split(separator);
3452
+ const [day, month, year] = this.getDateSegments1(dateArray);
3453
+ const isMonthInNumber = !isNaN(Number(month));
3454
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3455
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3456
+ }
3457
+ }
3458
+ else if ((dateFormat == 'dd/MM/yyyy' || dateFormat == 'dd-MM-yyyy' || dateFormat == 'd/M/yyyy' || dateFormat == 'd-M-yyyy')) {
3459
+ const dateArray = userInput.split(separator);
3460
+ const [day, month, year] = this.getDateSegments1(dateArray);
3461
+ if ((day < 32 && month < 13)) {
3462
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3463
+ }
3464
+ }
3465
+ else if ((dateFormat == 'MM/dd/yyyy' || dateFormat == 'MM-dd-yyyy' || dateFormat == 'M/d/yyyy' || dateFormat == 'M-d-yyyy')) {
3466
+ const dateArray = userInput.split(separator);
3467
+ const [day, month, year] = this.getDateSegments2(dateArray);
3468
+ if ((day < 32 && month < 13)) {
3469
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3470
+ }
3471
+ }
3472
+ else if ((dateFormat == 'MMM/dd/yyyy' || dateFormat == 'MMM-dd-yyyy')) {
3473
+ const dateArray = userInput.split(separator);
3474
+ const [day, month, year] = this.getDateSegments2(dateArray);
3475
+ const isMonthInNumber = !isNaN(Number(month));
3476
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3477
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3478
+ }
3479
+ }
3480
+ else if ((dateFormat == 'yyyy/MM/dd' || dateFormat == 'yyyy-MM-dd')) {
3481
+ const dateArray = userInput.split(separator);
3482
+ const [day, month, year] = this.getDateSegments3(dateArray);
3483
+ if ((day < 32 && month < 13)) {
3484
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3485
+ }
3486
+ }
3487
+ else if ((dateFormat == 'yyyy/dd/MM' || dateFormat == 'yyyy-dd-MM')) {
3488
+ const dateArray = userInput.split(separator);
3489
+ const [day, month, year] = this.getDateSegments4(dateArray);
3490
+ if ((day < 32 && month < 13)) {
3491
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3492
+ }
3493
+ }
3494
+ else if ((dateFormat == 'yyyy/dd/MMM' || dateFormat == 'yyyy-dd-MMM')) {
3495
+ const dateArray = userInput.split(separator);
3496
+ const [day, month, year] = this.getDateSegments4(dateArray);
3497
+ const isMonthInNumber = !isNaN(Number(month));
3498
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3499
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3500
+ }
3501
+ }
3502
+ else if ((dateFormat == 'dd/MM/yy' || dateFormat == 'dd-MM-yy' || dateFormat == 'd/M/yy' || dateFormat == 'd-M-yy')) {
3503
+ const dateArray = userInput.split(separator);
3504
+ const [day, month, year] = this.getDateSegments1(dateArray);
3505
+ if ((day < 32 && month < 13)) {
3506
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3507
+ }
3508
+ }
3509
+ else if ((dateFormat == 'MM/dd/yy' || dateFormat == 'MM-dd-yy' || dateFormat == 'M/d/yy' || dateFormat == 'M-d-yy')) {
3510
+ const dateArray = userInput.split(separator);
3511
+ const [day, month, year] = this.getDateSegments2(dateArray);
3512
+ if ((day < 32 && month < 13)) {
3513
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3514
+ }
3515
+ }
3516
+ else if ((dateFormat == 'yy/MM/dd' || dateFormat == 'yy-MM-dd')) {
3517
+ const dateArray = userInput.split(separator);
3518
+ const [day, month, year] = this.getDateSegments3(dateArray);
3519
+ if ((day < 32 && month < 13)) {
3520
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3521
+ }
3522
+ }
3523
+ else if ((dateFormat == 'yy/dd/MM' || dateFormat == 'yy-dd-MM')) {
3524
+ const dateArray = userInput.split(separator);
3525
+ const [day, month, year] = this.getDateSegments4(dateArray);
3526
+ if ((day < 32 && month < 13)) {
3527
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3528
+ }
3529
+ }
3530
+ else if ((dateFormat == 'dd/MMM/yy' || dateFormat == 'dd-MMM-yy')) {
3531
+ const dateArray = userInput.split(separator);
3532
+ const [day, month, year] = this.getDateSegments1(dateArray);
3533
+ const isMonthInNumber = !isNaN(Number(month));
3534
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3535
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3536
+ }
3537
+ }
3538
+ else if ((dateFormat == 'yy/dd/MMM' || dateFormat == 'yy-dd-MMM')) {
3539
+ const dateArray = userInput.split(separator);
3540
+ const [day, month, year] = this.getDateSegments4(dateArray);
3541
+ const isMonthInNumber = !isNaN(Number(month));
3542
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3543
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3544
+ }
3545
+ }
3546
+ else if ((dateFormat == 'MMM/dd/yy' || dateFormat == 'MMM-dd-yy')) {
3547
+ const dateArray = userInput.split(separator);
3548
+ const [day, month, year] = this.getDateSegments2(dateArray);
3549
+ const isMonthInNumber = !isNaN(Number(month));
3550
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3551
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3552
+ }
3553
+ }
3554
+ else if ((dateFormat == 'yyyy/MMM/dd' || dateFormat == 'yyyy-MMM-dd' || dateFormat == 'yy/MMM/dd' || dateFormat == 'yy-MMM-dd')) {
3555
+ const dateArray = userInput.split(separator);
3556
+ const [day, month, year] = this.getDateSegments3(dateArray);
3557
+ const isMonthInNumber = !isNaN(Number(month));
3558
+ if ((isMonthInNumber && day < 32 && Number(month) < 13) || (!isMonthInNumber && day < 32)) {
3559
+ this.updateYear(day, month, year, separator, century, centuryVal, control);
3560
+ }
3561
+ }
3562
+ else if (dateFormat == 'yyyy/MM' || dateFormat == 'yyyy-MM') {
3563
+ const dateArray = userInput.split(separator);
3564
+ const month = dateArray[1];
3565
+ const year = Number(dateArray[0]);
3566
+ if (Number(month) < 13) {
3567
+ this.updateYear(1, month, year, separator, century, centuryVal, control);
3568
+ }
3569
+ }
3570
+ }
3571
+ updateYear(day, month, year, separator, century, centuryVal, control) {
3572
+ let updatedYear = year.toString().length === 2 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '' + year :
3573
+ year.toString().length === 1 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '0' + year :
3574
+ year;
3575
+ control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
3576
+ }
3577
+ getDateSegments1(dateArray) {
3578
+ const day = Number(dateArray[0]);
3579
+ const month = dateArray[1];
3580
+ const year = Number(dateArray[2]);
3581
+ return [day, month, year];
3582
+ }
3583
+ getDateSegments2(dateArray) {
3584
+ const day = Number(dateArray[1]);
3585
+ const month = dateArray[0];
3586
+ const year = Number(dateArray[2]);
3587
+ return [day, month, year];
3588
+ }
3589
+ getDateSegments3(dateArray) {
3590
+ const day = Number(dateArray[2]);
3591
+ const month = dateArray[1];
3592
+ const year = Number(dateArray[0]);
3593
+ return [day, month, year];
3594
+ }
3595
+ getDateSegments4(dateArray) {
3596
+ const day = Number(dateArray[1]);
3597
+ const month = dateArray[2];
3598
+ const year = Number(dateArray[0]);
3599
+ return [day, month, year];
3600
+ }
3302
3601
  calculatePattern() {
3303
3602
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3304
3603
  if (control != null) {
@@ -3480,7 +3779,7 @@ class MgformatMagicDirective {
3480
3779
  }
3481
3780
  MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
3482
3781
  MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3483
- 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); });
3782
+ 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); });
3484
3783
  } } });
3485
3784
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgformatMagicDirective, [{
3486
3785
  type: Directive,
@@ -3490,12 +3789,18 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
3490
3789
  }], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
3491
3790
  type: HostListener,
3492
3791
  args: ['focus', ['$event']]
3792
+ }], onPaste: [{
3793
+ type: HostListener,
3794
+ args: ['paste', ['$event']]
3493
3795
  }], onInputEvent: [{
3494
3796
  type: HostListener,
3495
3797
  args: ['input', ['$event']]
3496
3798
  }], onChangeEvent: [{
3497
3799
  type: HostListener,
3498
3800
  args: ['change', ['$event']]
3801
+ }], onBlurEvent: [{
3802
+ type: HostListener,
3803
+ args: ['blur', ['$event']]
3499
3804
  }] }); })();
3500
3805
 
3501
3806
  class TimeMagicPipe extends DatePipe {
@@ -3602,14 +3907,14 @@ function SubformMagicComponent_ndc_dynamic_0_Template(rf, ctx) { if (rf & 1) {
3602
3907
  i0.ɵɵproperty("ndcDynamicComponent", ctx_r0.Component)("ndcDynamicInputs", ctx_r0.Parameters);
3603
3908
  } }
3604
3909
  class SubformMagicComponent {
3910
+ set magic(val) { this.id = val; }
3911
+ ;
3605
3912
  constructor(vcRef, mgSub) {
3606
3913
  this.vcRef = vcRef;
3607
3914
  this.mgSub = mgSub;
3608
3915
  this.component = null;
3609
3916
  this.component = (this.vcRef._hostLView).find(v => !isNullOrUndefined(v));
3610
3917
  }
3611
- set magic(val) { this.id = val; }
3612
- ;
3613
3918
  get Component() {
3614
3919
  return this.mgSub.mgGetComp(this.id);
3615
3920
  }
@@ -3622,7 +3927,7 @@ SubformMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SubformMagicCompone
3622
3927
  i0.ɵɵtemplate(0, SubformMagicComponent_ndc_dynamic_0_Template, 1, 2, "ndc-dynamic", 0);
3623
3928
  } if (rf & 2) {
3624
3929
  i0.ɵɵproperty("ngIf", ctx.Component);
3625
- } }, directives: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
3930
+ } }, dependencies: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective], encapsulation: 2 });
3626
3931
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SubformMagicComponent, [{
3627
3932
  type: Component,
3628
3933
  args: [{
@@ -3663,13 +3968,6 @@ function ErrorMagicComponent_div_0_Template(rf, ctx) { if (rf & 1) {
3663
3968
  } }
3664
3969
  const _c1 = ["*"];
3665
3970
  class ErrorMagicComponent {
3666
- constructor(_task, mgService, changeDetectorRef) {
3667
- this._task = _task;
3668
- this.mgService = mgService;
3669
- this.changeDetectorRef = changeDetectorRef;
3670
- this.defaultDisplay = true;
3671
- this.rowId = "0";
3672
- }
3673
3971
  set magic(val) {
3674
3972
  this.id = val;
3675
3973
  }
@@ -3683,6 +3981,13 @@ class ErrorMagicComponent {
3683
3981
  this.changeDetectorRef.detectChanges();
3684
3982
  }
3685
3983
  ;
3984
+ constructor(_task, mgService, changeDetectorRef) {
3985
+ this._task = _task;
3986
+ this.mgService = mgService;
3987
+ this.changeDetectorRef = changeDetectorRef;
3988
+ this.defaultDisplay = true;
3989
+ this.rowId = "0";
3990
+ }
3686
3991
  isEmpty(element) {
3687
3992
  const nodes = element.childNodes;
3688
3993
  for (let i = 0; i < nodes.length; i++) {
@@ -3725,7 +4030,7 @@ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent,
3725
4030
  i0.ɵɵtemplate(0, ErrorMagicComponent_div_0_Template, 5, 1, "div", 0);
3726
4031
  } if (rf & 2) {
3727
4032
  i0.ɵɵproperty("ngIf", ctx.HasErrors(ctx.id));
3728
- } }, directives: [i1.NgIf], encapsulation: 2 });
4033
+ } }, dependencies: [i1.NgIf], encapsulation: 2 });
3729
4034
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ErrorMagicComponent, [{
3730
4035
  type: Component,
3731
4036
  args: [{
@@ -3752,17 +4057,79 @@ ErrorMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ErrorMagicComponent,
3752
4057
  }] }); })();
3753
4058
 
3754
4059
  class CheckboxMagicDirective {
3755
- constructor(magicDirective) {
4060
+ constructor(magicDirective, el, task) {
3756
4061
  this.magicDirective = magicDirective;
4062
+ this.el = el;
4063
+ this.task = task;
4064
+ this.threeState = false;
4065
+ this.subscribeRefreshDom = null;
4066
+ this.isIndeterminate = false;
3757
4067
  }
3758
4068
  onChange($event) {
3759
- this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
4069
+ if (this.threeState) {
4070
+ this.handleThreeState();
4071
+ }
4072
+ else {
4073
+ this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
4074
+ }
4075
+ }
4076
+ ngOnInit() {
4077
+ if (this.threeState) {
4078
+ let guiEvent = getGuiEventObj("setAsThreeState", this.magicDirective.id, +this.magicDirective.rowId);
4079
+ this.task.insertEvent(guiEvent);
4080
+ this.el.nativeElement.indeterminate = this.isIndeterminate = this.task.getProperty(this.magicDirective.id, HtmlProperties.CheckBoxIndeterminate, this.magicDirective.rowId);
4081
+ this.regUpdatesUI();
4082
+ }
4083
+ }
4084
+ regUpdatesUI() {
4085
+ this.subscribeRefreshDom = this.task
4086
+ .refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c)))
4087
+ .subscribe(a => {
4088
+ let command = a;
4089
+ try {
4090
+ this.handleCommand(command);
4091
+ }
4092
+ catch (ex) {
4093
+ console.dir(ex);
4094
+ }
4095
+ });
4096
+ }
4097
+ handleCommand(command) {
4098
+ if (command.CommandType == CommandType.SET_PROPERTY &&
4099
+ command.Operation == HtmlProperties.CheckBoxIndeterminate) {
4100
+ this.isIndeterminate = this.el.nativeElement.indeterminate = command.obj1;
4101
+ }
4102
+ }
4103
+ handleThreeState() {
4104
+ let value = '';
4105
+ let prevCheckedValue = this.task.getValue(this.magicDirective.id, this.magicDirective.rowId);
4106
+ const checkbox = this.el.nativeElement;
4107
+ if (this.isIndeterminate) {
4108
+ checkbox.checked = false;
4109
+ checkbox.indeterminate = false;
4110
+ value = 'unchecked';
4111
+ }
4112
+ else if (prevCheckedValue) {
4113
+ checkbox.checked = false;
4114
+ checkbox.indeterminate = true;
4115
+ value = 'indeterminate';
4116
+ }
4117
+ else if (!prevCheckedValue) {
4118
+ checkbox.checked = true;
4119
+ checkbox.indeterminate = false;
4120
+ value = 'checked';
4121
+ }
4122
+ this.magicDirective.task.onCheckChanged(value, this.magicDirective.id, +this.magicDirective.rowId);
4123
+ }
4124
+ ngOnDestroy() {
4125
+ if (this.subscribeRefreshDom !== null)
4126
+ this.subscribeRefreshDom.unsubscribe();
3760
4127
  }
3761
4128
  }
3762
- CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
4129
+ CheckboxMagicDirective.ɵfac = function CheckboxMagicDirective_Factory(t) { return new (t || CheckboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(TaskMagicService)); };
3763
4130
  CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirective, selectors: [["input", "type", "checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function CheckboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
3764
4131
  i0.ɵɵlistener("change", function CheckboxMagicDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
3765
- } } });
4132
+ } }, inputs: { threeState: "threeState" } });
3766
4133
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckboxMagicDirective, [{
3767
4134
  type: Directive,
3768
4135
  args: [{
@@ -3770,7 +4137,9 @@ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirec
3770
4137
  input[type=checkbox][magic]:not([noFormControl])
3771
4138
  `,
3772
4139
  }]
3773
- }], function () { return [{ type: MagicDirective }]; }, { onChange: [{
4140
+ }], function () { return [{ type: MagicDirective }, { type: i0.ElementRef }, { type: TaskMagicService }]; }, { threeState: [{
4141
+ type: Input
4142
+ }], onChange: [{
3774
4143
  type: HostListener,
3775
4144
  args: ['change', ['$event']]
3776
4145
  }] }); })();
@@ -3778,10 +4147,18 @@ CheckboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: CheckboxMagicDirec
3778
4147
  class ComboboxMagicDirective {
3779
4148
  constructor(magicDirective) {
3780
4149
  this.magicDirective = magicDirective;
4150
+ this.magicDirective.task.refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c))).subscribe(value => {
4151
+ let command = value;
4152
+ if (command.Operation === HtmlProperties.ItemsList)
4153
+ this.onComboboxItemsListChanged();
4154
+ });
3781
4155
  }
3782
4156
  onChange($event) {
3783
4157
  this.magicDirective.task.onComboboxSelectionChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
3784
4158
  }
4159
+ onComboboxItemsListChanged() {
4160
+ this.magicDirective.task.refreshView();
4161
+ }
3785
4162
  }
3786
4163
  ComboboxMagicDirective.ɵfac = function ComboboxMagicDirective_Factory(t) { return new (t || ComboboxMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective)); };
3787
4164
  ComboboxMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: ComboboxMagicDirective, selectors: [["select", "magic", "", 3, "multiple", ""]], hostBindings: function ComboboxMagicDirective_HostBindings(rf, ctx) { if (rf & 1) {
@@ -3951,13 +4328,10 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
3951
4328
  i0.ɵɵproperty("ngIf", ctx.RootComponent !== null);
3952
4329
  i0.ɵɵadvance(3);
3953
4330
  i0.ɵɵproperty("ngIf", ctx.showSpinner);
3954
- } }, directives: [i1.NgIf, i3.DynamicComponent, i3.DynamicIoDirective, MagicViewContainerRef, i1.NgTemplateOutlet], 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:spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;z-index:1000;inset:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"] });
4331
+ } }, 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)}}"] });
3955
4332
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
3956
4333
  type: Component,
3957
- args: [{
3958
- selector: 'magic-root',
3959
- providers: [],
3960
- template: `
4334
+ args: [{ selector: 'magic-root', providers: [], template: `
3961
4335
  <div #magicRoot>
3962
4336
  <ndc-dynamic
3963
4337
  *ngIf = "RootComponent !== null"
@@ -3976,38 +4350,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
3976
4350
  <ng-template #defaultSpinner>
3977
4351
  <div class="mgSpinnerClass"></div>
3978
4352
  </ng-template>
3979
- `,
3980
- styles: [`
3981
- .mgSpinnerClass {
3982
- border: 10px solid #cccccc; /* Light grey */
3983
- border-top: 10px solid black; /* Blue */
3984
- border-radius: 50%;
3985
- position: fixed;
3986
- margin: auto;
3987
- top: 0;
3988
- right: 0;
3989
- bottom: 0;
3990
- left: 0;
3991
- width: 100px;
3992
- height: 100px;
3993
- animation: spin 2s linear infinite;
3994
- }
3995
- .spinner-background {
3996
- /* background fixed across whole screen */
3997
- position: fixed;
3998
- top: 0;
3999
- right: 0;
4000
- bottom: 0;
4001
- z-index: 1000;
4002
- left: 0;
4003
- opacity: 0.5;
4004
- }
4005
- @keyframes spin {
4006
- 0% { transform: rotate(0deg); }
4007
- 100% { transform: rotate(360deg); }
4008
- }
4009
- `]
4010
- }]
4353
+ `, 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"] }]
4011
4354
  }], function () { return [{ type: EngineMagicService }, { type: ComponentListMagicService }, { type: i0.ChangeDetectorRef }, { type: i1$1.Title }, { type: OverlayWindowService }, { type: i1$2.HttpClient }, { type: CommandsCollectorMagicService }, { type: ExitMagicService, decorators: [{
4012
4355
  type: Optional
4013
4356
  }] }]; }, { rootMagicElementRef: [{
@@ -4129,12 +4472,33 @@ const DATE_VALUE_ACCESSOR = {
4129
4472
  multi: true
4130
4473
  };
4131
4474
  class DateValueAccessor {
4132
- constructor(renderer, elementRef) {
4475
+ onBlurEvent(event) {
4476
+ const century = Environment.Instance.GetCentury(LastFocusedManager.Instance.getCurrTask().getCompIdx());
4477
+ let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
4478
+ this.formatDateWithCentury(event.target.value, century, control);
4479
+ }
4480
+ constructor(renderer, elementRef, magicDir, _task) {
4133
4481
  this.renderer = renderer;
4134
4482
  this.elementRef = elementRef;
4483
+ this.magicDir = magicDir;
4484
+ this._task = _task;
4135
4485
  this.onChange = (_) => { };
4136
4486
  this.onTouched = () => { };
4137
4487
  }
4488
+ formatDateWithCentury(userInput, century, control) {
4489
+ const separator = userInput.includes('/') ? '/' : "-";
4490
+ let centuryVal = parseInt(century.toString().slice(0, 2));
4491
+ if (userInput.length == 0)
4492
+ return;
4493
+ const dateArray = userInput.split(separator);
4494
+ const day = Number(dateArray[2]);
4495
+ const month = Number(dateArray[1]);
4496
+ const year = Number(dateArray[0]);
4497
+ let updatedYear = year.toString().length === 2 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '' + year :
4498
+ year.toString().length === 1 ? (year < century % 100 ? centuryVal + 1 : centuryVal) + '0' + year :
4499
+ year;
4500
+ control.setValue(new Date(`${updatedYear}${separator}${month}${separator}${day}`));
4501
+ }
4138
4502
  writeValue(value) {
4139
4503
  if (!value) {
4140
4504
  this.renderer.setProperty(this.elementRef.nativeElement, "value", null);
@@ -4154,9 +4518,9 @@ class DateValueAccessor {
4154
4518
  this.renderer.setProperty(this.elementRef.nativeElement, "disabled", isDisabled);
4155
4519
  }
4156
4520
  }
4157
- DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef)); };
4521
+ DateValueAccessor.ɵfac = function DateValueAccessor_Factory(t) { return new (t || DateValueAccessor)(i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
4158
4522
  DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, selectors: [["", "dateInput", ""]], hostBindings: function DateValueAccessor_HostBindings(rf, ctx) { if (rf & 1) {
4159
- i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler() { return ctx.onTouched(); });
4523
+ i0.ɵɵlistener("input", function DateValueAccessor_input_HostBindingHandler($event) { return ctx.onChange($event.target.valueAsDate); })("blur", function DateValueAccessor_blur_HostBindingHandler($event) { return ctx.onBlurEvent($event); });
4160
4524
  } }, features: [i0.ɵɵProvidersFeature([DATE_VALUE_ACCESSOR])] });
4161
4525
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DateValueAccessor, [{
4162
4526
  type: Directive,
@@ -4164,15 +4528,23 @@ DateValueAccessor.ɵdir = i0.ɵɵdefineDirective({ type: DateValueAccessor, sele
4164
4528
  selector: "[dateInput]",
4165
4529
  providers: [DATE_VALUE_ACCESSOR]
4166
4530
  }]
4167
- }], function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, { onChange: [{
4531
+ }], function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: MagicDirective }, { type: TaskMagicService }]; }, { onChange: [{
4168
4532
  type: HostListener,
4169
4533
  args: ["input", ["$event.target.valueAsDate"]]
4170
4534
  }], onTouched: [{
4171
4535
  type: HostListener,
4172
4536
  args: ["blur", []]
4537
+ }], onBlurEvent: [{
4538
+ type: HostListener,
4539
+ args: ['blur', ['$event']]
4173
4540
  }] }); })();
4174
4541
 
4175
4542
  class NonMagicControlDirective {
4543
+ set magic(val) {
4544
+ this.id = val;
4545
+ this.selector = 'NonMagicControl';
4546
+ }
4547
+ ;
4176
4548
  constructor(_task, element, renderer, vcRef) {
4177
4549
  this._task = _task;
4178
4550
  this.element = element;
@@ -4182,11 +4554,6 @@ class NonMagicControlDirective {
4182
4554
  this.eventsOnlyVal = false;
4183
4555
  this.htmlElement = this.element.nativeElement;
4184
4556
  }
4185
- set magic(val) {
4186
- this.id = val;
4187
- this.selector = 'NonMagicControl';
4188
- }
4189
- ;
4190
4557
  get task() {
4191
4558
  return this._task;
4192
4559
  }
@@ -4216,6 +4583,36 @@ NonMagicControlDirective.ɵdir = i0.ɵɵdefineDirective({ type: NonMagicControlD
4216
4583
  args: ['NonMagicControl']
4217
4584
  }] }); })();
4218
4585
 
4586
+ class Time24MagicPipe {
4587
+ constructor(_task) {
4588
+ this._task = _task;
4589
+ }
4590
+ transform(value, controlId) {
4591
+ let mask = this._task.GetControlPictureMask(controlId).getMask();
4592
+ if (typeof value !== "undefined" && mask !== null) {
4593
+ const date = new Date(value);
4594
+ const hours = date.getHours().toString().padStart(2, '0');
4595
+ const minutes = date.getMinutes().toString().padStart(2, '0');
4596
+ const seconds = date.getSeconds().toString().padStart(2, '0');
4597
+ if (mask.length == 5) {
4598
+ return `${hours}:${minutes}`;
4599
+ }
4600
+ else if (mask.length > 5) {
4601
+ return `${hours}:${minutes}:${seconds}`;
4602
+ }
4603
+ }
4604
+ return value;
4605
+ }
4606
+ }
4607
+ Time24MagicPipe.ɵfac = function Time24MagicPipe_Factory(t) { return new (t || Time24MagicPipe)(i0.ɵɵdirectiveInject(TaskMagicService, 16)); };
4608
+ Time24MagicPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "magicTime24", type: Time24MagicPipe, pure: true });
4609
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Time24MagicPipe, [{
4610
+ type: Pipe,
4611
+ args: [{
4612
+ name: 'magicTime24'
4613
+ }]
4614
+ }], function () { return [{ type: TaskMagicService }]; }, null); })();
4615
+
4219
4616
  const decs = [
4220
4617
  MagicDirective,
4221
4618
  CheckboxMagicDirective,
@@ -4244,25 +4641,24 @@ const decs = [
4244
4641
  RangeValidatorMagicDirective,
4245
4642
  NonMagicControlDirective,
4246
4643
  MagicFocusDirective,
4247
- MagicViewContainerRef
4644
+ MagicViewContainerRef,
4645
+ Time24MagicPipe
4248
4646
  ];
4249
4647
  class MagicModule {
4250
4648
  }
4251
4649
  MagicModule.ɵfac = function MagicModule_Factory(t) { return new (t || MagicModule)(); };
4252
4650
  MagicModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicModule });
4253
- MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [[
4254
- CommonModule,
4255
- FormsModule,
4256
- ReactiveFormsModule,
4257
- RouterModule,
4258
- DynamicModule,
4259
- HttpClientModule
4260
- ]] });
4651
+ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMagicProvider, OverlayContainerMagicProvider], imports: [CommonModule,
4652
+ FormsModule,
4653
+ ReactiveFormsModule,
4654
+ RouterModule,
4655
+ DynamicModule,
4656
+ HttpClientModule, MaskitoModule] });
4261
4657
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
4262
4658
  type: NgModule,
4263
4659
  args: [{
4264
4660
  declarations: [...decs],
4265
- exports: [...decs],
4661
+ exports: [...decs, MaskitoModule],
4266
4662
  entryComponents: [],
4267
4663
  imports: [
4268
4664
  CommonModule,
@@ -4302,7 +4698,8 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4302
4698
  RangeValidatorMagicDirective,
4303
4699
  NonMagicControlDirective,
4304
4700
  MagicFocusDirective,
4305
- MagicViewContainerRef], imports: [CommonModule,
4701
+ MagicViewContainerRef,
4702
+ Time24MagicPipe], imports: [CommonModule,
4306
4703
  FormsModule,
4307
4704
  ReactiveFormsModule,
4308
4705
  RouterModule,
@@ -4334,7 +4731,8 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4334
4731
  RangeValidatorMagicDirective,
4335
4732
  NonMagicControlDirective,
4336
4733
  MagicFocusDirective,
4337
- MagicViewContainerRef] }); })();
4734
+ MagicViewContainerRef,
4735
+ Time24MagicPipe, MaskitoModule] }); })();
4338
4736
 
4339
4737
  const MG_FORMATS = {
4340
4738
  parse: { dateInput: { month: 'short', year: 'numeric', day: 'numeric' } },
@@ -4516,5 +4914,5 @@ class ModalFormDefinition {
4516
4914
  }
4517
4915
  }
4518
4916
 
4519
- 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 };
4917
+ 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 };
4520
4918
  //# sourceMappingURL=magic-xpa-angular.mjs.map