ngx-mask 14.0.3 → 14.2.2
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.
- package/README.md +1 -1
- package/esm2020/lib/mask-applier.service.mjs +3 -3
- package/esm2020/lib/mask.directive.mjs +3 -3
- package/esm2020/lib/mask.pipe.mjs +3 -3
- package/esm2020/lib/mask.service.mjs +13 -8
- package/esm2020/lib/ngx-mask.module.mjs +4 -4
- package/fesm2015/ngx-mask.mjs +25 -20
- package/fesm2015/ngx-mask.mjs.map +1 -1
- package/fesm2020/ngx-mask.mjs +25 -20
- package/fesm2020/ngx-mask.mjs.map +1 -1
- package/lib/mask.service.d.ts +1 -0
- package/package.json +3 -5
package/fesm2020/ngx-mask.mjs
CHANGED
|
@@ -586,9 +586,9 @@ class MaskApplierService {
|
|
|
586
586
|
}));
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
MaskApplierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
590
|
-
MaskApplierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
591
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
589
|
+
MaskApplierService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskApplierService, deps: [{ token: config }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
590
|
+
MaskApplierService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskApplierService });
|
|
591
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskApplierService, decorators: [{
|
|
592
592
|
type: Injectable
|
|
593
593
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
594
594
|
type: Inject,
|
|
@@ -660,6 +660,10 @@ class MaskService extends MaskApplierService {
|
|
|
660
660
|
? this.shiftTypedSymbols(actualResult.join(''))
|
|
661
661
|
: inputValue;
|
|
662
662
|
}
|
|
663
|
+
if (this.showMaskTyped) {
|
|
664
|
+
// eslint-disable-next-line no-param-reassign
|
|
665
|
+
inputValue = this.removeMask(inputValue);
|
|
666
|
+
}
|
|
663
667
|
newInputValue = Boolean(newInputValue) && newInputValue.length ? newInputValue : inputValue;
|
|
664
668
|
const result = super.applyMask(newInputValue, maskExpression, position, justPasted, backspaced, cb);
|
|
665
669
|
this.actualValue = this.getActualValue(result);
|
|
@@ -939,15 +943,16 @@ class MaskService extends MaskApplierService {
|
|
|
939
943
|
_regExpForRemove(specialCharactersForRemove) {
|
|
940
944
|
return new RegExp(specialCharactersForRemove.map((item) => `\\${item}`).join('|'), 'gi');
|
|
941
945
|
}
|
|
946
|
+
_replaceDecimalMarkerToDot(value) {
|
|
947
|
+
const markers = Array.isArray(this.decimalMarker) ? this.decimalMarker : [this.decimalMarker];
|
|
948
|
+
return value.replace(this._regExpForRemove(markers), '.');
|
|
949
|
+
}
|
|
942
950
|
_checkSymbols(result) {
|
|
943
951
|
if (result === '') {
|
|
944
952
|
return result;
|
|
945
953
|
}
|
|
946
954
|
const separatorPrecision = this._retrieveSeparatorPrecision(this.maskExpression);
|
|
947
|
-
|
|
948
|
-
if (this.decimalMarker !== '.' && !Array.isArray(this.decimalMarker)) {
|
|
949
|
-
separatorValue = separatorValue.replace(this.decimalMarker, '.');
|
|
950
|
-
}
|
|
955
|
+
const separatorValue = this._replaceDecimalMarkerToDot(this._retrieveSeparatorValue(result));
|
|
951
956
|
if (!this.isNumberValue) {
|
|
952
957
|
return separatorValue;
|
|
953
958
|
}
|
|
@@ -973,9 +978,9 @@ class MaskService extends MaskApplierService {
|
|
|
973
978
|
return Number(separatorValue);
|
|
974
979
|
}
|
|
975
980
|
}
|
|
976
|
-
MaskService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
977
|
-
MaskService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.
|
|
978
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
981
|
+
MaskService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskService, deps: [{ token: DOCUMENT }, { token: config }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
982
|
+
MaskService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskService });
|
|
983
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskService, decorators: [{
|
|
979
984
|
type: Injectable
|
|
980
985
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
981
986
|
type: Inject,
|
|
@@ -1478,8 +1483,8 @@ class MaskDirective {
|
|
|
1478
1483
|
}
|
|
1479
1484
|
}
|
|
1480
1485
|
}
|
|
1481
|
-
MaskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
1482
|
-
MaskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.
|
|
1486
|
+
MaskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskDirective, deps: [{ token: DOCUMENT }, { token: MaskService }, { token: config }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1487
|
+
MaskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.1", type: MaskDirective, selector: "input[mask], textarea[mask]", inputs: { maskExpression: ["mask", "maskExpression"], specialCharacters: "specialCharacters", patterns: "patterns", prefix: "prefix", suffix: "suffix", thousandSeparator: "thousandSeparator", decimalMarker: "decimalMarker", dropSpecialCharacters: "dropSpecialCharacters", hiddenInput: "hiddenInput", showMaskTyped: "showMaskTyped", placeHolderCharacter: "placeHolderCharacter", shownMaskExpression: "shownMaskExpression", showTemplate: "showTemplate", clearIfNotMatch: "clearIfNotMatch", validation: "validation", separatorLimit: "separatorLimit", allowNegativeNumbers: "allowNegativeNumbers", leadZeroDateTime: "leadZeroDateTime", triggerOnMaskChange: "triggerOnMaskChange" }, outputs: { maskFilled: "maskFilled" }, host: { listeners: { "paste": "onPaste()", "ngModelChange": "onModelChange($event)", "input": "onInput($event)", "blur": "onBlur()", "click": "onClick($event)", "keydown": "onKeyDown($event)" } }, providers: [
|
|
1483
1488
|
{
|
|
1484
1489
|
provide: NG_VALUE_ACCESSOR,
|
|
1485
1490
|
useExisting: forwardRef(() => MaskDirective),
|
|
@@ -1492,7 +1497,7 @@ MaskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version:
|
|
|
1492
1497
|
},
|
|
1493
1498
|
MaskService,
|
|
1494
1499
|
], exportAs: ["mask", "ngxMask"], usesOnChanges: true, ngImport: i0 });
|
|
1495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
1500
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskDirective, decorators: [{
|
|
1496
1501
|
type: Directive,
|
|
1497
1502
|
args: [{
|
|
1498
1503
|
selector: 'input[mask], textarea[mask]',
|
|
@@ -1595,9 +1600,9 @@ class MaskPipe {
|
|
|
1595
1600
|
return this._maskService.applyMaskWithPattern(`${value}`, mask);
|
|
1596
1601
|
}
|
|
1597
1602
|
}
|
|
1598
|
-
MaskPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
1599
|
-
MaskPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.
|
|
1600
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
1603
|
+
MaskPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskPipe, deps: [{ token: MaskApplierService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1604
|
+
MaskPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: MaskPipe, name: "mask" });
|
|
1605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: MaskPipe, decorators: [{
|
|
1601
1606
|
type: Pipe,
|
|
1602
1607
|
args: [{
|
|
1603
1608
|
name: 'mask',
|
|
@@ -1641,10 +1646,10 @@ class NgxMaskModule {
|
|
|
1641
1646
|
};
|
|
1642
1647
|
}
|
|
1643
1648
|
}
|
|
1644
|
-
NgxMaskModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.
|
|
1645
|
-
NgxMaskModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.
|
|
1646
|
-
NgxMaskModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.
|
|
1647
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.
|
|
1649
|
+
NgxMaskModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NgxMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1650
|
+
NgxMaskModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: NgxMaskModule, declarations: [MaskDirective, MaskPipe], exports: [MaskDirective, MaskPipe] });
|
|
1651
|
+
NgxMaskModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NgxMaskModule });
|
|
1652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NgxMaskModule, decorators: [{
|
|
1648
1653
|
type: NgModule,
|
|
1649
1654
|
args: [{
|
|
1650
1655
|
exports: [MaskDirective, MaskPipe],
|