use-mask-input 1.0.2 → 2.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.
- package/dist/example/App.example.d.ts +3 -0
- package/dist/{useMaskInput.test.d.ts → example/index.d.ts} +0 -0
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/useMaskInput.d.ts +3 -3
- package/node_modules/inputmask/README.md +94 -61
- package/node_modules/inputmask/dist/inputmask.es6.js +5 -0
- package/node_modules/inputmask/dist/inputmask.js +2900 -2868
- package/node_modules/inputmask/dist/inputmask.min.js +3 -3
- package/node_modules/inputmask/dist/jquery.inputmask.js +2840 -2807
- package/node_modules/inputmask/dist/jquery.inputmask.min.js +3 -3
- package/node_modules/inputmask/lib/bindings/inputmask.es6.js +5 -0
- package/node_modules/inputmask/lib/canUseDOM.js +7 -0
- package/node_modules/inputmask/lib/defaults.js +36 -2
- package/node_modules/inputmask/lib/definitions.js +1 -1
- package/node_modules/inputmask/lib/dependencyLibs/events.js +19 -9
- package/node_modules/inputmask/lib/environment.js +2 -0
- package/node_modules/inputmask/lib/eventhandlers.js +55 -44
- package/node_modules/inputmask/lib/eventruler.js +10 -9
- package/node_modules/inputmask/lib/extensions/inputmask.date.extensions.js +543 -430
- package/node_modules/inputmask/lib/extensions/inputmask.extensions.js +117 -99
- package/node_modules/inputmask/lib/extensions/inputmask.numeric.extensions.js +590 -574
- package/node_modules/inputmask/lib/global/window.js +2 -1
- package/node_modules/inputmask/lib/inputHandling.js +30 -18
- package/node_modules/inputmask/lib/inputmask.js +9 -2
- package/node_modules/inputmask/lib/inputmaskElement.js +2 -1
- package/node_modules/inputmask/lib/keycode.json +4 -0
- package/node_modules/inputmask/lib/mask-lexer.js +434 -436
- package/node_modules/inputmask/lib/mask.js +4 -4
- package/node_modules/inputmask/lib/masktoken.js +13 -0
- package/node_modules/inputmask/lib/polyfills/Array.includes.js +48 -0
- package/node_modules/inputmask/lib/{getPrototypeOf.js → polyfills/Object.getPrototypeOf.js} +0 -0
- package/node_modules/inputmask/lib/positioning.js +5 -5
- package/node_modules/inputmask/lib/validation-tests.js +108 -46
- package/node_modules/inputmask/lib/validation.js +82 -73
- package/node_modules/inputmask/package.json +41 -69
- package/package.json +40 -38
- package/node_modules/inputmask/CHANGELOG.md +0 -744
- package/node_modules/inputmask/index.js +0 -1
- package/node_modules/inputmask/lib/dependencyLibs/inputmask.dependencyLib.jqlite.js +0 -20
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
seekNext,
|
|
17
17
|
seekPrevious
|
|
18
18
|
} from "./positioning";
|
|
19
|
-
import {EventHandlers} from "./eventhandlers";
|
|
19
|
+
import { EventHandlers } from "./eventhandlers";
|
|
20
20
|
|
|
21
|
-
export {alternate, checkAlternationMatch, isComplete, isValid, refreshFromBuffer, revalidateMask, handleRemove};
|
|
21
|
+
export { alternate, checkAlternationMatch, isComplete, isSelection, isValid, refreshFromBuffer, revalidateMask, handleRemove };
|
|
22
22
|
|
|
23
23
|
//tobe put on prototype?
|
|
24
24
|
function alternate(maskPos, c, strict, fromIsValid, rAltPos, selection) { //pos == true => generalize
|
|
@@ -95,6 +95,7 @@ function alternate(maskPos, c, strict, fromIsValid, rAltPos, selection) { //pos
|
|
|
95
95
|
for (i = 0; i < validInputs.length; i++) {
|
|
96
96
|
nextPos = isValidRslt.caret || (getLastValidPosition.call(inputmask, undefined, true) + 1);
|
|
97
97
|
input = validInputs[i];
|
|
98
|
+
// nextPos = translatePosition.call(inputmask, nextPos);
|
|
98
99
|
if (!(isValidRslt = isValid.call(inputmask, nextPos, input, false, fromIsValid, true))) {
|
|
99
100
|
break;
|
|
100
101
|
}
|
|
@@ -102,7 +103,7 @@ function alternate(maskPos, c, strict, fromIsValid, rAltPos, selection) { //pos
|
|
|
102
103
|
returnRslt = isValidRslt;
|
|
103
104
|
}
|
|
104
105
|
if (maskPos == true && isValidRslt) { //return validposition on generalise
|
|
105
|
-
returnRslt = {caretPos: i};
|
|
106
|
+
returnRslt = { caretPos: i };
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
if (!isValidRslt) {
|
|
@@ -236,6 +237,10 @@ function handleRemove(input, k, pos, strict, fromIsValid) {
|
|
|
236
237
|
|
|
237
238
|
if (strict !== true) {
|
|
238
239
|
maskset.p = k === keyCode.DELETE ? pos.begin + offset : pos.begin;
|
|
240
|
+
maskset.p = determineNewCaretPosition.call(inputmask, {
|
|
241
|
+
begin: maskset.p,
|
|
242
|
+
end: maskset.p
|
|
243
|
+
}, false, opts.insertMode === false && k === keyCode.BACKSPACE ? "none" : undefined).begin;
|
|
239
244
|
}
|
|
240
245
|
}
|
|
241
246
|
}
|
|
@@ -263,19 +268,19 @@ function isComplete(buffer) { //return true / false / undefined (repeat *)
|
|
|
263
268
|
return complete;
|
|
264
269
|
}
|
|
265
270
|
|
|
271
|
+
function isSelection(posObj) {
|
|
272
|
+
const inputmask = this,
|
|
273
|
+
opts = this.opts, insertModeOffset = opts.insertMode ? 0 : 1;
|
|
274
|
+
return inputmask.isRTL ? (posObj.begin - posObj.end) > insertModeOffset : (posObj.end - posObj.begin) > insertModeOffset;
|
|
275
|
+
}
|
|
276
|
+
|
|
266
277
|
//tobe put on prototype?
|
|
267
278
|
function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromCheckval) { //strict true ~ no correction or autofill
|
|
268
279
|
const inputmask = this,
|
|
269
280
|
$ = this.dependencyLib,
|
|
270
281
|
opts = this.opts,
|
|
271
|
-
el = inputmask.el,
|
|
272
282
|
maskset = inputmask.maskset;
|
|
273
283
|
|
|
274
|
-
function isSelection(posObj) {
|
|
275
|
-
return inputmask.isRTL ? (posObj.begin - posObj.end) > 1 || ((posObj.begin - posObj.end) === 1) :
|
|
276
|
-
(posObj.end - posObj.begin) > 1 || ((posObj.end - posObj.begin) === 1);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
284
|
strict = strict === true; //always set a value to strict to prevent possible strange behavior in the extensions
|
|
280
285
|
|
|
281
286
|
var maskPos = pos;
|
|
@@ -290,7 +295,7 @@ function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromC
|
|
|
290
295
|
commandObj.remove.sort(function (a, b) {
|
|
291
296
|
return b.pos - a.pos;
|
|
292
297
|
}).forEach(function (lmnt) {
|
|
293
|
-
revalidateMask.call(inputmask, {begin: lmnt, end: lmnt + 1});
|
|
298
|
+
revalidateMask.call(inputmask, { begin: lmnt, end: lmnt + 1 });
|
|
294
299
|
});
|
|
295
300
|
commandObj.remove = undefined;
|
|
296
301
|
}
|
|
@@ -323,19 +328,22 @@ function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromC
|
|
|
323
328
|
|
|
324
329
|
function _isValid(position, c, strict) {
|
|
325
330
|
var rslt = false;
|
|
326
|
-
|
|
327
331
|
getTests.call(inputmask, position).every(function (tst, ndx) {
|
|
328
332
|
var test = tst.match;
|
|
329
333
|
//make sure the buffer is set and correct
|
|
330
334
|
getBuffer.call(inputmask, true);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
335
|
+
if (test.jit && maskset.validPositions[seekPrevious.call(inputmask, position)] === undefined) //ignore if jit is not desirable
|
|
336
|
+
{
|
|
337
|
+
rslt = false;
|
|
338
|
+
} else {
|
|
339
|
+
//return is false or a json object => { pos: ??, c: ??} or true
|
|
340
|
+
rslt = test.fn != null ?
|
|
341
|
+
test.fn.test(c, maskset, position, strict, opts, isSelection.call(inputmask, pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== "" ? //non mask
|
|
342
|
+
{
|
|
343
|
+
c: getPlaceholder.call(inputmask, position, test, true) || test.def,
|
|
344
|
+
pos: position
|
|
345
|
+
} : false;
|
|
346
|
+
}
|
|
339
347
|
if (rslt !== false) {
|
|
340
348
|
var elem = rslt.c !== undefined ? rslt.c : c, validatedPos = position;
|
|
341
349
|
elem = (elem === opts.skipOptionalPartCharacter && test.static === true) ?
|
|
@@ -377,55 +385,50 @@ function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromC
|
|
|
377
385
|
}
|
|
378
386
|
|
|
379
387
|
if (typeof opts.preValidation === "function" && fromIsValid !== true && validateOnly !== true) {
|
|
380
|
-
result = opts.preValidation.call(
|
|
388
|
+
result = opts.preValidation.call(inputmask, getBuffer.call(inputmask), maskPos, c, isSelection.call(inputmask, pos), opts, maskset, pos, strict || fromAlternate);
|
|
381
389
|
result = processCommandObject(result);
|
|
382
390
|
}
|
|
383
391
|
if (result === true) { //preValidation result
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (
|
|
398
|
-
|
|
399
|
-
skip = true;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
if (pos.end > maskPos) {
|
|
403
|
-
maskset.validPositions[maskPos] = undefined;
|
|
392
|
+
result = _isValid(maskPos, c, strict);
|
|
393
|
+
if ((!strict || fromIsValid === true) && result === false && validateOnly !== true) {
|
|
394
|
+
var currentPosValid = maskset.validPositions[maskPos];
|
|
395
|
+
if (currentPosValid && currentPosValid.match.static === true && (currentPosValid.match.def === c || c === opts.skipOptionalPartCharacter)) {
|
|
396
|
+
result = {
|
|
397
|
+
"caret": seekNext.call(inputmask, maskPos)
|
|
398
|
+
};
|
|
399
|
+
} else {
|
|
400
|
+
if (opts.insertMode || maskset.validPositions[seekNext.call(inputmask, maskPos)] === undefined || pos.end > maskPos) { //does the input match on a further position?
|
|
401
|
+
var skip = false;
|
|
402
|
+
if (maskset.jitOffset[maskPos] && maskset.validPositions[seekNext.call(inputmask, maskPos)] === undefined) {
|
|
403
|
+
result = isValid.call(inputmask, maskPos + maskset.jitOffset[maskPos], c, true, true);
|
|
404
|
+
if (result !== false) {
|
|
405
|
+
if (fromAlternate !== true) result.caret = maskPos;
|
|
406
|
+
skip = true;
|
|
404
407
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
408
|
+
}
|
|
409
|
+
if (pos.end > maskPos) {
|
|
410
|
+
maskset.validPositions[maskPos] = undefined;
|
|
411
|
+
}
|
|
412
|
+
if (!skip && !isMask.call(inputmask, maskPos, opts.keepStatic && maskPos === 0)) {
|
|
413
|
+
for (var nPos = maskPos + 1, snPos = seekNext.call(inputmask, maskPos, false, maskPos !== 0); nPos <= snPos; nPos++) {
|
|
414
|
+
// if (!isMask(nPos, true)) {
|
|
415
|
+
// continue;
|
|
416
|
+
// }
|
|
417
|
+
result = _isValid(nPos, c, strict);
|
|
418
|
+
if (result !== false) {
|
|
419
|
+
result = trackbackPositions.call(inputmask, maskPos, result.pos !== undefined ? result.pos : nPos) || result;
|
|
420
|
+
maskPos = nPos;
|
|
421
|
+
break;
|
|
416
422
|
}
|
|
417
423
|
}
|
|
418
424
|
}
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
|
-
} else {
|
|
422
|
-
result = false;
|
|
423
427
|
}
|
|
424
428
|
|
|
425
|
-
|
|
426
429
|
if (result === false && opts.keepStatic && (isComplete.call(inputmask, getBuffer.call(inputmask)) || maskPos === 0) && !strict && fromAlternate !== true) { //try fuzzy alternator logic
|
|
427
430
|
result = alternate.call(inputmask, maskPos, c, strict, fromIsValid, undefined, pos);
|
|
428
|
-
} else if (isSelection(pos) && maskset.tests[maskPos] && maskset.tests[maskPos].length > 1 && opts.keepStatic && !strict && fromAlternate !== true) { //selection clears an alternated keepstatic mask ~ #2189
|
|
431
|
+
} else if (isSelection.call(inputmask, pos) && maskset.tests[maskPos] && maskset.tests[maskPos].length > 1 && opts.keepStatic && !strict && fromAlternate !== true) { //selection clears an alternated keepstatic mask ~ #2189
|
|
429
432
|
result = alternate.call(inputmask, true);
|
|
430
433
|
}
|
|
431
434
|
|
|
@@ -436,7 +439,7 @@ function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromC
|
|
|
436
439
|
}
|
|
437
440
|
}
|
|
438
441
|
if (typeof opts.postValidation === "function" && fromIsValid !== true && validateOnly !== true) {
|
|
439
|
-
var postResult = opts.postValidation.call(
|
|
442
|
+
var postResult = opts.postValidation.call(inputmask, getBuffer.call(inputmask, true), pos.begin !== undefined ? (inputmask.isRTL ? pos.end : pos.begin) : pos, c, result, opts, maskset, strict, fromCheckval);
|
|
440
443
|
if (postResult !== undefined) {
|
|
441
444
|
result = postResult === true ? result : postResult;
|
|
442
445
|
}
|
|
@@ -455,6 +458,14 @@ function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly, fromC
|
|
|
455
458
|
|
|
456
459
|
var endResult = processCommandObject(result);
|
|
457
460
|
// console.log("returned result " + JSON.stringify(endResult));
|
|
461
|
+
if (inputmask.maxLength !== undefined) {
|
|
462
|
+
var buffer = getBuffer.call(inputmask);
|
|
463
|
+
if (buffer.length > inputmask.maxLength && !fromIsValid) {
|
|
464
|
+
resetMaskSet.call(inputmask, true);
|
|
465
|
+
maskset.validPositions = $.extend(true, {}, positionsClone); //revert validation changes
|
|
466
|
+
endResult = false;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
458
469
|
return endResult;
|
|
459
470
|
}
|
|
460
471
|
|
|
@@ -468,7 +479,7 @@ function positionCanMatchDefinition(pos, testDefinition, opts) {
|
|
|
468
479
|
for (var tndx = 0; tndx < tests.length; tndx++) {
|
|
469
480
|
if (tests[tndx].match &&
|
|
470
481
|
((tests[tndx].match["nativeDef"] === testDefinition.match[opts.shiftPositions ? "def" : "nativeDef"] && (!opts.shiftPositions || !testDefinition.match.static)) ||
|
|
471
|
-
tests[tndx].match["nativeDef"] === testDefinition.match["nativeDef"])) {
|
|
482
|
+
tests[tndx].match["nativeDef"] === testDefinition.match["nativeDef"] || (opts.regex && !tests[tndx].match.static && tests[tndx].match.fn.test(testDefinition.input)))) {
|
|
472
483
|
valid = true;
|
|
473
484
|
break;
|
|
474
485
|
} else if (tests[tndx].match && tests[tndx].match["def"] === testDefinition.match["nativeDef"]) {
|
|
@@ -489,9 +500,7 @@ function refreshFromBuffer(start, end, buffer) {
|
|
|
489
500
|
const inputmask = this,
|
|
490
501
|
maskset = this.maskset,
|
|
491
502
|
opts = this.opts,
|
|
492
|
-
$ = this.dependencyLib
|
|
493
|
-
el = inputmask.el;
|
|
494
|
-
|
|
503
|
+
$ = this.dependencyLib;
|
|
495
504
|
// checkVal.call(inputmask, el, false, true, isRTL ? buffer.reverse() : buffer);
|
|
496
505
|
var i, p, skipOptionalPartCharacter = opts.skipOptionalPartCharacter,
|
|
497
506
|
bffr = inputmask.isRTL ? buffer.slice().reverse() : buffer;
|
|
@@ -501,7 +510,7 @@ function refreshFromBuffer(start, end, buffer) {
|
|
|
501
510
|
maskset.tests = {}; //refresh tests after possible alternating
|
|
502
511
|
start = 0;
|
|
503
512
|
end = buffer.length;
|
|
504
|
-
p = determineNewCaretPosition.call(inputmask, {begin: 0, end: 0}, false).begin;
|
|
513
|
+
p = determineNewCaretPosition.call(inputmask, { begin: 0, end: 0 }, false).begin;
|
|
505
514
|
} else {
|
|
506
515
|
for (i = start; i < end; i++) {
|
|
507
516
|
delete maskset.validPositions[i];
|
|
@@ -511,10 +520,10 @@ function refreshFromBuffer(start, end, buffer) {
|
|
|
511
520
|
|
|
512
521
|
var keypress = new $.Event("keypress");
|
|
513
522
|
for (i = start; i < end; i++) {
|
|
514
|
-
keypress.
|
|
523
|
+
keypress.keyCode = bffr[i].toString().charCodeAt(0);
|
|
515
524
|
inputmask.ignorable = false; //make sure ignorable is ignored ;-)
|
|
516
|
-
var valResult = EventHandlers.keypressEvent.call(
|
|
517
|
-
if (valResult !== false) {
|
|
525
|
+
var valResult = EventHandlers.keypressEvent.call(inputmask, keypress, true, false, false, p);
|
|
526
|
+
if (valResult !== false && valResult !== undefined) {
|
|
518
527
|
p = valResult.forwardPosition;
|
|
519
528
|
}
|
|
520
529
|
}
|
|
@@ -537,7 +546,7 @@ function trackbackPositions(originalPos, newPos, fillOnly) {
|
|
|
537
546
|
}
|
|
538
547
|
}
|
|
539
548
|
for (var ps = originalPos; ps < newPos; ps++) {
|
|
540
|
-
if (maskset.validPositions[ps] === undefined && !isMask.call(inputmask, ps,
|
|
549
|
+
if (maskset.validPositions[ps] === undefined && !isMask.call(inputmask, ps, false)) {
|
|
541
550
|
var vp = ps == 0 ? getTest.call(inputmask, ps) : maskset.validPositions[ps - 1];
|
|
542
551
|
if (vp) {
|
|
543
552
|
var tests = getTests.call(inputmask, ps).slice();
|
|
@@ -579,14 +588,15 @@ function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
|
|
|
579
588
|
return false;
|
|
580
589
|
}
|
|
581
590
|
|
|
582
|
-
var offset = 0, begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos
|
|
591
|
+
var offset = 0, begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos,
|
|
592
|
+
valid = true;
|
|
583
593
|
if (pos.begin > pos.end) {
|
|
584
594
|
begin = pos.end;
|
|
585
595
|
end = pos.begin;
|
|
586
596
|
}
|
|
587
597
|
|
|
588
598
|
validatedPos = validatedPos !== undefined ? validatedPos : begin;
|
|
589
|
-
if (begin !== end || (opts.insertMode && maskset.validPositions[validatedPos] !== undefined && fromIsValid === undefined) || validTest === undefined) {
|
|
599
|
+
if (begin !== end || (opts.insertMode && maskset.validPositions[validatedPos] !== undefined && fromIsValid === undefined) || validTest === undefined || validTest.match.optionalQuantifier || validTest.match.optionality) {
|
|
590
600
|
//reposition & revalidate others
|
|
591
601
|
var positionsClone = $.extend(true, {}, maskset.validPositions),
|
|
592
602
|
lvp = getLastValidPosition.call(inputmask, undefined, true),
|
|
@@ -598,8 +608,8 @@ function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
|
|
|
598
608
|
if (validTest === undefined) delete maskset.tests[i + 1];
|
|
599
609
|
}
|
|
600
610
|
|
|
601
|
-
var
|
|
602
|
-
posMatch = j, t, canMatch;
|
|
611
|
+
var j = validatedPos,
|
|
612
|
+
posMatch = j, t, canMatch, test;
|
|
603
613
|
|
|
604
614
|
if (validTest) {
|
|
605
615
|
maskset.validPositions[validatedPos] = $.extend(true, {}, validTest);
|
|
@@ -613,10 +623,10 @@ function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
|
|
|
613
623
|
begin: begin,
|
|
614
624
|
end: end
|
|
615
625
|
})))) {
|
|
616
|
-
while (getTest.call(inputmask, posMatch).match.def !== "") { //loop needed to match further positions
|
|
626
|
+
while (test = getTest.call(inputmask, posMatch), test.match.def !== "") { //loop needed to match further positions
|
|
617
627
|
if ((canMatch = positionCanMatchDefinition.call(inputmask, posMatch, t, opts)) !== false || t.match.def === "+") { //validated match //we still need some hackery for the + validator (numeric alias)
|
|
618
628
|
if (t.match.def === "+") getBuffer.call(inputmask, true);
|
|
619
|
-
var result = isValid.call(inputmask, posMatch, t.input, t.match.def !== "+", t.match.def !== "+");
|
|
629
|
+
var result = isValid.call(inputmask, posMatch, t.input, t.match.def !== "+", /*t.match.def !== "+"*/ true);
|
|
620
630
|
valid = result !== false;
|
|
621
631
|
j = (result.pos || posMatch) + 1;
|
|
622
632
|
if (!valid && canMatch) break;
|
|
@@ -627,7 +637,7 @@ function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
|
|
|
627
637
|
if (validTest === undefined && t.match.static && i === pos.begin) offset++;
|
|
628
638
|
break;
|
|
629
639
|
}
|
|
630
|
-
if (!valid && posMatch > maskset.maskLength) {
|
|
640
|
+
if (!valid && getBuffer.call(inputmask), posMatch > maskset.maskLength) {
|
|
631
641
|
break;
|
|
632
642
|
}
|
|
633
643
|
posMatch++;
|
|
@@ -640,7 +650,6 @@ function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
|
|
|
640
650
|
}
|
|
641
651
|
if (!valid) break;
|
|
642
652
|
}
|
|
643
|
-
|
|
644
653
|
if (!valid) {
|
|
645
654
|
maskset.validPositions = $.extend(true, {}, positionsClone);
|
|
646
655
|
resetMaskSet.call(inputmask, true);
|
|
@@ -1,68 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-9gqau4tb0oaxYiymLC43KU/aAXHVofya7ilGIxqKONbSh7LNKRHmpw6mhuH2D4yykRlcNhS9zI/FOsrAQmltQA==",
|
|
6
|
-
"_location": "/inputmask",
|
|
7
|
-
"_phantomChildren": {},
|
|
8
|
-
"_requested": {
|
|
9
|
-
"type": "range",
|
|
10
|
-
"registry": true,
|
|
11
|
-
"raw": "inputmask@^5.0.5",
|
|
12
|
-
"name": "inputmask",
|
|
13
|
-
"escapedName": "inputmask",
|
|
14
|
-
"rawSpec": "^5.0.5",
|
|
15
|
-
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "^5.0.5"
|
|
17
|
-
},
|
|
18
|
-
"_requiredBy": [
|
|
19
|
-
"/"
|
|
20
|
-
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/inputmask/-/inputmask-5.0.5.tgz",
|
|
22
|
-
"_shasum": "93af99c35fc108d590e9bbd3ec6cc9b9a2e7c2ed",
|
|
23
|
-
"_spec": "inputmask@^5.0.5",
|
|
24
|
-
"_where": "/Users/edu/Projetos/use-mask-input",
|
|
25
|
-
"author": {
|
|
26
|
-
"name": "Robin Herbots",
|
|
27
|
-
"url": "https://github.com/RobinHerbots"
|
|
28
|
-
},
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/RobinHerbots/Inputmask/issues"
|
|
31
|
-
},
|
|
32
|
-
"bundleDependencies": false,
|
|
33
|
-
"deprecated": false,
|
|
2
|
+
"name": "inputmask",
|
|
3
|
+
"version": "5.0.7",
|
|
34
4
|
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
|
|
35
|
-
"
|
|
36
|
-
"@babel/core": "^7.10.5",
|
|
37
|
-
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
|
|
38
|
-
"@babel/preset-env": "^7.10.4",
|
|
39
|
-
"@babel/preset-typescript": "7.10.4",
|
|
40
|
-
"@robinherbots/grunt-available-tasks": "^0.6.4",
|
|
41
|
-
"@robinherbots/grunt-nuget": "^0.3.2",
|
|
42
|
-
"babel-loader": "^8.1.0",
|
|
43
|
-
"grunt": "^1.2.1",
|
|
44
|
-
"grunt-bump": "^0.8.0",
|
|
45
|
-
"grunt-contrib-clean": "^2.0.0",
|
|
46
|
-
"grunt-contrib-copy": "^1.0.0",
|
|
47
|
-
"grunt-eslint": "^23.0.0",
|
|
48
|
-
"grunt-release": "^0.14.0",
|
|
49
|
-
"grunt-webpack": "^4.0.2",
|
|
50
|
-
"jqlite": "^0.2.42",
|
|
51
|
-
"jquery": "^3.5.1",
|
|
52
|
-
"jsdom": "^16.3.0",
|
|
53
|
-
"load-grunt-tasks": "^5.1.0",
|
|
54
|
-
"lodash": "^4.17.19",
|
|
55
|
-
"qunit": "^2.10.1",
|
|
56
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
57
|
-
"webpack": "^4.44.0",
|
|
58
|
-
"webpack-cli": "^3.3.12"
|
|
59
|
-
},
|
|
5
|
+
"main": "dist/inputmask.js",
|
|
60
6
|
"files": [
|
|
61
7
|
"bundle.js",
|
|
62
8
|
"dist/",
|
|
63
9
|
"lib/"
|
|
64
10
|
],
|
|
65
|
-
"
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "webpack --progress --watch --config-name main --config webpack.config.js",
|
|
13
|
+
"jquery": "webpack --progress --watch --config-name jquery --config webpack.config.js",
|
|
14
|
+
"test": "grunt validate"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/RobinHerbots/Inputmask.git"
|
|
19
|
+
},
|
|
66
20
|
"keywords": [
|
|
67
21
|
"form",
|
|
68
22
|
"input",
|
|
@@ -72,17 +26,35 @@
|
|
|
72
26
|
"mask",
|
|
73
27
|
"plugins"
|
|
74
28
|
],
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"repository": {
|
|
79
|
-
"type": "git",
|
|
80
|
-
"url": "git+https://github.com/RobinHerbots/Inputmask.git"
|
|
29
|
+
"author": {
|
|
30
|
+
"name": "Robin Herbots",
|
|
31
|
+
"url": "https://github.com/RobinHerbots"
|
|
81
32
|
},
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"test": "grunt validate"
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/RobinHerbots/Inputmask/issues"
|
|
86
36
|
},
|
|
87
|
-
"
|
|
37
|
+
"homepage": "https://github.com/RobinHerbots/Inputmask",
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@babel/core": "^7.16.5",
|
|
40
|
+
"@babel/plugin-transform-modules-commonjs": "^7.16.5",
|
|
41
|
+
"@babel/preset-env": "^7.16.5",
|
|
42
|
+
"@babel/preset-typescript": "^7.16.5",
|
|
43
|
+
"@robinherbots/grunt-available-tasks": "^0.6.4",
|
|
44
|
+
"@robinherbots/grunt-nuget": "^0.3.2",
|
|
45
|
+
"babel-loader": "^8.2.3",
|
|
46
|
+
"grunt": "^1.4.1",
|
|
47
|
+
"grunt-bump": "^0.8.0",
|
|
48
|
+
"grunt-contrib-clean": "^2.0.0",
|
|
49
|
+
"grunt-contrib-copy": "^1.0.0",
|
|
50
|
+
"grunt-eslint": "^24.0.0",
|
|
51
|
+
"grunt-release": "^0.14.0",
|
|
52
|
+
"grunt-webpack": "^5.0.0",
|
|
53
|
+
"jquery": "^3.6.0",
|
|
54
|
+
"load-grunt-tasks": "^5.1.0",
|
|
55
|
+
"lodash": "^4.17.21",
|
|
56
|
+
"qunit": "^2.17.2",
|
|
57
|
+
"webpack": "^5.65.0",
|
|
58
|
+
"webpack-cli": "^4.9.1"
|
|
59
|
+
}
|
|
88
60
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-mask-input",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "A react Hook for build elegant input masks. Compatible with React Hook Form",
|
|
5
5
|
"author": "eduardoborges",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "https://github.com/eduardoborges/use-mask-input",
|
|
@@ -13,52 +13,54 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "microbundle-crl --no-compress --format modern,cjs",
|
|
16
|
-
"start": "
|
|
17
|
-
"prepare": "run
|
|
18
|
-
"test": "
|
|
19
|
-
"test:build": "run
|
|
16
|
+
"start": "vite",
|
|
17
|
+
"prepare": "npm run build",
|
|
18
|
+
"test": "concurrently \"test:unit test:lint test:build\"",
|
|
19
|
+
"test:build": "npm run build",
|
|
20
20
|
"test:lint": "eslint .",
|
|
21
|
-
"test:unit": "
|
|
22
|
-
"test:watch": "
|
|
23
|
-
"predeploy": "
|
|
24
|
-
"deploy": "gh-pages -d example/build"
|
|
21
|
+
"test:unit": "",
|
|
22
|
+
"test:watch": "",
|
|
23
|
+
"predeploy": "npm install && npm run build"
|
|
25
24
|
},
|
|
26
25
|
"peerDependencies": {
|
|
27
|
-
"react": "^
|
|
26
|
+
"react": "^17.x",
|
|
27
|
+
"react-dom": "^17.x"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@types/
|
|
37
|
-
"@types/
|
|
38
|
-
"@types/
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"eslint
|
|
47
|
-
"eslint-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"react": "^
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
30
|
+
"@semantic-release/changelog": "6.0.1",
|
|
31
|
+
"@semantic-release/commit-analyzer": "9.0.2",
|
|
32
|
+
"@semantic-release/git": "10.0.1",
|
|
33
|
+
"@semantic-release/github": "8.0.5",
|
|
34
|
+
"@semantic-release/npm": "^9.0.1",
|
|
35
|
+
"@semantic-release/release-notes-generator": "10.0.3",
|
|
36
|
+
"@types/inputmask": "^5.0.3",
|
|
37
|
+
"@types/jest": "29.0.3",
|
|
38
|
+
"@types/node": "18",
|
|
39
|
+
"@types/react": "^17.x",
|
|
40
|
+
"@types/react-dom": "^17.x",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^5.38.1",
|
|
42
|
+
"@typescript-eslint/parser": "^5.38.1",
|
|
43
|
+
"@vitejs/plugin-react": "2.1.0",
|
|
44
|
+
"concurrently": "^7.4.0",
|
|
45
|
+
"cross-env": "7.0.3",
|
|
46
|
+
"eslint": "^8.24.0",
|
|
47
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
48
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
49
|
+
"eslint-plugin-import": "^2.26.0",
|
|
50
|
+
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
51
|
+
"eslint-plugin-react": "^7.31.8",
|
|
52
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
53
|
+
"gh-pages": "4.0.0",
|
|
54
|
+
"microbundle-crl": "0.13.11",
|
|
55
|
+
"semantic-release": "19.0.3",
|
|
56
|
+
"typescript": "4.8.3",
|
|
57
|
+
"vite": "3.1.3"
|
|
56
58
|
},
|
|
57
59
|
"files": [
|
|
58
60
|
"dist"
|
|
59
61
|
],
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"inputmask": "^5.0.
|
|
63
|
+
"inputmask": "^5.0.7"
|
|
62
64
|
},
|
|
63
65
|
"bundleDependencies": [
|
|
64
66
|
"inputmask"
|