angular-ui-mask
Advanced tools
Comparing version 1.4.5 to 1.4.6
/*! | ||
* angular-ui-mask | ||
* https://github.com/angular-ui/ui-mask | ||
* Version: 1.4.5 - 2015-09-04T09:07:09.797Z | ||
* Version: 1.4.6 - 2015-09-28T13:54:32.227Z | ||
* License: MIT | ||
@@ -425,3 +425,6 @@ */ | ||
iElement.val(valMasked); | ||
controller.$setViewValue(valUnmasked); | ||
scope.$apply(function() { | ||
controller.$setViewValue(valUnmasked); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code. | ||
}); | ||
@@ -428,0 +431,0 @@ // Caret Repositioning |
/*! | ||
* angular-ui-mask | ||
* https://github.com/angular-ui/ui-mask | ||
* Version: 1.4.5 - 2015-09-04T09:07:09.797Z | ||
* Version: 1.4.6 - 2015-09-28T13:54:32.227Z | ||
* License: MIT | ||
*/ | ||
!function(){"use strict";angular.module("ui.mask",[]).value("uiMaskConfig",{maskDefinitions:{9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},clearOnBlur:!0,eventsToHandle:["input","keyup","click","focus"]}).directive("uiMask",["uiMaskConfig",function(e){function n(e){return e===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(e.type||e.href||~e.tabIndex)}return{priority:100,require:"ngModel",restrict:"A",compile:function(){var t=e;return function(e,r,i,u){function a(e){return angular.isDefined(e)?($(e),C?(f(),h(),!0):c()):c()}function o(e){e&&(_=e,C&&r.val(v(p(r.val()))))}function l(e){return C?(P=p(e||""),q=g(P),u.$setValidity("mask",q),q&&P.length?v(P):void 0):e}function s(e){return C?(P=p(e||""),q=g(P),u.$viewValue=P.length?v(P):"",u.$setValidity("mask",q),""===P&&i.required&&u.$setValidity("required",!u.$error.required),q?N?u.$viewValue:P:void 0):e}function c(){return C=!1,d(),angular.isDefined(I)?r.attr("placeholder",I):r.removeAttr("placeholder"),angular.isDefined(K)?r.attr("maxlength",K):r.removeAttr("maxlength"),r.val(u.$modelValue),u.$viewValue=u.$modelValue,!1}function f(){P=H=p(u.$modelValue||""),T=z=v(P),q=g(P),i.maxlength&&r.attr("maxlength",2*D[D.length-1]),I||r.attr("placeholder",_);for(var e=u.$modelValue,n=u.$formatters.length;n--;)e=u.$formatters[n](e);u.$viewValue=e||"",u.$render()}function h(){F||(r.bind("blur",y),r.bind("mousedown mouseup",k),r.bind(W.eventsToHandle.join(" "),w),r.bind("paste",V),F=!0)}function d(){F&&(r.unbind("blur",y),r.unbind("mousedown",k),r.unbind("mouseup",k),r.unbind("input",w),r.unbind("keyup",w),r.unbind("click",w),r.unbind("focus",w),r.unbind("paste",V),F=!1)}function g(e){return e.length?e.length>=j:!0}function p(e){var n="",t=E.slice();return e=e.toString(),angular.forEach(R,function(n){e=e.replace(n,"")}),angular.forEach(e.split(""),function(e){t.length&&t[0].test(e)&&(n+=e,t.shift())}),n}function v(e){var n="",t=D.slice();return angular.forEach(_.split(""),function(r,i){e.length&&i===t[0]?(n+=e.charAt(0)||"_",e=e.substr(1),t.shift()):n+=r}),n}function m(e){var n=angular.isDefined(i.uiMaskPlaceholder)?i.uiMaskPlaceholder:i.placeholder;return"undefined"!=typeof n&&n[e]?n[e]:"_"}function b(){return _.replace(/[_]+/g,"_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g,"$1$2_$3").split("_")}function $(e){var n=0;if(D=[],E=[],_="","string"==typeof e){j=0;var t=!1,r=0,i=e.split("");angular.forEach(i,function(e,i){W.maskDefinitions[e]?(D.push(n),_+=m(i-r),E.push(W.maskDefinitions[e]),n++,t||j++):"?"===e?(t=!0,r++):(_+=e,n++)})}D.push(D.slice().pop()+1),R=b(),C=D.length>1?!0:!1}function y(){W.clearOnBlur&&(Z=0,B=0,q&&0!==P.length||(T="",r.val(""),e.$apply(function(){u.$setViewValue("")})))}function k(e){"mousedown"===e.type?r.bind("mouseout",x):r.unbind("mouseout",x)}function x(){B=S(this),r.unbind("mouseout",x)}function V(){A(this,r.val().length)}function w(e){e=e||{};var n=e.which,t=e.type;if(16!==n&&91!==n){var i,a=r.val(),o=z,l=p(a),s=H,c=M(this)||0,f=Z||0,h=c-f,d=D[0],g=D[l.length]||D.slice().shift(),m=B||0,b=S(this)>0,$=m>0,y=a.length>o.length||m&&a.length>o.length-m,k=a.length<o.length||m&&a.length===o.length-m,x=n>=37&&40>=n&&e.shiftKey,V=37===n,w=8===n||"keyup"!==t&&k&&-1===h,E=46===n||"keyup"!==t&&k&&0===h&&!$,_=(V||w||"click"===t)&&c>d;if(B=S(this),!x&&(!b||"click"!==t&&"keyup"!==t)){if("input"===t&&k&&!$&&l===s){for(;w&&c>d&&!O(c);)c--;for(;E&&g>c&&-1===D.indexOf(c);)c++;var R=D.indexOf(c);l=l.substring(0,R)+l.substring(R+1)}for(i=v(l),z=i,H=l,r.val(i),u.$setViewValue(l),y&&d>=c&&(c=d+1),_&&c--,c=c>g?g:d>c?d:c;!O(c)&&c>d&&g>c;)c+=_?-1:1;(_&&g>c||y&&!O(f))&&c++,Z=c,A(this,c)}}}function O(e){return D.indexOf(e)>-1}function M(e){if(!e)return 0;if(void 0!==e.selectionStart)return e.selectionStart;if(document.selection&&n(r[0])){e.focus();var t=document.selection.createRange();return t.moveStart("character",e.value?-e.value.length:0),t.text.length}return 0}function A(e,t){if(!e)return 0;if(0!==e.offsetWidth&&0!==e.offsetHeight)if(e.setSelectionRange)n(r[0])&&(e.focus(),e.setSelectionRange(t,t));else if(e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",t),i.moveStart("character",t),i.select()}}function S(e){return e?void 0!==e.selectionStart?e.selectionEnd-e.selectionStart:document.selection?document.selection.createRange().text.length:0:0}var D,E,_,R,j,P,T,q,z,H,Z,B,C=!1,F=!1,I=i.placeholder,K=i.maxlength,N=!1;i.$observe("modelViewValue",function(e){"true"===e&&(N=!0)});var W={};i.uiOptions?(W=e.$eval("["+i.uiOptions+"]"),angular.isObject(W[0])&&(W=function(e,n){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(void 0===n[t]?n[t]=angular.copy(e[t]):angular.isObject(n[t])&&angular.extend(n[t],e[t]));return n}(t,W[0]))):W=t,i.$observe("uiMask",a),angular.isDefined(i.uiMaskPlaceholder)?i.$observe("uiMaskPlaceholder",o):i.$observe("placeholder",o),u.$formatters.push(l),u.$parsers.push(s),r.bind("mousedown mouseup",k),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null===this)throw new TypeError;var n=Object(this),t=n.length>>>0;if(0===t)return-1;var r=0;if(arguments.length>1&&(r=Number(arguments[1]),r!==r?r=0:0!==r&&r!==1/0&&r!==-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=t)return-1;for(var i=r>=0?r:Math.max(t-Math.abs(r),0);t>i;i++)if(i in n&&n[i]===e)return i;return-1})}}}}])}(); | ||
!function(){"use strict";angular.module("ui.mask",[]).value("uiMaskConfig",{maskDefinitions:{9:/\d/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},clearOnBlur:!0,eventsToHandle:["input","keyup","click","focus"]}).directive("uiMask",["uiMaskConfig",function(e){function n(e){return e===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(e.type||e.href||~e.tabIndex)}return{priority:100,require:"ngModel",restrict:"A",compile:function(){var t=e;return function(e,r,i,u){function a(e){return angular.isDefined(e)?($(e),C?(f(),h(),!0):c()):c()}function o(e){e&&(_=e,C&&r.val(v(p(r.val()))))}function l(e){return C?(P=p(e||""),q=g(P),u.$setValidity("mask",q),q&&P.length?v(P):void 0):e}function s(e){return C?(P=p(e||""),q=g(P),u.$viewValue=P.length?v(P):"",u.$setValidity("mask",q),""===P&&i.required&&u.$setValidity("required",!u.$error.required),q?N?u.$viewValue:P:void 0):e}function c(){return C=!1,d(),angular.isDefined(I)?r.attr("placeholder",I):r.removeAttr("placeholder"),angular.isDefined(K)?r.attr("maxlength",K):r.removeAttr("maxlength"),r.val(u.$modelValue),u.$viewValue=u.$modelValue,!1}function f(){P=H=p(u.$modelValue||""),T=z=v(P),q=g(P),i.maxlength&&r.attr("maxlength",2*D[D.length-1]),I||r.attr("placeholder",_);for(var e=u.$modelValue,n=u.$formatters.length;n--;)e=u.$formatters[n](e);u.$viewValue=e||"",u.$render()}function h(){F||(r.bind("blur",y),r.bind("mousedown mouseup",k),r.bind(W.eventsToHandle.join(" "),w),r.bind("paste",V),F=!0)}function d(){F&&(r.unbind("blur",y),r.unbind("mousedown",k),r.unbind("mouseup",k),r.unbind("input",w),r.unbind("keyup",w),r.unbind("click",w),r.unbind("focus",w),r.unbind("paste",V),F=!1)}function g(e){return e.length?e.length>=j:!0}function p(e){var n="",t=E.slice();return e=e.toString(),angular.forEach(R,function(n){e=e.replace(n,"")}),angular.forEach(e.split(""),function(e){t.length&&t[0].test(e)&&(n+=e,t.shift())}),n}function v(e){var n="",t=D.slice();return angular.forEach(_.split(""),function(r,i){e.length&&i===t[0]?(n+=e.charAt(0)||"_",e=e.substr(1),t.shift()):n+=r}),n}function m(e){var n=angular.isDefined(i.uiMaskPlaceholder)?i.uiMaskPlaceholder:i.placeholder;return"undefined"!=typeof n&&n[e]?n[e]:"_"}function b(){return _.replace(/[_]+/g,"_").replace(/([^_]+)([a-zA-Z0-9])([^_])/g,"$1$2_$3").split("_")}function $(e){var n=0;if(D=[],E=[],_="","string"==typeof e){j=0;var t=!1,r=0,i=e.split("");angular.forEach(i,function(e,i){W.maskDefinitions[e]?(D.push(n),_+=m(i-r),E.push(W.maskDefinitions[e]),n++,t||j++):"?"===e?(t=!0,r++):(_+=e,n++)})}D.push(D.slice().pop()+1),R=b(),C=D.length>1?!0:!1}function y(){W.clearOnBlur&&(Z=0,B=0,q&&0!==P.length||(T="",r.val(""),e.$apply(function(){u.$setViewValue("")})))}function k(e){"mousedown"===e.type?r.bind("mouseout",x):r.unbind("mouseout",x)}function x(){B=S(this),r.unbind("mouseout",x)}function V(){A(this,r.val().length)}function w(n){n=n||{};var t=n.which,i=n.type;if(16!==t&&91!==t){var a,o=r.val(),l=z,s=p(o),c=H,f=M(this)||0,h=Z||0,d=f-h,g=D[0],m=D[s.length]||D.slice().shift(),b=B||0,$=S(this)>0,y=b>0,k=o.length>l.length||b&&o.length>l.length-b,x=o.length<l.length||b&&o.length===l.length-b,V=t>=37&&40>=t&&n.shiftKey,w=37===t,E=8===t||"keyup"!==i&&x&&-1===d,_=46===t||"keyup"!==i&&x&&0===d&&!y,R=(w||E||"click"===i)&&f>g;if(B=S(this),!V&&(!$||"click"!==i&&"keyup"!==i)){if("input"===i&&x&&!y&&s===c){for(;E&&f>g&&!O(f);)f--;for(;_&&m>f&&-1===D.indexOf(f);)f++;var j=D.indexOf(f);s=s.substring(0,j)+s.substring(j+1)}for(a=v(s),z=a,H=s,r.val(a),e.$apply(function(){u.$setViewValue(s)}),k&&g>=f&&(f=g+1),R&&f--,f=f>m?m:g>f?g:f;!O(f)&&f>g&&m>f;)f+=R?-1:1;(R&&m>f||k&&!O(h))&&f++,Z=f,A(this,f)}}}function O(e){return D.indexOf(e)>-1}function M(e){if(!e)return 0;if(void 0!==e.selectionStart)return e.selectionStart;if(document.selection&&n(r[0])){e.focus();var t=document.selection.createRange();return t.moveStart("character",e.value?-e.value.length:0),t.text.length}return 0}function A(e,t){if(!e)return 0;if(0!==e.offsetWidth&&0!==e.offsetHeight)if(e.setSelectionRange)n(r[0])&&(e.focus(),e.setSelectionRange(t,t));else if(e.createTextRange){var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",t),i.moveStart("character",t),i.select()}}function S(e){return e?void 0!==e.selectionStart?e.selectionEnd-e.selectionStart:document.selection?document.selection.createRange().text.length:0:0}var D,E,_,R,j,P,T,q,z,H,Z,B,C=!1,F=!1,I=i.placeholder,K=i.maxlength,N=!1;i.$observe("modelViewValue",function(e){"true"===e&&(N=!0)});var W={};i.uiOptions?(W=e.$eval("["+i.uiOptions+"]"),angular.isObject(W[0])&&(W=function(e,n){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(void 0===n[t]?n[t]=angular.copy(e[t]):angular.isObject(n[t])&&angular.extend(n[t],e[t]));return n}(t,W[0]))):W=t,i.$observe("uiMask",a),angular.isDefined(i.uiMaskPlaceholder)?i.$observe("uiMaskPlaceholder",o):i.$observe("placeholder",o),u.$formatters.push(l),u.$parsers.push(s),r.bind("mousedown mouseup",k),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){if(null===this)throw new TypeError;var n=Object(this),t=n.length>>>0;if(0===t)return-1;var r=0;if(arguments.length>1&&(r=Number(arguments[1]),r!==r?r=0:0!==r&&r!==1/0&&r!==-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=t)return-1;for(var i=r>=0?r:Math.max(t-Math.abs(r),0);t>i;i++)if(i in n&&n[i]===e)return i;return-1})}}}}])}(); |
144
gulpfile.js
@@ -13,24 +13,20 @@ var fs = require('fs'); | ||
var plumber = require('gulp-plumber');//To prevent pipe breaking caused by errors at 'watch' | ||
var git = require('gulp-git'); | ||
var bump = require('gulp-bump'); | ||
var runSequence = require('run-sequence'); | ||
var geSaLaKaCuLa = require('gesalakacula'); | ||
var reKaLa = geSaLaKaCuLa.recursiveKarmaLauncher; | ||
var versionAfterBump; | ||
var config = { | ||
pkg : JSON.parse(fs.readFileSync('./package.json')), | ||
banner: | ||
'/*!\n' + | ||
' * <%= pkg.name %>\n' + | ||
' * <%= pkg.homepage %>\n' + | ||
' * Version: <%= pkg.version %> - <%= timestamp %>\n' + | ||
' * License: <%= pkg.license %>\n' + | ||
' */\n\n\n' | ||
}; | ||
gulp.task('default', ['build','test']); | ||
gulp.task('default', ['build', 'test']); | ||
gulp.task('ci', ['karma-sauce']); | ||
gulp.task('build', ['scripts']); | ||
gulp.task('test', ['build', 'karma']); | ||
gulp.task('watch', ['build','karma-watch'], function() { | ||
gulp.watch(['src/**/*.{js,html}'], ['build']); | ||
gulp.task('watch', ['build', 'karma-watch'], function() { | ||
gulp.watch(['src/**/*.{js,html}'], ['build']); | ||
}); | ||
gulp.task('clean', function(cb) { | ||
del(['dist'], cb); | ||
del(['dist'], cb); | ||
}); | ||
@@ -40,26 +36,36 @@ | ||
var buildLib = function(){ | ||
return gulp.src(['src/*.js']) | ||
.pipe(plumber({ | ||
errorHandler: handleError | ||
})) | ||
.pipe(header('(function () { \n\'use strict\';\n')) | ||
.pipe(footer('\n}());')) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
.pipe(jshint.reporter('fail')); | ||
}; | ||
var buildLib = function() { | ||
return gulp.src(['src/*.js']) | ||
.pipe(plumber({ | ||
errorHandler: handleError | ||
})) | ||
.pipe(header('(function () { \n\'use strict\';\n')) | ||
.pipe(footer('\n}());')) | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
.pipe(jshint.reporter('fail')); | ||
}; | ||
var config = { | ||
pkg: JSON.parse(fs.readFileSync('./package.json')), | ||
banner: | ||
'/*!\n' + | ||
' * <%= pkg.name %>\n' + | ||
' * <%= pkg.homepage %>\n' + | ||
' * Version: <%= pkg.version %> - <%= timestamp %>\n' + | ||
' * License: <%= pkg.license %>\n' + | ||
' */\n\n\n' | ||
}; | ||
return es.merge(buildLib()) | ||
.pipe(plumber({ | ||
errorHandler: handleError | ||
})) | ||
.pipe(concat('mask.js')) | ||
.pipe(header(config.banner, { | ||
timestamp: (new Date()).toISOString(), pkg: config.pkg | ||
})) | ||
.pipe(gulp.dest('dist')) | ||
.pipe(uglify({preserveComments: 'some'})) | ||
.pipe(rename({extname:'.min.js'})) | ||
.pipe(gulp.dest('dist')); | ||
return es.merge(buildLib()) | ||
.pipe(plumber({ | ||
errorHandler: handleError | ||
})) | ||
.pipe(concat('mask.js')) | ||
.pipe(header(config.banner, { | ||
timestamp: (new Date()).toISOString(), pkg: config.pkg | ||
})) | ||
.pipe(gulp.dest('dist')) | ||
.pipe(uglify({preserveComments: 'some'})) | ||
.pipe(rename({extname: '.min.js'})) | ||
.pipe(gulp.dest('dist')); | ||
@@ -69,14 +75,60 @@ }); | ||
gulp.task('karma', ['build'], function() { | ||
var server = new Server({configFile : __dirname +'/karma.conf.js', singleRun: true}); | ||
server.start(); | ||
var server = new Server({configFile: __dirname + '/karma.conf.js', singleRun: true}); | ||
server.start(); | ||
}); | ||
gulp.task('karma-watch', ['build'], function() { | ||
var server = new Server({configFile : __dirname +'/karma.conf.js', singleRun: false}); | ||
server.start(); | ||
var server = new Server({configFile: __dirname + '/karma.conf.js', singleRun: false}); | ||
server.start(); | ||
}); | ||
var handleError = function (err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}; | ||
gulp.task('karma-sauce', ['build'], function() { | ||
var customLaunchers = geSaLaKaCuLa({ | ||
// TODO: add windows testing in once | ||
// #5 is fixed https://github.com/angular-ui/ui-mask/issues/5 | ||
// 'Windows 7': { | ||
// 'internet explorer': '9..11', | ||
// }, | ||
'OS X 10.10': { | ||
'chrome': '43..44', | ||
'firefox': '39..40', | ||
'safari': '8' | ||
} | ||
}); | ||
reKaLa({ | ||
karma: Server, | ||
customLaunchers: customLaunchers | ||
}, process.exit); | ||
}); | ||
var handleError = function(err) { | ||
console.log(err.toString()); | ||
this.emit('end'); | ||
}; | ||
gulp.task('release:bump', function() { | ||
var type = process.argv[3] ? process.argv[3].substr(2) : 'patch'; | ||
return gulp.src(['./package.json']) | ||
.pipe(bump({type: type})) | ||
.pipe(gulp.dest('./')) | ||
.on('end', function() { | ||
versionAfterBump = require('./package.json').version; | ||
}); | ||
}); | ||
gulp.task('release:rebuild', function(cb) { | ||
runSequence('release:bump', 'build', cb); // bump will here be executed before build | ||
}); | ||
gulp.task('release:commit', ['release:rebuild'], function() { | ||
return gulp.src(['./package.json', 'dist/**/*']) | ||
.pipe(git.add()) | ||
.pipe(git.commit(versionAfterBump)); | ||
}); | ||
gulp.task('release:tag', ['release:commit'], function() { | ||
git.tag(versionAfterBump, versionAfterBump); | ||
}); | ||
gulp.task('release', ['release:tag']); |
@@ -67,2 +67,15 @@ // Karma configuration | ||
}); | ||
// Sauce Specific configuration for CI | ||
if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) { | ||
config.reporters.push('saucelabs'); | ||
config.set({ | ||
sauceLabs: { | ||
testName: 'UI Mask CI' | ||
}, | ||
captureTimeout: 120000, | ||
singleRun: true | ||
}); | ||
} | ||
}; |
{ | ||
"name": "angular-ui-mask", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"author": "https://github.com/angular-ui/ui-mask/graphs/contributors", | ||
@@ -11,6 +11,9 @@ "license": "MIT", | ||
"event-stream": "~3.3.1", | ||
"gesalakacula": "^1.4.0", | ||
"gulp": "~3.9.0", | ||
"gulp-bump": "^0.3.1", | ||
"gulp-concat": "~2.6.0", | ||
"gulp-footer": "~1.0.5", | ||
"gulp-git": "^1.4.0", | ||
"gulp-header": "~1.2.2", | ||
"gulp-footer": "~1.0.5", | ||
"gulp-jshint": "1.11.2", | ||
@@ -20,5 +23,7 @@ "gulp-plumber": "^1.0.1", | ||
"gulp-uglify": "~1.2.0", | ||
"jasmine-core": "^2.3.4", | ||
"jshint-stylish": "~2.0.1", | ||
"karma": "^0.13.9", | ||
"karma-chrome-launcher": "^0.2.0", | ||
"karma-coverage": "~0.5", | ||
"karma-firefox-launcher": "~0.1", | ||
@@ -28,5 +33,5 @@ "karma-jasmine": "~0.3", | ||
"karma-phantomjs-launcher": "~0.2.1", | ||
"karma-coverage": "~0.5", | ||
"jasmine-core": "^2.3.4", | ||
"phantomjs": "^1.9.18" | ||
"karma-sauce-launcher": "^0.2.14", | ||
"phantomjs": "^1.9.18", | ||
"run-sequence": "^1.1.2" | ||
}, | ||
@@ -33,0 +38,0 @@ "scripts": {}, |
@@ -44,7 +44,7 @@ # ui-mask [![Build Status](https://travis-ci.org/angular-ui/ui-mask.svg?branch=master)](https://travis-ci.org/angular-ui/ui-mask) [![npm version](https://badge.fury.io/js/angular-ui-mask.svg)](http://badge.fury.io/js/angular-ui-mask) [![Bower version](https://badge.fury.io/bo/angular-ui-mask.svg)](http://badge.fury.io/bo/angular-ui-mask) [![Join the chat at https://gitter.im/angular-ui/ui-mask](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/angular-ui/ui-mask?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
When customizing `eventsToHandle` or `clearOnBlur`, the value you supply will replace the default. To customize `eventsToHandle`, be sure to replace the entire array. | ||
When customizing `eventsToHandle` or `clearOnBlur`, the value you supply will replace the default. To customize `eventsToHandle`, be sure to replace the entire array. | ||
Whereas, `maskDefinitions` is an object, so any custom object you supply will be merged together with the defaults using `angular.extend()`. This allows you to override the defaults selectively, if you wish. | ||
Whereas, `maskDefinitions` is an object, so any custom object you supply will be merged together with the defaults using `angular.extend()`. This allows you to override the defaults selectively, if you wish. | ||
#### maskDefinitions | ||
#### maskDefinitions | ||
The keys in `maskDefinitions` represent the special tokens/characters used in your mask declaration to delimit acceptable ranges of inputs. For example, we use '9' here to accept any numeric values for a phone number: `ui-mask="(999) 999-9999"`. The values associated with each token are regexen. Each regex defines the ranges of values that will be acceptable as inputs in the position of that token. | ||
@@ -72,7 +72,6 @@ | ||
Use npm to update version and create a tag, then push to GitHub: | ||
Use gulp to bump version, build and create a tag. Then push to GitHub: | ||
````sh | ||
gulp && git commit . # if necessary, build everything and commit latest changes | ||
npm version [major | minor | patch] # let npm update package.json and create a tag | ||
gulp release [--patch|--minor|--major] | ||
git push --tags origin master # push everything to GitHub | ||
@@ -79,0 +78,0 @@ ```` |
@@ -415,3 +415,6 @@ /* | ||
iElement.val(valMasked); | ||
controller.$setViewValue(valUnmasked); | ||
scope.$apply(function() { | ||
controller.$setViewValue(valUnmasked); // $setViewValue should be run in angular context, otherwise the changes will be invisible to angular and user code. | ||
}); | ||
@@ -418,0 +421,0 @@ // Caret Repositioning |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
101786
1524
25
79