Initial commit,修正

This commit is contained in:
2025-07-13 19:37:38 +08:00
parent 38ce288e27
commit 65bbd06981
12384 changed files with 3985464 additions and 8 deletions
+31
View File
@@ -0,0 +1,31 @@
export default function (qunit, $, Inputmask) {
qunit.module("Phone masks");
qunit.test("inputmask(\"phone\")", function (assert) {
var $fixture = $("#qunit-fixture");
$fixture.append('<input type="text" id="testmask" />');
var testmask = document.getElementById("testmask");
Inputmask("phone", {nullable: false}).mask(testmask);
testmask.focus();
$.each(Inputmask.prototype.aliases.phone.phoneCodes, function (ndx, lmnt) {
var ndx = 1, input, expected = lmnt.mask;
while (expected.match(/#/)) {
expected = expected.replace(/#/, ndx++);
if (ndx > 9) ndx = 1;
}
input = expected;
//input = input.replace(/\+/g, "");
input = input.replace(/\(/g, "");
input = input.replace(/\)/g, "");
input = input.replace(/-/g, "");
$(testmask).val(input);
assert.equal(testmask.value, expected, "Result " + testmask.value);
});
});
};