ngx-mask 20.0.3 → 21.0.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, inject, Injectable, ElementRef, Renderer2, makeEnvironmentProviders, input, output, signal, HostListener, Directive, Pipe } from '@angular/core';
2
+ import { InjectionToken, EventEmitter, inject, Injectable, ElementRef, Renderer2, makeEnvironmentProviders, input, model, output, signal, effect, untracked, HostListener, Directive, Pipe } from '@angular/core';
3
3
  import { DOCUMENT } from '@angular/common';
4
4
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
5
5
 
@@ -636,6 +636,12 @@ class NgxMaskApplierService {
636
636
  }
637
637
  else if (this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING] &&
638
638
  this.patterns[maskExpression[cursor] ?? MaskExpression.EMPTY_STRING]?.optional) {
639
+ // If the input symbol is whitespace or doesn't match the pattern,
640
+ // skip it without consuming the mask position
641
+ if (inputSymbol.trim() === MaskExpression.EMPTY_STRING) {
642
+ // Skip whitespace input, don't advance mask cursor
643
+ continue;
644
+ }
639
645
  if (!!inputArray[cursor] &&
640
646
  maskExpression !== '099.099.099.099' &&
641
647
  maskExpression !== '000.000.000-00' &&
@@ -906,10 +912,10 @@ class NgxMaskApplierService {
906
912
  nonZeroIndex,
907
913
  };
908
914
  }
909
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskApplierService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
910
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskApplierService });
915
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskApplierService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
916
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskApplierService });
911
917
  }
912
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskApplierService, decorators: [{
918
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskApplierService, decorators: [{
913
919
  type: Injectable
914
920
  }] });
915
921
 
@@ -1117,8 +1123,17 @@ class NgxMaskService extends NgxMaskApplierService {
1117
1123
  (this.previousValue === this.currentValue && justPasted);
1118
1124
  }
1119
1125
  // Propagate the input value back to the Angular model
1120
- // eslint-disable-next-line no-unused-expressions,@typescript-eslint/no-unused-expressions
1121
- this._emitValue ? this.formControlResult(result) : '';
1126
+ // Only emit if:
1127
+ // 1. _emitValue is true (value changed), AND
1128
+ // 2. Either mask didn't change, OR triggerOnMaskChange is true
1129
+ const shouldEmit = this._emitValue && (!this.maskChanged || this.triggerOnMaskChange);
1130
+ if (shouldEmit) {
1131
+ this.formControlResult(result);
1132
+ }
1133
+ // Reset maskChanged flag even if we didn't emit
1134
+ if (this.maskChanged && !this.triggerOnMaskChange) {
1135
+ this.maskChanged = false;
1136
+ }
1122
1137
  // Handle hidden input and showMaskTyped
1123
1138
  if (!this.showMaskTyped || (this.showMaskTyped && this.hiddenInput)) {
1124
1139
  if (this.hiddenInput) {
@@ -1275,8 +1290,12 @@ class NgxMaskService extends NgxMaskApplierService {
1275
1290
  if (!this._renderer || !this._elementRef) {
1276
1291
  return;
1277
1292
  }
1278
- //[TODO]: andriikamaldinov1 find better solution
1279
- Promise.resolve().then(() => this._renderer?.setProperty(this._elementRef?.nativeElement, name, value));
1293
+ // Use queueMicrotask to defer DOM updates to next microtask.
1294
+ // This prevents ExpressionChangedAfterItHasBeenCheckedError
1295
+ // and ensures proper timing with Angular's change detection.
1296
+ queueMicrotask(() => {
1297
+ this._renderer?.setProperty(this._elementRef?.nativeElement, name, value);
1298
+ });
1280
1299
  }
1281
1300
  checkDropSpecialCharAmount(mask) {
1282
1301
  const chars = mask
@@ -1459,7 +1478,15 @@ class NgxMaskService extends NgxMaskApplierService {
1459
1478
  return this._removeMask(result, specialCharacters);
1460
1479
  }
1461
1480
  _regExpForRemove(specialCharactersForRemove) {
1462
- return new RegExp(specialCharactersForRemove.map((item) => `\\${item}`).join('|'), 'gi');
1481
+ return new RegExp(specialCharactersForRemove
1482
+ .map((item) => {
1483
+ // Only escape characters that have special meaning in regex
1484
+ if (/[.*+?^${}()|[\]\\/-]/.test(item)) {
1485
+ return `\\${item}`;
1486
+ }
1487
+ return item;
1488
+ })
1489
+ .join('|'), 'gi');
1463
1490
  }
1464
1491
  _replaceDecimalMarkerToDot(value) {
1465
1492
  const markers = Array.isArray(this.decimalMarker)
@@ -1558,10 +1585,10 @@ class NgxMaskService extends NgxMaskApplierService {
1558
1585
  currentLocaleDecimalMarker() {
1559
1586
  return (1.1).toLocaleString().substring(1, 2);
1560
1587
  }
1561
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1562
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskService });
1588
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1589
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskService });
1563
1590
  }
