@maskito/core
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -629,2 +629,9 @@ const MASKITO_DEFAULT_ELEMENT_PREDICATE = e => e.querySelector('input,textarea') || e; | ||
get maxLength() { | ||
const { | ||
maxLength | ||
} = this.element; | ||
return maxLength === -1 ? Infinity : maxLength; | ||
} | ||
destroy() { | ||
@@ -770,2 +777,6 @@ this.eventListener.destroy(); | ||
if (newElementState.value.length > this.maxLength) { | ||
return event.preventDefault(); | ||
} | ||
if (newPossibleValue !== newElementState.value) { | ||
@@ -772,0 +783,0 @@ event.preventDefault(); |
@@ -767,2 +767,10 @@ (function (global, factory) { | ||
}); | ||
Object.defineProperty(Maskito.prototype, "maxLength", { | ||
get: function () { | ||
var maxLength = this.element.maxLength; | ||
return maxLength === -1 ? Infinity : maxLength; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
@@ -928,2 +936,6 @@ Maskito.prototype.destroy = function () { | ||
if (newElementState.value.length > this.maxLength) { | ||
return event.preventDefault(); | ||
} | ||
if (newPossibleValue !== newElementState.value) { | ||
@@ -930,0 +942,0 @@ event.preventDefault(); |
@@ -14,2 +14,3 @@ import { MaskHistory } from './classes'; | ||
private get elementState(); | ||
private get maxLength(); | ||
destroy(): void; | ||
@@ -16,0 +17,0 @@ protected updateElementState({ value, selection }: ElementState, eventInit?: Pick<TypedInputEvent, 'data' | 'inputType'>): void; |
{ | ||
"name": "@maskito/core", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "The main zero-dependency and framework-agnostic Maskito's package to create an input mask", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84713
1697