@magic-xpa/angular 4.900.0-dev490.28 → 4.900.0-dev490.280

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);
@@ -1948,8 +1948,6 @@ class TaskMagicService {
1948
1948
  this.Records.list[guiRowId].values[controlId] = command.value;
1949
1949
  let c = this.getFormControl(guiRowId.toString(), controlId);
1950
1950
  if (!isNullOrUndefined(c)) {
1951
- if (command.Bool1)
1952
- c.reset();
1953
1951
  c.setValue(this.ConvertValFromNative(controlId, command.line, command.value));
1954
1952
  }
1955
1953
  break;
@@ -1983,7 +1981,6 @@ class TaskMagicService {
1983
1981
  ConvertValToNative(controlId, rowId, val) {
1984
1982
  let properties;
1985
1983
  properties = this.Records.list[0].getControlMetadata(controlId);
1986
- let control = this.getFormControl(rowId.toString(), controlId);
1987
1984
  switch (properties.dataType) {
1988
1985
  case StorageAttribute.BOOLEAN: {
1989
1986
  if (typeof val === 'string') {
@@ -2023,12 +2020,8 @@ class TaskMagicService {
2023
2020
  else
2024
2021
  return val;
2025
2022
  }
2026
- case StorageAttribute.NUMERIC: {
2027
- if (control.dirty && control.touched && val == null)
2028
- return 0;
2029
- else
2030
- return val;
2031
- }
2023
+ case StorageAttribute.NUMERIC:
2024
+ return +val;
2032
2025
  default:
2033
2026
  return val;
2034
2027
  }
@@ -2416,9 +2409,9 @@ class AccessorMagicService {
2416
2409
  let properties;
2417
2410
  properties = this.task.Records.list[0].getControlMetadata(controlId);
2418
2411
  if (properties.properties.get(HtmlProperties.ReadOnly) !== null && properties.properties.get(HtmlProperties.ReadOnly) === true)
2419
- return false;
2420
- else
2421
2412
  return true;
2413
+ else
2414
+ return false;
2422
2415
  }
2423
2416
  getText(controlId, rowId) {
2424
2417
  return this.task.getProperty(controlId, HtmlProperties.Text, rowId);
@@ -2448,6 +2441,29 @@ class AccessorMagicService {
2448
2441
  let vis = this.getProperty(controlId, HtmlProperties.Visible, rowId);
2449
2442
  return vis ? 'visible' : 'hidden';
2450
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
+ }
2451
2467
  getNumericPicture(picture) {
2452
2468
  var obj = {};
2453
2469
  if (isNullOrUndefined(picture))
@@ -2516,7 +2532,7 @@ class AccessorMagicService {
2516
2532
  }
2517
2533
  getFormattedValue(controlId, rowId) {
2518
2534
  let val = this.task.getValue(controlId, rowId);
2519
- val = this.task.getFormattedValue(controlId, val);
2535
+ val = this.task.getFormattedValue(controlId, val, rowId);
2520
2536
  return val;
2521
2537
  }
2522
2538
  getPicture(controlId, rowId) {
@@ -2865,16 +2881,16 @@ class MagicDirective {
2865
2881
  this.eventHandlers = {};
2866
2882
  this.eventsOnlyVal = false;
2867
2883
  this.htmlElement = this.element.nativeElement;
2868
- if (!(typeof magicRow === 'undefined' || magicRow === null))
2884
+ if (!(typeof magicRow === "undefined" || magicRow === null))
2869
2885
  this.rowId = magicRow.rowId;
2870
2886
  }
2871
2887
  set magic(val) {
2872
2888
  this.id = val;
2873
- this.selector = 'magic';
2889
+ this.selector = "magic";
2874
2890
  }
2875
2891
  ;
2876
2892
  set eventsOnly(val) {
2877
- console.log('eventsOnly');
2893
+ console.log("eventsOnly");
2878
2894
  this.eventsOnlyVal = true;
2879
2895
  }
2880
2896
  ;
@@ -2882,11 +2898,11 @@ class MagicDirective {
2882
2898
  return this._task;
2883
2899
  }
2884
2900
  regEvents() {
2885
- this.eventHandlers['focusin'] = this.OnFocus.bind(this);
2901
+ this.eventHandlers["focusin"] = this.OnFocus.bind(this);
2886
2902
  Object.keys(this.eventHandlers).forEach((key) => {
2887
2903
  this.focusUnlistener = this.renderer.listen(this.htmlElement, key, this.eventHandlers[key]);
2888
2904
  });
2889
- let events = ['click', 'mousedown', 'dblclick'];
2905
+ let events = ["click", "mousedown", "dblclick"];
2890
2906
  events.forEach(event => {
2891
2907
  this.renderer.listen(this.htmlElement, event, (e) => {
2892
2908
  let fromButton = false;
@@ -2897,15 +2913,15 @@ class MagicDirective {
2897
2913
  e.cancelBubble = true;
2898
2914
  });
2899
2915
  });
2900
- this.renderer.listen(this.htmlElement, 'change', (e) => {
2901
- 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);
2902
2918
  if ((event.target).selectedIndex !== undefined) {
2903
2919
  guiEvent.Value = (event.target).selectedIndex.toString();
2904
2920
  e.cancelBubble = true;
2905
2921
  this.task.insertEvent(guiEvent);
2906
2922
  }
2907
2923
  });
2908
- fromEvent(this.htmlElement, 'input').pipe(map((event) => {
2924
+ fromEvent(this.htmlElement, "input").pipe(map((event) => {
2909
2925
  return event.target.value;
2910
2926
  }), debounceTime(200)).subscribe((x) => {
2911
2927
  if (this.task.getProperty(this.id, HtmlProperties.BindingLevel, this.rowId) === BindingLevel.Character) {
@@ -2914,8 +2930,8 @@ class MagicDirective {
2914
2930
  this.task.mgAccessorService.setValueToControl(this.id, x, true);
2915
2931
  }
2916
2932
  });
2917
- this.renderer.listen(this.htmlElement, 'keydown', (e) => {
2918
- 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);
2919
2935
  guiEvent.modifiers = Modifiers.MODIFIER_NONE;
2920
2936
  if (e.altKey && e.keyCode !== GuiConstants.KEY_ALT)
2921
2937
  guiEvent.modifiers = Modifiers.MODIFIER_ALT;
@@ -2941,7 +2957,7 @@ class MagicDirective {
2941
2957
  });
2942
2958
  }
2943
2959
  OnFocus() {
2944
- this.task.insertEvent(getGuiEventObj('focus', this.id, +this.rowId));
2960
+ this.task.insertEvent(getGuiEventObj("focus", this.id, +this.rowId));
2945
2961
  event.cancelBubble = true;
2946
2962
  }
2947
2963
  IsSameElement(command) {
@@ -2961,7 +2977,7 @@ class MagicDirective {
2961
2977
  .subscribe(a => {
2962
2978
  let command = a;
2963
2979
  if (isNullOrUndefined(this.rowId))
2964
- this.rowId = '0';
2980
+ this.rowId = "0";
2965
2981
  try {
2966
2982
  if (!this.eventsOnlyVal)
2967
2983
  this.handleCommand(command);
@@ -2989,7 +3005,7 @@ class MagicDirective {
2989
3005
  this.focusUnlistener();
2990
3006
  if (!(command.obj.ConnectedControl && this.htmlElement instanceof HTMLButtonElement))
2991
3007
  this.htmlElement.focus();
2992
- this.focusUnlistener = this.renderer.listen(this.htmlElement, 'focusin', this.eventHandlers['focusin']);
3008
+ this.focusUnlistener = this.renderer.listen(this.htmlElement, "focusin", this.eventHandlers["focusin"]);
2993
3009
  break;
2994
3010
  }
2995
3011
  }
@@ -2999,13 +3015,13 @@ class MagicDirective {
2999
3015
  let methodName = command._str;
3000
3016
  let args = command.arguments;
3001
3017
  let magicComponent = (this.vcRef._hostLView).find(v => v instanceof TaskBaseMagicComponent);
3002
- let resultString = '';
3018
+ let resultString = "";
3003
3019
  try {
3004
3020
  if (!isNullOrUndefined(magicComponent[methodName])) {
3005
3021
  resultString = magicComponent[methodName].apply(magicComponent, args);
3006
3022
  }
3007
3023
  else
3008
- console.error('Instance method ' + methodName + ' does not exists');
3024
+ console.error("Instance method " + methodName + " does not exists");
3009
3025
  }
3010
3026
  catch (e) {
3011
3027
  console.error(e.message);
@@ -3017,10 +3033,13 @@ class MagicDirective {
3017
3033
  handleSetProperty(command) {
3018
3034
  switch (command.Operation) {
3019
3035
  case HtmlProperties.ReadOnly:
3020
- if (command.obj1 != true)
3021
- this.renderer.removeAttribute(this.htmlElement, command.Operation);
3022
- else
3023
- 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
+ }
3024
3043
  break;
3025
3044
  }
3026
3045
  }
@@ -3036,7 +3055,7 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3036
3055
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicDirective, [{
3037
3056
  type: Directive,
3038
3057
  args: [{
3039
- selector: '[magic]'
3058
+ selector: "[magic]"
3040
3059
  }]
3041
3060
  }], function () {
3042
3061
  return [{ type: TaskMagicService }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: RowMagicDirective, decorators: [{
@@ -3044,10 +3063,10 @@ MagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MagicDirective, selectors:
3044
3063
  }] }];
3045
3064
  }, { magic: [{
3046
3065
  type: Input,
3047
- args: ['magic']
3066
+ args: ["magic"]
3048
3067
  }], eventsOnly: [{
3049
3068
  type: Input,
3050
- args: ['eventsOnly']
3069
+ args: ["eventsOnly"]
3051
3070
  }], rowId: [{
3052
3071
  type: Input
3053
3072
  }] });
@@ -3352,6 +3371,25 @@ class MgformatMagicDirective {
3352
3371
  }
3353
3372
  }
3354
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() {
3355
3393
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3356
3394
  if (control != null) {
3357
3395
  let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
@@ -3368,26 +3406,18 @@ class MgformatMagicDirective {
3368
3406
  if (attr == StorageAttribute.ALPHA || attr == StorageAttribute.UNICODE) {
3369
3407
  if (control.validator == null)
3370
3408
  control.setValidators(Validators.maxLength(pic.getMaskLength()));
3371
- else
3372
- control.setValidators([control.validator, Validators.maxLength(pic.getMaskLength())]);
3409
+ else {
3410
+ control.setValidators(Validators.maxLength(pic.getMaskLength()));
3411
+ if (isUndefined(this.magicDir.rowId))
3412
+ this.magicDir.rowId = '0';
3413
+ control.setValidators([control.validator, this._task.customValidator(this.magicDir.rowId, this.magicDir.id)]);
3414
+ }
3415
+ control.updateValueAndValidity();
3373
3416
  }
3374
3417
  }
3375
3418
  }
3376
3419
  }
3377
3420
  }
3378
- onChangeEvent($event) {
3379
- let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
3380
- let attr = this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;
3381
- switch (attr) {
3382
- case StorageAttribute.ALPHA:
3383
- case StorageAttribute.UNICODE:
3384
- this.formatAlphaUnicode(control);
3385
- break;
3386
- case StorageAttribute.BOOLEAN:
3387
- this.formatBoolean(control);
3388
- break;
3389
- }
3390
- }
3391
3421
  formatDate(pic) {
3392
3422
  let mgDateFormatter = new MgDateFormatter();
3393
3423
  this._task.mgInputDateFormat = mgDateFormatter.ConvertMgDateFormatToAngular(pic.getMask());
@@ -3537,7 +3567,7 @@ class MgformatMagicDirective {
3537
3567
  MgformatMagicDirective.ɵfac = function MgformatMagicDirective_Factory(t) { return new (t || MgformatMagicDirective)(i0.ɵɵdirectiveInject(MagicDirective), i0.ɵɵdirectiveInject(TaskMagicService)); };
3538
3568
  MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirective, selectors: [["", "mgFormat", ""]], hostBindings: function MgformatMagicDirective_HostBindings(rf, ctx) {
3539
3569
  if (rf & 1) {
3540
- i0.ɵɵlistener("focus", function MgformatMagicDirective_focus_HostBindingHandler($event) { return ctx.onFocusEvent($event); })("change", function MgformatMagicDirective_change_HostBindingHandler($event) { return ctx.onChangeEvent($event); });
3570
+ 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); });
3541
3571
  }
3542
3572
  } });
3543
3573
  (function () {
@@ -3549,6 +3579,9 @@ MgformatMagicDirective.ɵdir = i0.ɵɵdefineDirective({ type: MgformatMagicDirec
3549
3579
  }], function () { return [{ type: MagicDirective }, { type: TaskMagicService }]; }, { onFocusEvent: [{
3550
3580
  type: HostListener,
3551
3581
  args: ['focus', ['$event']]
3582
+ }], onInputEvent: [{
3583
+ type: HostListener,
3584
+ args: ['input', ['$event']]
3552
3585
  }], onChangeEvent: [{
3553
3586
  type: HostListener,
3554
3587
  args: ['change', ['$event']]
@@ -4060,7 +4093,7 @@ MagicShellComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MagicShellComponent,
4060
4093
  i0.ɵɵadvance(3);
4061
4094
  i0.ɵɵproperty("ngIf", ctx.showSpinner);
4062
4095
  }
4063
- }, 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)}}"] });
4096
+ }, 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)}}"] });
4064
4097
  (function () {
4065
4098
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicShellComponent, [{
4066
4099
  type: Component,
@@ -4485,11 +4518,13 @@ const MG_FORMATS = {
4485
4518
  }
4486
4519
  };
4487
4520
  class MgDateAdapter extends NativeDateAdapter {
4488
- constructor(platform, task) {
4489
- super('en-US', platform);
4521
+ constructor(platform, task, localeId) {
4522
+ super(localeId, platform);
4490
4523
  this.platform = platform;
4491
4524
  this.task = task;
4525
+ this.localeId = localeId;
4492
4526
  this.mgdtfmt = null;
4527
+ this.setLocale(localeId);
4493
4528
  }
4494
4529
  parse(value) {
4495
4530
  let valueStr = value;
@@ -4565,12 +4600,17 @@ class MgDateAdapter extends NativeDateAdapter {
4565
4600
  }
4566
4601
  }
4567
4602
  }
4568
- MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService)); };
4603
+ MgDateAdapter.ɵfac = function MgDateAdapter_Factory(t) { return new (t || MgDateAdapter)(i0.ɵɵinject(i1$3.Platform), i0.ɵɵinject(TaskMagicService), i0.ɵɵinject(MAT_DATE_LOCALE)); };
4569
4604
  MgDateAdapter.ɵprov = i0.ɵɵdefineInjectable({ token: MgDateAdapter, factory: MgDateAdapter.ɵfac });
4570
4605
  (function () {
4571
4606
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgDateAdapter, [{
4572
4607
  type: Injectable
4573
- }], function () { return [{ type: i1$3.Platform }, { type: TaskMagicService }]; }, null);
4608
+ }], function () {
4609
+ return [{ type: i1$3.Platform }, { type: TaskMagicService }, { type: undefined, decorators: [{
4610
+ type: Inject,
4611
+ args: [MAT_DATE_LOCALE]
4612
+ }] }];
4613
+ }, null);
4574
4614
  })();
4575
4615
 
4576
4616
  const matDateProviders = [