1564
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskService, decorators: [{
1591
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskService, decorators: [{
1565
1592
  type: Injectable
1566
1593
  }] });
1567
1594
 
@@ -1597,6 +1624,7 @@ function provideEnvironmentNgxMask(configValue) {
1597
1624
  }
1598
1625
 
1599
1626
  class NgxMaskDirective {
1627
+ // ===== Mask Configuration Inputs =====
1600
1628
  mask = input('', ...(ngDevMode ? [{ debugName: "mask" }] : []));
1601
1629
  specialCharacters = input([], ...(ngDevMode ? [{ debugName: "specialCharacters" }] : []));
1602
1630
  patterns = input({}, ...(ngDevMode ? [{ debugName: "patterns" }] : []));
@@ -1621,6 +1649,16 @@ class NgxMaskDirective {
1621
1649
  outputTransformFn = input(null, ...(ngDevMode ? [{ debugName: "outputTransformFn" }] : []));
1622
1650
  keepCharacterPositions = input(null, ...(ngDevMode ? [{ debugName: "keepCharacterPositions" }] : []));
1623
1651
  instantPrefix = input(null, ...(ngDevMode ? [{ debugName: "instantPrefix" }] : []));
1652
+ value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
1653
+ errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : []));
1654
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
1655
+ touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
1656
+ dirty = input(false, ...(ngDevMode ? [{ debugName: "dirty" }] : []));
1657
+ invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : []));
1658
+ pending = input(false, ...(ngDevMode ? [{ debugName: "pending" }] : []));
1659
+ readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : []));
1660
+ required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
1661
+ name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
1624
1662
  maskFilled = output();
1625
1663
  _maskValue = signal('', ...(ngDevMode ? [{ debugName: "_maskValue" }] : []));
1626
1664
  _inputValue = signal('', ...(ngDevMode ? [{ debugName: "_inputValue" }] : []));
