@magic-xpa/angular 4.1000.0-dev4100.349 → 4.1000.0-dev4100.354

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.
@@ -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
 
@@ -2259,6 +2261,9 @@ class AccessorMagicService {
2259
2261
  this.task = task;
2260
2262
  this.magicColor = magicColor;
2261
2263
  this.Logger = null;
2264
+ this.hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
2265
+ this.hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
2266
+ this.hhmmssms = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS.MSS' });
2262
2267
  this.Logger = Logger.Instance;
2263
2268
  }
2264
2269
  checkIsReadOnly(controlId) {
@@ -3296,6 +3301,17 @@ class MgformatMagicDirective {
3296
3301
  input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 7)}`;
3297
3302
  }
3298
3303
  }
3304
+ else if (this._task.mgInputDateFormat == "dd/MMM/yyyy" || this._task.mgInputDateFormat == "dd-MMM-yyyy") {
3305
+ if (value.length <= 2) {
3306
+ input.value = value;
3307
+ }
3308
+ else if (value.length <= 5) {
3309
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2)}`;
3310
+ }
3311
+ else {
3312
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 9)}`;
3313
+ }
3314
+ }
3299
3315
  else if (this._task.mgInputDateFormat == "yy/dd/MMM" || this._task.mgInputDateFormat == "yy-dd-MMM") {
3300
3316
  if (value.length <= 2) {
3301
3317
  input.value = value;
@@ -3341,6 +3357,14 @@ class MgformatMagicDirective {
3341
3357
  }
3342
3358
  }
3343
3359
  }
3360
+ if (cursorPos < input.value.length && input.value.length > this._task.mgInputDateFormat.length) {
3361
+ let inputDate = input.value;
3362
+ let start = input.selectionStart - 1;
3363
+ let end = input.selectionEnd - 1;
3364
+ let indexToRemove = input.selectionStart - 1;
3365
+ input.value = inputDate.slice(0, indexToRemove) + inputDate.slice(indexToRemove + 1);
3366
+ input.setSelectionRange(start, end);
3367
+ }
3344
3368
  }
3345
3369
  onChangeEvent($event) {
3346
3370
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
@@ -4285,12 +4309,12 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4285
4309
  ReactiveFormsModule,
4286
4310
  RouterModule,
4287
4311
  DynamicModule,
4288
- HttpClientModule] });
4312
+ HttpClientModule, MaskitoModule] });
4289
4313
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
4290
4314
  type: NgModule,
4291
4315
  args: [{
4292
4316
  declarations: [...decs],
4293
- exports: [...decs],
4317
+ exports: [...decs, MaskitoModule],
4294
4318
  entryComponents: [],
4295
4319
  imports: [
4296
4320
  CommonModule,
@@ -4362,7 +4386,7 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4362
4386
  RangeValidatorMagicDirective,
4363
4387
  NonMagicControlDirective,
4364
4388
  MagicFocusDirective,
4365
- MagicViewContainerRef] }); })();
4389
+ MagicViewContainerRef, MaskitoModule] }); })();
4366
4390
 
4367
4391
  const MG_FORMATS = {
4368
4392
  parse: { dateInput: { month: 'short', year: 'numeric', day: 'numeric' } },