inputmask
Advanced tools
Comparing version 5.0.9-beta.17 to 5.0.9-beta.18
@@ -1,2 +0,2 @@ | ||
import {keys} from "./keycode.js"; | ||
import {keys, ignorables} from "./keycode.js"; | ||
@@ -54,40 +54,3 @@ export default { | ||
//specify keyCodes which should not be considered in the keypress event, otherwise the preventDefault will stop their default behavior especially in FF | ||
ignorables: [ | ||
keys.Backspace, | ||
keys.Tab, | ||
keys.Pause, | ||
keys.Escape, | ||
keys.PageUp, | ||
keys.PageDown, | ||
keys.End, | ||
keys.Home, | ||
keys.ArrowLeft, | ||
keys.ArrowUp, | ||
keys.ArrowRight, | ||
keys.ArrowDown, | ||
keys.Insert, | ||
keys.Delete, | ||
keys.ContextMenu, | ||
keys.F1, | ||
keys.F2, | ||
keys.F3, | ||
keys.F4, | ||
keys.F5, | ||
keys.F6, | ||
keys.F7, | ||
keys.F8, | ||
keys.F9, | ||
keys.F10, | ||
keys.F11, | ||
keys.F12, | ||
keys.Process, | ||
keys.Unidentified, | ||
keys.Shift, | ||
keys.Control, | ||
keys.Alt, | ||
keys.Tab, | ||
keys.AltGraph, | ||
keys.CapsLock, | ||
keys.Dead, | ||
], | ||
ignorables: Object.keys(ignorables), | ||
isComplete: null, //override for isComplete - args => buffer, opts - return true || false | ||
@@ -94,0 +57,0 @@ preValidation: null, //hook to preValidate the input. Usefull for validating regardless the definition. args => buffer, pos, char, isSelection, opts, maskset, caretPos, strict => return true/false/command object |
@@ -1,4 +0,5 @@ | ||
export {keyCode, toKey, toKeyCode, keys}; | ||
export {keyCode, toKey, toKeyCode, keys, ignorables}; | ||
const keyCode = { | ||
const ignorables = { | ||
"Alt": 18, | ||
"AltGraph": 18, | ||
@@ -10,26 +11,9 @@ "ArrowDown": 40, | ||
"Backspace": 8, | ||
"BACKSPACE_SAFARI": 127, | ||
"CapsLock": 20, | ||
"Control": 17, | ||
"ContextMenu": 93, | ||
"Dead": 221, | ||
"Delete": 46, | ||
"End": 35, | ||
"Enter": 13, | ||
"Escape": 27, | ||
"Home": 36, | ||
"Insert": 45, | ||
"PageDown": 34, | ||
"PageUp": 33, | ||
"Space": 32, | ||
"Tab": 9, | ||
"c": 67, | ||
"x": 88, | ||
"z": 90, | ||
"Shift": 16, | ||
"Control": 17, | ||
"Alt": 18, | ||
"Pause": 19, | ||
"Meta_LEFT": 91, | ||
"Meta_RIGHT": 92, | ||
"ContextMenu": 93, | ||
"Process": 229, | ||
"Unidentified": 229, | ||
"F1": 112, | ||
@@ -47,5 +31,28 @@ "F2": 113, | ||
"F12": 123, | ||
"Dead": 221 | ||
"Home": 36, | ||
"Insert": 45, | ||
"NumLock": 144, | ||
"PageDown": 34, | ||
"PageUp": 33, | ||
"Pause": 19, | ||
"PrintScreen": 44, | ||
"Process": 229, | ||
"Shift": 16, | ||
"ScrollLock": 145, | ||
"Tab": 9, | ||
"Unidentified": 229, | ||
}; | ||
var keyCode = { | ||
"c": 67, | ||
"x": 88, | ||
"z": 90, | ||
"BACKSPACE_SAFARI": 127, | ||
"Enter": 13, | ||
"Meta_LEFT": 91, | ||
"Meta_RIGHT": 92, | ||
"Space": 32, | ||
...ignorables | ||
} | ||
const keyCodeRev = Object.entries(keyCode).reduce((acc, [key, value]) => (acc[value] = acc[value] === undefined ? key : acc[value] , acc), {}); | ||
@@ -52,0 +59,0 @@ const keys = Object.entries(keyCode).reduce((acc, [key, value]) => (acc[key] = key === "Space" ? " " : key, acc), {}); |
{ | ||
"name": "inputmask", | ||
"version": "5.0.9-beta.17", | ||
"version": "5.0.9-beta.18", | ||
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.", | ||
@@ -5,0 +5,0 @@ "main": "dist/inputmask.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
938368
12430