@magic-xpa/angular 4.900.0-dev491.7 → 4.901.0-dev491.1

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.
@@ -10,14 +10,14 @@ import * as i3 from 'ng-dynamic-component';
10
10
  import { DynamicModule } from 'ng-dynamic-component';
11
11
  import { InteractiveCommandType, OverlayType, Styles, HtmlProperties, GuiConstants, CommandType, PIC, GuiEnvironment, Modifiers } from '@magic-xpa/gui';
12
12
  import { MagicBridge, getGuiEventObj, CookieService } from '@magic-xpa/engine';
13
- import { MagicProperties, Logger, StrUtil, StorageAttribute, BindingLevel, StorageAttributeType, PICInterface } from '@magic-xpa/utils';
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
18
  import * as i1$2 from '@angular/common/http';
19
19
  import { HttpClientModule } from '@angular/common/http';
20
- import { NativeDateAdapter, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
20
+ import { NativeDateAdapter, MAT_DATE_LOCALE, DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
21
21
  import * as i1$3 from '@angular/cdk/platform';
22
22
 
23
23
  class ControlMetadata {
@@ -318,8 +318,8 @@ class EngineMagicService {
318
318
  GetControlPictureMask(taskId, controlName) {
319
319
  return this.magicBridge.GetControlPictureMask(taskId, controlName);
320
320
  }
321
- GetFormattedValue(taskId, controlName, value) {
322
- return this.magicBridge.GetFormattedValue(taskId, controlName, value);
321
+ GetFormattedValue(taskId, controlName, value, rowId) {
322
+ return this.magicBridge.GetFormattedValue(taskId, controlName, value, rowId);
323
323
  }
324
324
  ValidateControlValue(taskId, controlName, value) {
325
325
  return this.magicBridge.ValidateControlValue(taskId, controlName, value);
@@ -993,7 +993,7 @@ MagicOverlayContainerWrapper.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlay
993
993
  i0.ɵɵelement(6, "div", 5);
994
994
  i0.ɵɵelementEnd();
995
995
  }
996
- }, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;top:0;z-index:999;right:0;bottom:0;left:0}"] });
996
+ }, directives: [MagicFocusDirective, MagicViewContainerRef], styles: [".overlay-container-wrapper-background[_ngcontent-%COMP%]{position:fixed;z-index:999;inset:0}"] });
997
997
  (function () {
998
998
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainerWrapper, [{
999
999
  type: Component,
@@ -1206,7 +1206,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1206
1206
  i0.ɵɵadvance(1);
1207
1207
  i0.ɵɵproperty("ngStyle", ctx.getClientAreaStyles());
1208
1208
  }
1209
- }, directives: [i1.NgIf, i1.NgStyle, MagicViewContainerRef], styles: [".modal-foreground[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#fff}.modal-background[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"] });
1209
+ }, 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}"] });
1210
1210
  (function () {
1211
1211
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicOverlayContainer, [{
1212
1212
  type: Component,
@@ -1226,7 +1226,7 @@ MagicOverlayContainer.ɵcmp = i0.ɵɵdefineComponent({ type: MagicOverlayContain
1226
1226
  </div>
1227
1227
  </div>
1228
1228
  </div>
1229
- `, styles: [".modal-foreground{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#fff}.modal-background{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
1229
+ `, styles: [".modal-foreground{position:fixed;inset:0;background-color:#fff}.modal-background{position:fixed;inset:0;background-color:#000;opacity:.75}.modal-header{background-color:beige;border-bottom:2px solid red}\n"] }]
1230
1230
  }], function () { return [{ type: i0.ComponentFactoryResolver }]; }, { headerElementRef: [{
1231
1231
  type: ViewChild,
1232
1232
  args: ['modalheader', { static: false }]
@@ -1812,8 +1812,8 @@ class TaskMagicService {
1812
1812
  guiRowId = '0';
1813
1813
  return this.Records.list.length > +guiRowId ? this.Records.list[guiRowId].values[controlId] : '';
1814
1814
  }
1815
- getFormattedValue(controlName, val) {
1816
- return this.magic.GetFormattedValue(this.taskId, controlName, val);
1815
+ getFormattedValue(controlName, val, rowId) {
1816
+ return this.magic.GetFormattedValue(this.taskId, controlName, val, rowId);
1817
1817
  }
1818
1818
  setValue(controlId, guiRowId, value) {
1819
1819
  return this.Records.list[guiRowId].setValue(controlId, value);
@@ -2021,7 +2021,10 @@ class TaskMagicService {
2021
2021
  return val;
2022
2022
  }
2023
2023
  case StorageAttribute.NUMERIC:
2024
- return (val === null) ? 0 : val;
2024
+ if (isUndefined(val))
2025
+ return val;
2026
+ else
2027
+ return (val != null) ? +val : null;
2025
2028
  default:
2026
2029
  return val;
2027
2030
  }
@@ -2252,7 +2255,7 @@ class TableMagicService {
2252
2255
  this.task.onScrollDown();
2253
2256
  }
2254
2257
  sortData(e) { }
2255
- mgOnPaginateChange(e) { }
2258
+ mgOnPaginateChange(e, changeSelectedRow) { }
2256
2259
  mgOptionChanged(e) { }
2257
2260
  updateTableSize(size) {
2258
2261
  if (size === 0) {
@@ -2409,9 +2412,9 @@ class AccessorMagicService {
2409
2412
  let properties;
2410
2413
  properties = this.task.Records.list[0].getControlMetadata(controlId);
2411
2414
  if (properties.properties.get(HtmlProperties.ReadOnly) !== null && properties.properties.get(HtmlProperties.ReadOnly) === true)
2412
- return false;
2413
- else
2414
2415
  return true;
2416
+ else
2417
+ return false;
2415
2418
  }
2416
2419
  getText(controlId, rowId) {
2417
2420
  return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
@@ -2441,6 +2444,29 @@ class AccessorMagicService {
2441
2444
  let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
2442
2445
  return vis ? 'visible' : 'hidden';
2443
2446
  }
2447
+ getAlphaMask(controlId, rowId) {
2448
+ if (isNullOrUndefined(controlId))
2449
+ return null;
2450
+ let pic = this.task.GetControlPictureMask(controlId);
2451
+ let mask = pic.getMask();
2452
+ let valueStr = new StringBuilder();
2453
+ for (let i = 0; i < mask.length; i++) {
2454
+ switch (mask.charCodeAt(i)) {
2455
+ case PICInterface.PIC_N:
2456
+ valueStr.Append("0");
2457
+ break;
2458
+ case PICInterface.PIC_U:
2459
+ case PICInterface.PIC_L:
2460
+ case PICInterface.PIC_X:
2461
+ valueStr.Append("A");
2462
+ break;
2463
+ default:
2464
+ valueStr.Append(mask.charAt(i));
2465
+ break;
2466
+ }
2467
+ }
2468
+ return (pic != null) ? valueStr.toString() : null;
2469
+ }
2444
2470
  getNumericPicture(picture) {
2445
2471
  var obj = {};
2446
2472
  if (isNullOrUndefined(picture))
@@ -2509,7 +2535,7 @@ class AccessorMagicService {
2509
2535
  }
2510
2536
  getFormattedValue(controlId, rowId) {
2511
2537
  let val = this.task.getValue(controlId, rowId);
2512
- val = this.task.getFormattedValue(controlId, val);
2538
+ val = this.task.getFormattedValue(controlId, val, rowId);
2513
2539
  return val;
2514
2540
  }
2515
2541
  getPicture(controlId, rowId) {
@@ -2858,16 +2884,16 @@ class MagicDirective {
2858
2884
  this.eventHandlers = {};
2859
2885
  this.eventsOnlyVal = false;
2860
2886
  this.htmlElement = this.element.nativeElement;
2861
- if (!(typeof magicRow === 'undefined' || magicRow === null))
2887
+ if (!(typeof magicRow === "undefined" || magicRow === null))
2862
2888
  this.rowId = magicRow.rowId;
2863
2889
  }
2864
2890
  set magic(val) {
2865
2891
  this.id = val;
2866
- this.selector = 'magic';
2892
+ this.selector = "magic";
2867
2893
  }
2868
2894
  ;
2869
2895
  set eventsOnly(val) {
2870
- console.log('eventsOnly');
2896
+ console.log("eventsOnly");
2871
2897
  this.eventsOnlyVal = true;
2872
2898
  }
2873
2899
  ;
@@ -2875,11 +2901,11 @@ class MagicDirective {
2875
2901
  return this._task;
2876
2902
  }
2877
2903
  regEvents() {
2878
- this.eventHandlers['focusin'] = this.OnFocus.bind(this);
2904
+ this.eventHandlers["focusin"] = this.OnFocus.bind(this);
2879
2905
  Object.keys(this.eventHandlers).forEach((key) => {
2880
2906
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
2881
2907
  });
2882
- let events = ['click', 'mousedown', 'dblclick'];
2908
+ let events = ["click", "mousedown", "dblclick"];
2883
2909
  events.forEach(event => {
2884
2910
  this.renderer.listen(this.htmlElement, event, (e) => {
2885
2911
  let fromButton = false;
@@ -2890,15 +2916,15 @@ class MagicDirective {
2890
2916
  e.cancelBubble = true;
2891
2917
  });
2892
2918
  });
2893
- this.renderer.listen(this.htmlElement, 'change', (e) => {
2894
- let guiEvent = getGuiEventObj('selectionchanged', this.id, +this.rowId);
2919
+ this.renderer.listen(this.htmlElement, "change", (e) => {
2920
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, +this.rowId);
2895
2921
  if ((event.target).selectedIndex !== undefined) {
2896
2922
  guiEvent.Value = (event.target).selectedIndex.toString();
2897
2923
  e.cancelBubble = true;
2898
2924
  this.task.insertEvent(guiEvent);
2899
2925
  }
2900
2926
  });
2901
- fromEvent(this.htmlElement, 'input').pipe(map((event) => {
2927
+ fromEvent(this.htmlElement, "input").pipe(map((event) => {
2902
2928
  return event.target.value;
2903
2929
  }), debounceTime(200)).subscribe((x) => {
2904
2930
  if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
@@ -2907,8 +2933,8 @@ class MagicDirective {
2907
2933
  this.task.mgAccessorService.setValueToControl(this.id, x, true);
2908
2934
  }
2909
2935
  });
2910
- this.renderer.listen(this.htmlElement, 'keydown', (e) => {
2911
- let guiEvent = getGuiEventObj('keydown', this.id, +this.rowId);
2936
+ this.renderer.listen(this.htmlElement, "keydown", (e) => {
2937
+ let guiEvent = getGuiEventObj("keydown", this.id, +this.rowId);
2912
2938
  guiEvent.modifiers = Modifiers.MODIFIER_NONE;
2913
2939
  if (e.altKey && e.keyCode !== GuiConstants.KEY_ALT)
2914
2940
  guiEvent.modifiers = Modifiers.MODIFIER_ALT;
@@ -2934,7 +2960,7 @@ class MagicDirective {
2934
2960
  });
2935
2961
  }
2936
2962
  OnFocus() {
2937
- this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
2963
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
2938
2964
  event.cancelBubble = true;
2939
2965
  }
2940
2966
  IsSameElement(command) {
@@ -2954,7 +2980,7 @@ class MagicDirective {
2954
2980
  .subscribe(a => {
2955
2981
  let command = a;
2956
2982
  if (isNullOrUndefined(this.rowId))
2957
- this.rowId = '0';
2983
+ this.rowId = "0";
2958
2984
  try {
2959
2985
  if (!this.eventsOnlyVal)
2960
2986
  this.handleCommand(command);
@@ -2982,7 +3008,7 @@ class MagicDirective {
2982
3008
  this.focusUnlistener();
2983
3009
  if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
2984
3010
  this.htmlElement.focus();
2985
- this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
3011
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
2986
3012
  break;
2987
3013
  }
2988
3014
  }
@@ -2992,13 +3018,13 @@ class MagicDirective {
2992
3018
  let methodName = command._str;
2993
3019
  let args = command.arguments;
2994
3020
  let magicComponent = (this.vcRef._hostLView).find(v => v instanceof TaskBaseMagicComponent);
2995
- let resultString = '';
3021
+ let resultString = "";
2996
3022
  try {
2997
3023
  if (!isNullOrUndefined(magicComponent[methodName])) {
2998
3024
  resultString = magicComponent[methodName].apply(magicComponent, args);
2999
3025
  }
3000
3026
  else
3001
- console.error('Instance method ' + methodName + ' does not exists');
3027
+ console.error("Instance method " + methodName + " does not exists");
3002
3028
  }
3003
3029
  catch (e) {
3004
3030
  console.error(e.message);
@@ -3010,10 +3036,13 @@ class MagicDirective {
3010
3036
  handleSetProperty(command) {
3011
3037
  switch (command.Operation) {
3012
3038
  case HtmlProperties.ReadOnly:
3013
- if (command.obj1 != true)
3014
- this.renderer.removeAttribute(this.htmlElement, command.Operation);
3015
- else
3016
- this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
3039
+ {
3040
+ if (command.obj.Type == MgControlType.CTRL_TYPE_TEXT)
3041
+ if (command.obj1 != true)
3042
+ this.renderer.removeAttribute(this.htmlElement, command.Operation);
3043
+ else
3044
+ this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
3045
+ }
3017
3046
  break;
3018
3047
  }
3019
3048
  }
@@ -3029,7 +3058,7 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3029
3058
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
3030
3059
  type: Directive,
3031
3060
  args: [{
3032
- selector: '[magic]'
3061
+ selector: "[magic]"
3033
3062
  }]
3034
3063
  }], function () {
3035
3064
  return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
@@ -3037,10 +3066,10 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3037
3066
  }] }];
3038
3067
  }, { magic: [{
3039
3068
  type: Input,
3040
- args: ['magic']
3069
+ args: ["magic"]
3041
3070
  }], eventsOnly: [{
3042
3071
  type: Input,
3043
- args: ['eventsOnly']
3072
+ args: ["eventsOnly"]
3044
3073
  }], rowId: [{
3045
3074
  type: Input
3046
3075
  }] });
@@ -3345,6 +3374,25 @@ class MgformatMagicDirective {
3345
3374
  }
3346
3375
  }
3347
3376
  onFocusEvent($event) {
3377
+ this.calculatePattern();
3378
+ }
3379
+ onInputEvent($event) {
3380
+ this.calculatePattern();
3381
+ }
3382
+ onChangeEvent($event) {
3383
+ let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3384
+ let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3385
+ switch (attr) {
3386
+ case StorageAttribute.ALPHA:
3387
+ case StorageAttribute.UNICODE:
3388
+ this.formatAlphaUnicode(control);
3389
+ break;
3390
+ case StorageAttribute.BOOLEAN:
3391
+ this.formatBoolean(control);
3392
+ break;
3393
+ }
3394
+ }
3395
+ calculatePattern() {
3348
3396
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3349
3397
  if (control != null) {
3350
3398
  let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -3361,26 +3409,22 @@ class MgformatMagicDirective {
3361
3409
  if (attr == StorageAttribute.ALPHA || attr == StorageAttribute.UNICODE) {
3362
3410
  if (control.validator == null)
3363
3411
  control.setValidators(Validators.maxLength(pic.getMaskLength()));
3364
- else
3365
- control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
3412
+ else {
3413
+ if (pic.isFormatExp()) {
3414
+ control.setValidators(Validators.maxLength(pic.getMaskLength()));
3415
+ if (isUndefined(this.magicDir.rowId))
3416
+ this.magicDir.rowId = '0';
3417
+ control.setValidators([control.validator, this._task.customValidator(this.magicDir.rowId, this.magicDir.id)]);
3418
+ }
3419
+ else
3420
+ control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
3421
+ }
3422
+ control.updateValueAndValidity();
3366
3423
  }
3367
3424
  }
3368
3425
  }
3369
3426
  }
3370
3427
  }
3371
- onChangeEvent($event) {
3372
- let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3373
- let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3374
- switch (attr) {
3375
- case StorageAttribute.ALPHA:
3376
- case StorageAttribute.UNICODE:
3377
- this.formatAlphaUnicode(control);
3378
- break;
3379
- case StorageAttribute.BOOLEAN:
3380
- this.formatBoolean(control);
3381
- break;
3382
- }
3383
- }
3384
3428
  formatDate(pic) {
3385
3429
  let mgDateFormatter = new MgDateFormatter();
3386
3430
  this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
@@ -3530,7 +3574,7 @@ class MgformatMagicDirective {
3530
3574
  MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
3531
3575
  MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
3532
3576
  if (rf & 1) {
3533
- i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
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); });
3534
3578
  }
3535
3579
  } });
3536
3580
  (function () {
@@ -3542,6 +3586,9 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
3542
3586
  }], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
3543
3587
  type: HostListener,
3544
3588
  args: ['focus', ['$event']]
3589
+ }], onInputEvent: [{
3590
+ type: HostListener,
3591
+ args: ['input', ['$event']]
3545
3592
  }], onChangeEvent: [{
3546
3593
  type: HostListener,
3547
3594
  args: ['change', ['$event']]
@@ -4053,7 +4100,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
4053
4100
  i0.ɵɵadvance(3);
4054
4101
  i0.ɵɵproperty("ngIf", ctx.showSpinner);
4055
4102
  }
4056
- }, 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;top:0;right:0;bottom:0;left:0;width:100px;height:100px;animation:spin 2s linear infinite}.spinner-background[_ngcontent-%COMP%]{position:fixed;top:0;right:0;bottom:0;z-index:1000;left:0;opacity:.5}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"] });
4103
+ }, 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)}}"] });
4057
4104
  (function () {
4058
4105
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
4059
4106
  type: Component,
@@ -4478,11 +4525,13 @@ const MG_FORMATS = {
4478
4525
  }
4479
4526
  };
4480
4527
  class MgDateAdapter extends NativeDateAdapter {
4481
- constructor(platform, task) {
4482
- super('en-US', platform);
4528
+ constructor(platform, task, localeId) {
4529
+ super(localeId, platform);
4483
4530
  this.platform = platform;
4484
4531
  this.task = task;
4532
+ this.localeId = localeId;
4485
4533
  this.mgdtfmt = null;
4534
+ this.setLocale(localeId);
4486
4535
  }
4487
4536
  parse(value) {
4488
4537
  let valueStr = value;
@@ -4542,7 +4591,7 @@ class MgDateAdapter extends NativeDateAdapter {
4542
4591
  }
4543
4592
  if (month == 0 && year == 0 && date == 0)
4544
4593
  return null;
4545
- return new Date(Date.UTC(year, month, date));
4594
+ return new Date(year, month, date);
4546
4595
  }
4547
4596
  }
4548
4597
  format(date, displayFormat) {
@@ -4558,12 +4607,17 @@ class MgDateAdapter extends NativeDateAdapter {
4558
4607
  }
4559
4608
  }
4560
4609
  }
4561
- MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService)); };
4610
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
4562
4611
  MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4563
4612
  (function () {
4564
4613
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
4565
4614
  type: Injectable
4566
- }], function () { return [{ type: i1$3.Platform }, { type: TaskMagicService }]; }, null);
4615
+ }], function () {
4616
+ return [{ type: i1$3.Platform }, { type: TaskMagicService }, { type: undefined, decorators: [{
4617
+ type: Inject,
4618
+ args: [MAT_DATE_LOCALE]
4619
+ }] }];
4620
+ }, null);
4567
4621
  })();
4568
4622
 
4569
4623
  const matDateProviders = [