浏览代码

update grunt + rebuild

Robin Herbots 10 年之前
父节点
当前提交
1cc3e8b588

+ 11 - 3
Gruntfile.js

@@ -154,6 +154,15 @@ module.exports = function(grunt) {
 		},
 		eslint: {
 			target: grunt.file.expand("js/*.js")
+		},
+		availabletasks: {
+			tasks: {
+				options: {
+					filter: 'exclude',
+					tasks: ['availabletasks', 'default'],
+					showTasks: ['user']
+				}
+			}
 		}
 	});
 
@@ -164,8 +173,7 @@ module.exports = function(grunt) {
 	grunt.registerTask('publish:minor', ['clean', 'bump:minor', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
 	grunt.registerTask('publish:major', ['clean', 'bump:major', 'uglify', 'shell:gitcommitchanges', 'release', 'nugetpack', 'nugetpush']);
 	grunt.registerTask('validate', ['eslint', 'karma']);
-
-	// Default task(s).
-	grunt.registerTask('default', ['bump:prerelease', 'clean', 'uglify']);
+	grunt.registerTask('build', ['bump:prerelease', 'clean', 'uglify']);
+	grunt.registerTask('default', ["availabletasks"]);
 
 };

+ 59 - 52
README_numeric.md

@@ -1,52 +1,59 @@
-## numeric extensions
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal");
-   $(selector).inputmask("decimal", { allowMinus: false });
-   $(selector).inputmask("integer");
-});
-```
-
-Define the radixpoint
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal", { radixPoint: "," });
-});
-```
-
-Define the number of digits after the radixpoint
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal", { digits: 3 });
-});
-```
-
-Define the number of digits before the radixpoint
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal", { integerDigits: 5 });
-});
-```
-
-When TAB out of the input the digits autocomplate with 0 if the digits option is given a valid number.
-
-Grouping support through:  autoGroup, groupSeparator, groupSize
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal", { radixPoint: ",", autoGroup: true, groupSeparator: ".", groupSize: 3 });
-});
-```
-
-Allow minus and/or plus symbol
-
-```javascript
-$(document).ready(function(){
-   $(selector).inputmask("decimal", { allowMinus: false });
-   $(selector).inputmask("integer", { allowMinus: false, allowPlus: true });
-});
-```
+# numeric extensions
+## aliases
+
+## Options
+### digits
+Number of fractionalDigits  
+Default: "*"
+
+### digitsOptional
+Default: true
+
+### groupSize
+Default: 3
+
+### autoGroup
+Default: false
+
+### allowPlus
+Default: true
+
+### allowMinus
+Default: true
+
+### negationSymbol
+Default: {  
+  front: "-", //"("  
+  back: "" //")"  
+}
+
+### integerDigits
+Number of integerDigits  
+Default: "+"
+
+### integerOptional
+Default: true
+
+### prefix
+Default: ""
+
+### suffix
+Default: ""
+
+### decimalProtect
+Do not allow assumption of decimals input without entering the radixpoint.  
+Default: true
+
+### min
+Minimum value
+Default: undefined
+
+### max
+Maximum value
+Default: undefined
+
+### step
+Default: 1
+
+### unmaskAsNumber
+Default: false

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-165",
+  "version": "3.1.64-166",
   "main": [
     "./dist/inputmask/jquery.inputmask.js",
     "./dist/inputmask/inputmask.js",

+ 1 - 1
component.json

@@ -2,7 +2,7 @@
     "name": "jquery_inputmask",
     "repository": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-    "version": "3.1.64-165",
+    "version": "3.1.64-166",
     "keywords": [ "jquery", "plugins", "input", "form", "inputmask", "mask" ],
     "main": "./dist/jquery.inputmask.bundle.js",
     "scripts": [

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
     "name": "robinherbots/jquery.inputmask",
     "description": "jquery.inputmask is a jquery plugin which create an input mask.",
-	"version": "3.1.64-165",
+	"version": "3.1.64-166",
     "type": "library",
     "keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
     "homepage": "http://robinherbots.github.io/jquery.inputmask",

+ 1 - 1
dist/inputmask/inputmask.date.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/inputmask.date.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/inputmask.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/inputmask.min.js


+ 5 - 4
dist/inputmask/inputmask.numeric.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);
@@ -25,9 +25,10 @@
                     opts.integerDigits < 1 && (opts.integerDigits = "*");
                 }
                 opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)), 
-                opts.radixFocus = opts.radixFocus && "" !== opts.placeholder, opts.definitions[";"] = opts.definitions["~"], 
-                opts.definitions[";"].definitionSymbol = "~", opts.numericInput === !0 && (opts.radixFocus = !1, 
-                opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
+                opts.radixFocus = opts.radixFocus && "" !== opts.placeholder && opts.integerOptional === !0, 
+                opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~", 
+                opts.numericInput === !0 && (opts.radixFocus = !1, opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), 
+                opts.decimalProtect = !1);
                 var mask = autoEscape(opts.prefix);
                 return mask += "[+]", mask += opts.integerOptional === !0 ? "~{1," + opts.integerDigits + "}" : "~{" + opts.integerDigits + "}", 
                 void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (mask += opts.digitsOptional ? "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}]" : (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}"), 

文件差异内容过多而无法显示
+ 2 - 2
dist/inputmask/inputmask.numeric.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.phone.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/inputmask.phone.extensions.min.js


+ 1 - 1
dist/inputmask/inputmask.regex.extensions.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/inputmask.regex.extensions.min.js


+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function(factory) {
     "function" == typeof define && define.amd ? define([ "jquery", "./inputmask" ], factory) : "object" == typeof exports ? module.exports = factory(require("jquery"), require("./inputmask")) : factory(jQuery);

文件差异内容过多而无法显示
+ 1 - 1
dist/inputmask/jquery.inputmask.min.js


+ 5 - 4
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2015 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 3.1.64-165
+* Version: 3.1.64-166
 */
 !function($) {
     function Inputmask(options) {
@@ -2006,9 +2006,10 @@
                     opts.integerDigits < 1 && (opts.integerDigits = "*");
                 }
                 opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)), 
-                opts.radixFocus = opts.radixFocus && "" !== opts.placeholder, opts.definitions[";"] = opts.definitions["~"], 
-                opts.definitions[";"].definitionSymbol = "~", opts.numericInput === !0 && (opts.radixFocus = !1, 
-                opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
+                opts.radixFocus = opts.radixFocus && "" !== opts.placeholder && opts.integerOptional === !0, 
+                opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~", 
+                opts.numericInput === !0 && (opts.radixFocus = !1, opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), 
+                opts.decimalProtect = !1);
                 var mask = autoEscape(opts.prefix);
                 return mask += "[+]", mask += opts.integerOptional === !0 ? "~{1," + opts.integerDigits + "}" : "~{" + opts.integerDigits + "}", 
                 void 0 !== opts.digits && (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (mask += opts.digitsOptional ? "[" + (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}]" : (opts.decimalProtect ? ":" : opts.radixPoint) + ";{" + opts.digits + "}"), 

文件差异内容过多而无法显示
+ 3 - 4
dist/jquery.inputmask.bundle.min.js


+ 1 - 1
js/inputmask.numeric.extensions.js

@@ -51,7 +51,7 @@ Optional extensions on the jquery.inputmask base
 					opts.placeholder = opts.placeholder.charAt(0);
 				}
 				//only allow radixfocus when placeholder = 0
-				opts.radixFocus = opts.radixFocus && opts.placeholder !== "";
+				opts.radixFocus = opts.radixFocus && opts.placeholder !== "" && opts.integerOptional === true;
 
 				opts.definitions[";"] = opts.definitions["~"]; //clone integer def for decimals
 				opts.definitions[";"].definitionSymbol = "~";

+ 2 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "jquery.inputmask",
-  "version": "3.1.64-165",
+  "version": "3.1.64-166",
   "description": "jquery.inputmask is a jquery plugin which create an input mask.",
   "main": "./dist/inputmask/jquery.inputmask.js",
   "files": [
@@ -43,6 +43,7 @@
   },
   "devDependencies": {
     "grunt": "^0.4.5",
+    "grunt-available-tasks": "^0.6.0",
     "grunt-bump": "^0.3.0",
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-uglify": "^0.9.1",