@@ -1629,8 +1667,10 @@ class NgxMaskDirective {
1629
1667
  _maskExpressionArray = signal([], ...(ngDevMode ? [{ debugName: "_maskExpressionArray" }] : []));
1630
1668
  _justPasted = signal(false, ...(ngDevMode ? [{ debugName: "_justPasted" }] : []));
1631
1669
  _isFocused = signal(false, ...(ngDevMode ? [{ debugName: "_isFocused" }] : []));
1632
- /**For IME composition event */
1670
+ /** For IME composition event */
1633
1671
  _isComposing = signal(false, ...(ngDevMode ? [{ debugName: "_isComposing" }] : []));
1672
+ /** Track if we're using Signal Forms mode */
1673
+ _isSignalFormsMode = signal(false, ...(ngDevMode ? [{ debugName: "_isSignalFormsMode" }] : []));
1634
1674
  _maskService = inject(NgxMaskService, { self: true });
1635
1675
  document = inject(DOCUMENT);
1636
1676
  _config = inject(NGX_MASK_CONFIG);
@@ -1638,6 +1678,29 @@ class NgxMaskDirective {
1638
1678
  onChange = (_) => { };
1639
1679
  // eslint-disable-next-line @typescript-eslint/no-empty-function
1640
1680
  onTouch = () => { };
1681
+ constructor() {
1682
+ effect(() => {
1683
+ const signalValue = this.value();
1684
+ if (this._isSignalFormsMode() && signalValue !== untracked(() => this._inputValue())) {
1685
+ untracked(() => {
1686
+ this.writeValue(signalValue);
1687
+ });
1688
+ }
1689
+ });
1690
+ effect(() => {
1691
+ const isDisabled = this.disabled();
1692
+ untracked(() => {
1693
+ this.setDisabledState(isDisabled);
1694
+ });
1695
+ });
1696
+ }
1697
+ ngOnInit() {
1698
+ // Detect if we're being used with Signal Forms
1699
+ // Signal Forms will set the value model from outside
1700
+ if (this.value() !== '') {
1701
+ this._isSignalFormsMode.set(true);
1702
+ }
1703
+ }
1641
1704
  ngOnChanges(changes) {
1642
1705
  const { mask, specialCharacters, patterns, prefix, suffix, thousandSeparator, decimalMarker, dropSpecialCharacters, hiddenInput, showMaskTyped, placeHolderCharacter, shownMaskExpression, clearIfNotMatch, validation, separatorLimit, allowNegativeNumbers, leadZeroDateTime, leadZero, triggerOnMaskChange, apm, inputTransformFn, outputTransformFn, keepCharacterPositions, instantPrefix, } = changes;
1643
1706
  if (mask) {
@@ -2197,14 +2260,15 @@ class NgxMaskDirective {
2197
2260
  el.selectionEnd = this._getActualInputLength();
2198
2261
  }
2199
2262
  }
2200
- onKeyDown(e) {
2263
+ onKeyDown(event) {
2264
+ const e = event;
2201
2265
  if (!this._maskValue()) {
2202
2266
  return;
2203
2267
  }
2204
2268
  if (this._isComposing()) {
2205
2269
  // User finalize their choice from IME composition, so trigger onInput() for the composed text.
2206
2270
  if (e.key === 'Enter') {
2207
- this.onCompositionEnd(e);
2271
+ this.onCompositionEnd(event);
2208
2272
  }
2209
2273
  return;
2210
2274
  }
@@ -2322,8 +2386,17 @@ class NgxMaskDirective {
2322
2386
  .replace(MaskExpression.DOT, MaskExpression.COMMA);
2323
2387
  }
2324
2388
  if (this.mask()?.startsWith(MaskExpression.SEPARATOR) && this.leadZero()) {
2389
+ const isFirstWrite = !this._maskService.isInitialized;
2325
2390
  requestAnimationFrame(() => {
2391
+ // On initial load, temporarily set isInitialized to false
2392
+ // so formControlResult returns early and doesn't mark form as dirty
2393
+ if (isFirstWrite) {
2394
+ this._maskService.isInitialized = false;
2395
+ }
2326
2396
  this._maskService.applyMask(inputValue?.toString() ?? '', this._maskService.maskExpression);
2397
+ if (isFirstWrite) {
2398
+ this._maskService.isInitialized = true;
2399
+ }
2327
2400
  });
2328
2401
  }
2329
2402
  this._maskService.isNumberValue = true;
@@ -2358,10 +2431,34 @@ class NgxMaskDirective {
2358
2431
  }
2359
2432
  }
2360
2433
  registerOnChange(fn) {
2361
- this._maskService.onChange = this.onChange = fn;
2434
+ // Wrap the original onChange to also update Signal Forms value
2435
+ const originalFn = fn;
2436
+ this._maskService.onChange = this.onChange = (value) => {
2437
+ originalFn(value);
2438
+ // Update Signal Forms value model if in use
2439
+ if (this._isSignalFormsMode()) {
2440
+ const stringValue = value === null || typeof value === 'undefined' ? '' : String(value);
2441
+ if (this.value() !== stringValue) {
2442
+ this.value.set(stringValue);
2443
+ }
2444
+ }
2445
+ };
2362
2446
  }
2363
2447
  registerOnTouched(fn) {
2364
- this.onTouch = fn;
2448
+ this.onTouch = () => {
2449
+ fn();
2450
+ // Update Signal Forms touched state
2451
+ if (this._isSignalFormsMode() && !this.touched()) {
2452
+ this.touched.set(true);
2453
+ }
2454
+ };
2455
+ }
2456
+ /**
2457
+ * Focus the input element.
2458
+ * Required by FormValueControl interface for Signal Forms.
2459
+ */
2460
+ focus() {
2461
+ this._maskService._elementRef?.nativeElement?.focus();
2365
2462
  }
2366
2463
  _getActiveElement(document = this.document) {
2367
2464
  const shadowRootEl = document?.activeElement?.shadowRoot;
@@ -2473,8 +2570,8 @@ class NgxMaskDirective {
2473
2570
  return uniqueCharacters.size === 1;
2474
2571
  });
2475
2572
  }
2476
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2477
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.2", type: NgxMaskDirective, isStandalone: true, selector: "input[mask], textarea[mask]", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, specialCharacters: { classPropertyName: "specialCharacters", publicName: "specialCharacters", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null }, decimalMarker: { classPropertyName: "decimalMarker", publicName: "decimalMarker", isSignal: true, isRequired: false, transformFunction: null }, dropSpecialCharacters: { classPropertyName: "dropSpecialCharacters", publicName: "dropSpecialCharacters", isSignal: true, isRequired: false, transformFunction: null }, hiddenInput: { classPropertyName: "hiddenInput", publicName: "hiddenInput", isSignal: true, isRequired: false, transformFunction: null }, showMaskTyped: { classPropertyName: "showMaskTyped", publicName: "showMaskTyped", isSignal: true, isRequired: false, transformFunction: null }, placeHolderCharacter: { classPropertyName: "placeHolderCharacter", publicName: "placeHolderCharacter", isSignal: true, isRequired: false, transformFunction: null }, shownMaskExpression: { classPropertyName: "shownMaskExpression", publicName: "shownMaskExpression", isSignal: true, isRequired: false, transformFunction: null }, clearIfNotMatch: { classPropertyName: "clearIfNotMatch", publicName: "clearIfNotMatch", isSignal: true, isRequired: false, transformFunction: null }, validation: { classPropertyName: "validation", publicName: "validation", isSignal: true, isRequired: false, transformFunction: null }, separatorLimit: { classPropertyName: "separatorLimit", publicName: "separatorLimit", isSignal: true, isRequired: false, transformFunction: null }, allowNegativeNumbers: { classPropertyName: "allowNegativeNumbers", publicName: "allowNegativeNumbers", isSignal: true, isRequired: false, transformFunction: null }, leadZeroDateTime: { classPropertyName: "leadZeroDateTime", publicName: "leadZeroDateTime", isSignal: true, isRequired: false, transformFunction: null }, leadZero: { classPropertyName: "leadZero", publicName: "leadZero", isSignal: true, isRequired: false, transformFunction: null }, triggerOnMaskChange: { classPropertyName: "triggerOnMaskChange", publicName: "triggerOnMaskChange", isSignal: true, isRequired: false, transformFunction: null }, apm: { classPropertyName: "apm", publicName: "apm", isSignal: true, isRequired: false, transformFunction: null }, inputTransformFn: { classPropertyName: "inputTransformFn", publicName: "inputTransformFn", isSignal: true, isRequired: false, transformFunction: null }, outputTransformFn: { classPropertyName: "outputTransformFn", publicName: "outputTransformFn", isSignal: true, isRequired: false, transformFunction: null }, keepCharacterPositions: { classPropertyName: "keepCharacterPositions", publicName: "keepCharacterPositions", isSignal: true, isRequired: false, transformFunction: null }, instantPrefix: { classPropertyName: "instantPrefix", publicName: "instantPrefix", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { maskFilled: "maskFilled" }, host: { listeners: { "paste": "onPaste()", "focus": "onFocus($event)", "ngModelChange": "onModelChange($event)", "input": "onInput($event)", "compositionstart": "onCompositionStart($event)", "compositionend": "onCompositionEnd($event)", "blur": "onBlur($event)", "click": "onClick($event)", "keydown": "onKeyDown($event)" } }, providers: [
2573
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2574
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.2", type: NgxMaskDirective, isStandalone: true, selector: "input[mask], textarea[mask]", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, specialCharacters: { classPropertyName: "specialCharacters", publicName: "specialCharacters", isSignal: true, isRequired: false, transformFunction: null }, patterns: { classPropertyName: "patterns", publicName: "patterns", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, thousandSeparator: { classPropertyName: "thousandSeparator", publicName: "thousandSeparator", isSignal: true, isRequired: false, transformFunction: null }, decimalMarker: { classPropertyName: "decimalMarker", publicName: "decimalMarker", isSignal: true, isRequired: false, transformFunction: null }, dropSpecialCharacters: { classPropertyName: "dropSpecialCharacters", publicName: "dropSpecialCharacters", isSignal: true, isRequired: false, transformFunction: null }, hiddenInput: { classPropertyName: "hiddenInput", publicName: "hiddenInput", isSignal: true, isRequired: false, transformFunction: null }, showMaskTyped: { classPropertyName: "showMaskTyped", publicName: "showMaskTyped", isSignal: true, isRequired: false, transformFunction: null }, placeHolderCharacter: { classPropertyName: "placeHolderCharacter", publicName: "placeHolderCharacter", isSignal: true, isRequired: false, transformFunction: null }, shownMaskExpression: { classPropertyName: "shownMaskExpression", publicName: "shownMaskExpression", isSignal: true, isRequired: false, transformFunction: null }, clearIfNotMatch: { classPropertyName: "clearIfNotMatch", publicName: "clearIfNotMatch", isSignal: true, isRequired: false, transformFunction: null }, validation: { classPropertyName: "validation", publicName: "validation", isSignal: true, isRequired: false, transformFunction: null }, separatorLimit: { classPropertyName: "separatorLimit", publicName: "separatorLimit", isSignal: true, isRequired: false, transformFunction: null }, allowNegativeNumbers: { classPropertyName: "allowNegativeNumbers", publicName: "allowNegativeNumbers", isSignal: true, isRequired: false, transformFunction: null }, leadZeroDateTime: { classPropertyName: "leadZeroDateTime", publicName: "leadZeroDateTime", isSignal: true, isRequired: false, transformFunction: null }, leadZero: { classPropertyName: "leadZero", publicName: "leadZero", isSignal: true, isRequired: false, transformFunction: null }, triggerOnMaskChange: { classPropertyName: "triggerOnMaskChange", publicName: "triggerOnMaskChange", isSignal: true, isRequired: false, transformFunction: null }, apm: { classPropertyName: "apm", publicName: "apm", isSignal: true, isRequired: false, transformFunction: null }, inputTransformFn: { classPropertyName: "inputTransformFn", publicName: "inputTransformFn", isSignal: true, isRequired: false, transformFunction: null }, outputTransformFn: { classPropertyName: "outputTransformFn", publicName: "outputTransformFn", isSignal: true, isRequired: false, transformFunction: null }, keepCharacterPositions: { classPropertyName: "keepCharacterPositions", publicName: "keepCharacterPositions", isSignal: true, isRequired: false, transformFunction: null }, instantPrefix: { classPropertyName: "instantPrefix", publicName: "instantPrefix", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, pending: { classPropertyName: "pending", publicName: "pending", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", maskFilled: "maskFilled" }, host: { listeners: { "paste": "onPaste()", "focus": "onFocus()", "ngModelChange": "onModelChange($event)", "input": "onInput($event)", "compositionstart": "onCompositionStart()", "compositionend": "onCompositionEnd($event)", "blur": "onBlur($event)", "click": "onClick($event)", "keydown": "onKeyDown($event)" } }, providers: [
2478
2575
  {
2479
2576
  provide: NG_VALUE_ACCESSOR,
2480
2577
  useExisting: NgxMaskDirective,
@@ -2488,7 +2585,7 @@ class NgxMaskDirective {
2488
2585
  NgxMaskService,
2489
2586
  ], exportAs: ["mask", "ngxMask"], usesOnChanges: true, ngImport: i0 });
2490
2587
  }
2491
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskDirective, decorators: [{
2588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskDirective, decorators: [{
2492
2589
  type: Directive,
2493
2590
  args: [{
2494
2591
  selector: 'input[mask], textarea[mask]',
@@ -2508,12 +2605,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
2508
2605
  ],
2509
2606
  exportAs: 'mask,ngxMask',
2510
2607
  }]
2511
- }], propDecorators: { onPaste: [{
2608
+ }], ctorParameters: () => [], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], specialCharacters: [{ type: i0.Input, args: [{ isSignal: true, alias: "specialCharacters", required: false }] }], patterns: [{ type: i0.Input, args: [{ isSignal: true, alias: "patterns", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], thousandSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "thousandSeparator", required: false }] }], decimalMarker: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimalMarker", required: false }] }], dropSpecialCharacters: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropSpecialCharacters", required: false }] }], hiddenInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "hiddenInput", required: false }] }], showMaskTyped: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMaskTyped", required: false }] }], placeHolderCharacter: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolderCharacter", required: false }] }], shownMaskExpression: [{ type: i0.Input, args: [{ isSignal: true, alias: "shownMaskExpression", required: false }] }], clearIfNotMatch: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearIfNotMatch", required: false }] }], validation: [{ type: i0.Input, args: [{ isSignal: true, alias: "validation", required: false }] }], separatorLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "separatorLimit", required: false }] }], allowNegativeNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowNegativeNumbers", required: false }] }], leadZeroDateTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadZeroDateTime", required: false }] }], leadZero: [{ type: i0.Input, args: [{ isSignal: true, alias: "leadZero", required: false }] }], triggerOnMaskChange: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerOnMaskChange", required: false }] }], apm: [{ type: i0.Input, args: [{ isSignal: true, alias: "apm", required: false }] }], inputTransformFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputTransformFn", required: false }] }], outputTransformFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "outputTransformFn", required: false }] }], keepCharacterPositions: [{ type: i0.Input, args: [{ isSignal: true, alias: "keepCharacterPositions", required: false }] }], instantPrefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "instantPrefix", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], pending: [{ type: i0.Input, args: [{ isSignal: true, alias: "pending", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], maskFilled: [{ type: i0.Output, args: ["maskFilled"] }], onPaste: [{
2512
2609
  type: HostListener,
