@magic-xpa/angular 4.900.0-dev491.7 → 4.1000.0-dev000.0

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,7 @@ class TaskMagicService {
2021
2021
  return val;
2022
2022
  }
2023
2023
  case StorageAttribute.NUMERIC:
2024
- return (val === null) ? 0 : val;
2024
+ return +val;
2025
2025
  default:
2026
2026
  return val;
2027
2027
  }
@@ -2252,7 +2252,7 @@ class TableMagicService {
2252
2252
  this.task.onScrollDown();
2253
2253
  }
2254
2254
  sortData(e) { }
2255
- mgOnPaginateChange(e) { }
2255
+ mgOnPaginateChange(e, changeSelectedRow) { }
2256
2256
  mgOptionChanged(e) { }
2257
2257
  updateTableSize(size) {
2258
2258
  if (size === 0) {
@@ -2409,9 +2409,9 @@ class AccessorMagicService {
2409
2409
  let properties;
2410
2410
  properties = this.task.Records.list[0].getControlMetadata(controlId);
2411
2411
  if (properties.properties.get(HtmlProperties.ReadOnly) !== null && properties.properties.get(HtmlProperties.ReadOnly) === true)
2412
- return false;
2413
- else
2414
2412
  return true;
2413
+ else
2414
+ return false;
2415
2415
  }
2416
2416
  getText(controlId, rowId) {
2417
2417
  return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
@@ -2441,6 +2441,29 @@ class AccessorMagicService {
2441
2441
  let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
2442
2442
  return vis ? 'visible' : 'hidden';
2443
2443
  }
2444
+ getAlphaMask(controlId, rowId) {
2445
+ if (isNullOrUndefined(controlId))
2446
+ return null;
2447
+ let pic = this.task.GetControlPictureMask(controlId);
2448
+ let mask = pic.getMask();
2449
+ let valueStr = new StringBuilder();
2450
+ for (let i = 0; i < mask.length; i++) {
2451
+ switch (mask.charCodeAt(i)) {
2452
+ case PICInterface.PIC_N:
2453
+ valueStr.Append("0");
2454
+ break;
2455
+ case PICInterface.PIC_U:
2456
+ case PICInterface.PIC_L:
2457
+ case PICInterface.PIC_X:
2458
+ valueStr.Append("A");
2459
+ break;
2460
+ default:
2461
+ valueStr.Append(mask.charAt(i));
2462
+ break;
2463
+ }
2464
+ }
2465
+ return (pic != null) ? valueStr.toString() : null;
2466
+ }
2444
2467
  getNumericPicture(picture) {
2445
2468
  var obj = {};
2446
2469
  if (isNullOrUndefined(picture))
@@ -2509,7 +2532,7 @@ class AccessorMagicService {
2509
2532
  }
2510
2533
  getFormattedValue(controlId, rowId) {
2511
2534
  let val = this.task.getValue(controlId, rowId);
2512
- val = this.task.getFormattedValue(controlId, val);
2535
+ val = this.task.getFormattedValue(controlId, val, rowId);
2513
2536
  return val;
2514
2537
  }
2515
2538
  getPicture(controlId, rowId) {
@@ -2858,16 +2881,16 @@ class MagicDirective {
2858
2881
  this.eventHandlers = {};
2859
2882
  this.eventsOnlyVal = false;
2860
2883
  this.htmlElement = this.element.nativeElement;
2861
- if (!(typeof magicRow === 'undefined' || magicRow === null))
2884
+ if (!(typeof magicRow === "undefined" || magicRow === null))
2862
2885
  this.rowId = magicRow.rowId;
2863
2886
  }
2864
2887
  set magic(val) {
2865
2888
  this.id = val;
2866
- this.selector = 'magic';
2889
+ this.selector = "magic";
2867
2890
  }
2868
2891
  ;
2869
2892
  set eventsOnly(val) {
2870
- console.log('eventsOnly');
2893
+ console.log("eventsOnly");
2871
2894
  this.eventsOnlyVal = true;
2872
2895
  }
2873
2896
  ;
@@ -2875,11 +2898,11 @@ class MagicDirective {
2875
2898
  return this._task;
2876
2899
  }
2877
2900
  regEvents() {
2878
- this.eventHandlers['focusin'] = this.OnFocus.bind(this);
2901
+ this.eventHandlers["focusin"] = this.OnFocus.bind(this);
2879
2902
  Object.keys(this.eventHandlers).forEach((key) => {
2880
2903
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
2881
2904
  });
2882
- let events = ['click', 'mousedown', 'dblclick'];
2905
+ let events = ["click", "mousedown", "dblclick"];
2883
2906
  events.forEach(event => {
2884
2907
  this.renderer.listen(this.htmlElement, event, (e) => {
2885
2908
  let fromButton = false;
@@ -2890,15 +2913,15 @@ class MagicDirective {
2890
2913
  e.cancelBubble = true;
2891
2914
  });
2892
2915
  });
2893
- this.renderer.listen(this.htmlElement, 'change', (e) => {
2894
- let guiEvent = getGuiEventObj('selectionchanged', this.id, +this.rowId);
2916
+ this.renderer.listen(this.htmlElement, "change", (e) => {
2917
+ let guiEvent = getGuiEventObj("selectionchanged", this.id, +this.rowId);
2895
2918
  if ((event.target).selectedIndex !== undefined) {
2896
2919
  guiEvent.Value = (event.target).selectedIndex.toString();
2897
2920
  e.cancelBubble = true;
2898
2921
  this.task.insertEvent(guiEvent);
2899
2922
  }
2900
2923
  });
2901
- fromEvent(this.htmlElement, 'input').pipe(map((event) => {
2924
+ fromEvent(this.htmlElement, "input").pipe(map((event) => {
2902
2925
  return event.target.value;
2903
2926
  }), debounceTime(200)).subscribe((x) => {
2904
2927
  if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
@@ -2907,8 +2930,8 @@ class MagicDirective {
2907
2930
  this.task.mgAccessorService.setValueToControl(this.id, x, true);
2908
2931
  }
2909
2932
  });
2910
- this.renderer.listen(this.htmlElement, 'keydown', (e) => {
2911
- let guiEvent = getGuiEventObj('keydown', this.id, +this.rowId);
2933
+ this.renderer.listen(this.htmlElement, "keydown", (e) => {
2934
+ let guiEvent = getGuiEventObj("keydown", this.id, +this.rowId);
2912
2935
  guiEvent.modifiers = Modifiers.MODIFIER_NONE;
2913
2936
  if (e.altKey && e.keyCode !== GuiConstants.KEY_ALT)
2914
2937
  guiEvent.modifiers = Modifiers.MODIFIER_ALT;
@@ -2934,7 +2957,7 @@ class MagicDirective {
2934
2957
  });
2935
2958
  }
2936
2959
  OnFocus() {
2937
- this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
2960
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
2938
2961
  event.cancelBubble = true;
2939
2962
  }
2940
2963
  IsSameElement(command) {
@@ -2954,7 +2977,7 @@ class MagicDirective {
2954
2977
  .subscribe(a => {
2955
2978
  let command = a;
2956
2979
  if (isNullOrUndefined(this.rowId))
2957
- this.rowId = '0';
2980
+ this.rowId = "0";
2958
2981
  try {
2959
2982
  if (!this.eventsOnlyVal)
2960
2983
  this.handleCommand(command);
@@ -2982,7 +3005,7 @@ class MagicDirective {
2982
3005
  this.focusUnlistener();
2983
3006
  if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
2984
3007
  this.htmlElement.focus();
2985
- this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
3008
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
2986
3009
  break;
2987
3010
  }
2988
3011
  }
@@ -2992,13 +3015,13 @@ class MagicDirective {
2992
3015
  let methodName = command._str;
2993
3016
  let args = command.arguments;
2994
3017
  let magicComponent = (this.vcRef._hostLView).find(v => v instanceof TaskBaseMagicComponent);
2995
- let resultString = '';
3018
+ let resultString = "";
2996
3019
  try {
2997
3020
  if (!isNullOrUndefined(magicComponent[methodName])) {
2998
3021
  resultString = magicComponent[methodName].apply(magicComponent, args);
2999
3022
  }
3000
3023
  else
3001
- console.error('Instance method ' + methodName + ' does not exists');
3024
+ console.error("Instance method " + methodName + " does not exists");
3002
3025
  }
3003
3026
  catch (e) {
3004
3027
  console.error(e.message);
@@ -3010,10 +3033,13 @@ class MagicDirective {
3010
3033
  handleSetProperty(command) {
3011
3034
  switch (command.Operation) {
3012
3035
  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);
3036
+ {
3037
+ if (command.obj.Type == MgControlType.CTRL_TYPE_TEXT)
3038
+ if (command.obj1 != true)
3039
+ this.renderer.removeAttribute(this.htmlElement, command.Operation);
3040
+ else
3041
+ this.renderer.setAttribute(this.htmlElement, command.Operation, command.str);
3042
+ }
3017
3043
  break;
3018
3044
  }
3019
3045
  }
@@ -3029,7 +3055,7 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3029
3055
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
3030
3056
  type: Directive,
3031
3057
  args: [{
3032
- selector: '[magic]'
3058
+ selector: "[magic]"
3033
3059
  }]
3034
3060
  }], function () {
3035
3061
  return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
@@ -3037,10 +3063,10 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3037
3063
  }] }];
3038
3064
  }, { magic: [{
3039
3065
  type: Input,
3040
- args: ['magic']
3066
+ args: ["magic"]
3041
3067
  }], eventsOnly: [{
3042
3068
  type: Input,
3043
- args: ['eventsOnly']
3069
+ args: ["eventsOnly"]
3044
3070
  }], rowId: [{
3045
3071
  type: Input
3046
3072
  }] });
@@ -3345,6 +3371,25 @@ class MgformatMagicDirective {
3345
3371
  }
3346
3372
  }
3347
3373
  onFocusEvent($event) {
3374
+ this.calculatePattern();
3375
+ }
3376
+ onInputEvent($event) {
3377
+ this.calculatePattern();
3378
+ }
3379
+ onChangeEvent($event) {
3380
+ let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3381
+ let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3382
+ switch (attr) {
3383
+ case StorageAttribute.ALPHA:
3384
+ case StorageAttribute.UNICODE:
3385
+ this.formatAlphaUnicode(control);
3386
+ break;
3387
+ case StorageAttribute.BOOLEAN:
3388
+ this.formatBoolean(control);
3389
+ break;
3390
+ }
3391
+ }
3392
+ calculatePattern() {
3348
3393
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3349
3394
  if (control != null) {
3350
3395
  let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -3361,26 +3406,22 @@ class MgformatMagicDirective {
3361
3406
  if (attr == StorageAttribute.ALPHA || attr == StorageAttribute.UNICODE) {
3362
3407
  if (control.validator == null)
3363
3408
  control.setValidators(Validators.maxLength(pic.getMaskLength()));
3364
- else
3365
- control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
3409
+ else {
3410
+ if (pic.isFormatExp()) {
3411
+ control.setValidators(Validators.maxLength(pic.getMaskLength()));
3412
+ if (isUndefined(this.magicDir.rowId))
3413
+ this.magicDir.rowId = '0';
3414
+ control.setValidators([control.validator, this._task.customValidator(this.magicDir.rowId, this.magicDir.id)]);
3415
+ }
3416
+ else
3417
+ control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
3418
+ }
3419
+ control.updateValueAndValidity();
3366
3420
  }
3367
3421
  }
3368
3422
  }
3369
3423
  }
3370
3424
  }
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
3425
  formatDate(pic) {
3385
3426
  let mgDateFormatter = new MgDateFormatter();
3386
3427
  this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
@@ -3530,7 +3571,7 @@ class MgformatMagicDirective {
3530
3571
  MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
3531
3572
  MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
3532
3573
  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); });
3574
+ 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
3575
  }
3535
3576
  } });
3536
3577
  (function () {
@@ -3542,6 +3583,9 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
3542
3583
  }], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
3543
3584
  type: HostListener,
3544
3585
  args: ['focus', ['$event']]
3586
+ }], onInputEvent: [{
3587
+ type: HostListener,
3588
+ args: ['input', ['$event']]
3545
3589
  }], onChangeEvent: [{
3546
3590
  type: HostListener,
3547
3591
  args: ['change', ['$event']]
@@ -4053,7 +4097,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
4053
4097
  i0.ɵɵadvance(3);
4054
4098
  i0.ɵɵproperty("ngIf", ctx.showSpinner);
4055
4099
  }
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)}}"] });
4100
+ }, 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
4101
  (function () {
4058
4102
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
4059
4103
  type: Component,
@@ -4478,11 +4522,13 @@ const MG_FORMATS = {
4478
4522
  }
4479
4523
  };
4480
4524
  class MgDateAdapter extends NativeDateAdapter {
4481
- constructor(platform, task) {
4482
- super('en-US', platform);
4525
+ constructor(platform, task, localeId) {
4526
+ super(localeId, platform);
4483
4527
  this.platform = platform;
4484
4528
  this.task = task;
4529
+ this.localeId = localeId;
4485
4530
  this.mgdtfmt = null;
4531
+ this.setLocale(localeId);
4486
4532
  }
4487
4533
  parse(value) {
4488
4534
  let valueStr = value;
@@ -4542,7 +4588,7 @@ class MgDateAdapter extends NativeDateAdapter {
4542
4588
  }
4543
4589
  if (month == 0 && year == 0 && date == 0)
4544
4590
  return null;
4545
- return new Date(Date.UTC(year, month, date));
4591
+ return new Date(year, month, date);
4546
4592
  }
4547
4593
  }
4548
4594
  format(date, displayFormat) {
@@ -4558,12 +4604,17 @@ class MgDateAdapter extends NativeDateAdapter {
4558
4604
  }
4559
4605
  }
4560
4606
  }
4561
- MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService)); };
4607
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
4562
4608
  MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4563
4609
  (function () {
4564
4610
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
4565
4611
  type: Injectable
4566
- }], function () { return [{ type: i1$3.Platform }, { type: TaskMagicService }]; }, null);
4612
+ }], function () {
4613
+ return [{ type: i1$3.Platform }, { type: TaskMagicService }, { type: undefined, decorators: [{
4614
+ type: Inject,
4615
+ args: [MAT_DATE_LOCALE]
4616
+ }] }];
4617
+ }, null);
4567
4618
  })();
4568
4619
 
4569
4620
  const matDateProviders = [