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

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.
@@ -15,8 +15,10 @@ 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
+ import { maskitoTimeOptionsGenerator } from '@maskito/kit';
18
19
  import * as i1$2 from '@angular/common/http';
19
20
  import { HttpClientModule } from '@angular/common/http';
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
 
@@ -2329,6 +2331,9 @@ class AccessorMagicService {
2329
2331
  this.task = task;
2330
2332
  this.magicColor = magicColor;
2331
2333
  this.Logger = null;
2334
+ this.hhmm = maskitoTimeOptionsGenerator({ mode: 'HH:MM' });
2335
+ this.hhmmss = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS' });
2336
+ this.hhmmssms = maskitoTimeOptionsGenerator({ mode: 'HH:MM:SS.MSS' });
2332
2337
  this.Logger = Logger.Instance;
2333
2338
  }
2334
2339
  checkIsReadOnly(controlId) {
@@ -3386,6 +3391,17 @@ class MgformatMagicDirective {
3386
3391
  input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 7)}`;
3387
3392
  }
3388
3393
  }
3394
+ else if (this._task.mgInputDateFormat == "dd/MMM/yyyy" || this._task.mgInputDateFormat == "dd-MMM-yyyy") {
3395
+ if (value.length <= 2) {
3396
+ input.value = value;
3397
+ }
3398
+ else if (value.length <= 5) {
3399
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2)}`;
3400
+ }
3401
+ else {
3402
+ input.value = `${value.slice(0, 2)}` + separator + `${value.slice(2, 5)}` + separator + `${value.slice(5, 9)}`;
3403
+ }
3404
+ }
3389
3405
  else if (this._task.mgInputDateFormat == "yy/dd/MMM" || this._task.mgInputDateFormat == "yy-dd-MMM") {
3390
3406
  if (value.length <= 2) {
3391
3407
  input.value = value;
@@ -3431,6 +3447,14 @@ class MgformatMagicDirective {
3431
3447
  }
3432
3448
  }
3433
3449
  }
3450
+ if (cursorPos < input.value.length && input.value.length > this._task.mgInputDateFormat.length) {
3451
+ let inputDate = input.value;
3452
+ let start = input.selectionStart - 1;
3453
+ let end = input.selectionEnd - 1;
3454
+ let indexToRemove = input.selectionStart - 1;
3455
+ input.value = inputDate.slice(0, indexToRemove) + inputDate.slice(indexToRemove + 1);
3456
+ input.setSelectionRange(start, end);
3457
+ }
3434
3458
  }
3435
3459
  onChangeEvent($event) {
3436
3460
  let control = this._task.getFormControl(this.magicDir.rowId, this.magicDir.id);
@@ -4457,13 +4481,13 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4457
4481
  ReactiveFormsModule,
4458
4482
  RouterModule,
4459
4483
  DynamicModule,
4460
- HttpClientModule] });
4484
+ HttpClientModule, MaskitoModule] });
4461
4485
  (function () {
4462
4486
  (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicModule, [{
4463
4487
  type: NgModule,
4464
4488
  args: [{
4465
4489
  declarations: [...decs],
4466
- exports: [...decs],
4490
+ exports: [...decs, MaskitoModule],
4467
4491
  entryComponents: [],
4468
4492
  imports: [
4469
4493
  CommonModule,
@@ -4537,7 +4561,7 @@ MagicModule.ɵinj = i0.ɵɵdefineInjector({ providers: [ConfirmationComponentsMa
4537
4561
  RangeValidatorMagicDirective,
4538
4562
  NonMagicControlDirective,
4539
4563
  MagicFocusDirective,
4540
- MagicViewContainerRef] });
4564
+ MagicViewContainerRef, MaskitoModule] });
4541
4565
  })();
4542
4566
 
4543
4567
  const MG_FORMATS = {