2513
2610
  args: ['paste']
2514
2611
  }], onFocus: [{
2515
2612
  type: HostListener,
2516
- args: ['focus', ['$event']]
2613
+ args: ['focus']
2517
2614
  }], onModelChange: [{
2518
2615
  type: HostListener,
2519
2616
  args: ['ngModelChange', ['$event']]
@@ -2522,7 +2619,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImpor
2522
2619
  args: ['input', ['$event']]
2523
2620
  }], onCompositionStart: [{
2524
2621
  type: HostListener,
2525
- args: ['compositionstart', ['$event']]
2622
+ args: ['compositionstart']
2526
2623
  }], onCompositionEnd: [{
2527
2624
  type: HostListener,
2528
2625
  args: ['compositionend', ['$event']]
@@ -2621,10 +2718,10 @@ class NgxMaskPipe {
2621
2718
  });
2622
2719
  }
2623
2720
  }
2624
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2625
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskPipe, isStandalone: true, name: "mask" });
2721
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2722
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskPipe, isStandalone: true, name: "mask" });
2626
2723
  }
2627
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: NgxMaskPipe, decorators: [{
2724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: NgxMaskPipe, decorators: [{
2628
2725
  type: Pipe,
2629
2726
  args: [{
2630
2727
  name: 'mask',