diff --git a/Gruntfile.js b/Gruntfile.js index f877572..e642dff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -37,7 +37,7 @@ module.exports = function(grunt) { vendor: [ "bower_components/jquery/dist/jquery.min.js", "bower_components/jqueryui/ui/jquery-ui.js", - "bower_components/knockout.js/knockout.js" + "bower_components/knockout/dist/knockout.js" ], template : require("grunt-template-jasmine-istanbul"), templateOptions: { diff --git a/bower.json b/bower.json index 3d838c9..1e20d19 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,5 @@ { "name": "knockout-jqAutocomplete", - "version": "0.4.3", "main": "build/knockout-jqAutocomplete.min.js", "ignore": [ "examples", @@ -13,7 +12,7 @@ ".gitignore" ], "devDependencies": { - "knockout.js": "~3.0.0", + "knockout": "~3.4.0", "jqueryui": "~1.10.3" } } diff --git a/build/knockout-jqAutocomplete.js b/build/knockout-jqAutocomplete.js index 176561f..3d21838 100644 --- a/build/knockout-jqAutocomplete.js +++ b/build/knockout-jqAutocomplete.js @@ -1,4 +1,4 @@ -// knockout-jqAutocomplete 0.4.3 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-jqautocomplete 0.4.4 | (c) 2016 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license ;(function(factory) { if (typeof define === "function" && define.amd) { // AMD anonymous module diff --git a/build/knockout-jqAutocomplete.min.js b/build/knockout-jqAutocomplete.min.js index f70388f..5e4fd7e 100644 --- a/build/knockout-jqAutocomplete.min.js +++ b/build/knockout-jqAutocomplete.min.js @@ -1,2 +1,2 @@ -// knockout-jqAutocomplete 0.4.3 | (c) 2015 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license +// knockout-jqautocomplete 0.4.4 | (c) 2016 Ryan Niemeyer | http://www.opensource.org/licenses/mit-license !function(a){"function"==typeof define&&define.amd?define(["knockout","jquery","jquery-ui/autocomplete"],a):a(window.ko,jQuery)}(function(a,b){var c=function(){var c=this,d=a.utils.unwrapObservable;this.init=function(e,f,g,h,i){var j,k,l=d(f()),m={},n="function"==typeof l.filter?l.filter:c.defaultFilter;a.utils.extend(m,c.options),a.utils.extend(m,l.options),m.source="function"!=typeof l.source||a.isObservable(l.source)?c.processOptions.bind(c,f,n,l.source):function(a,b){var d=function(d){c.processOptions(f,null,d,a,b)};l.source.call(i.$data,a.term,d)},j="function"==typeof m.select&&m.select,k="function"==typeof m.change&&m.change,m.select=function(b,c){c.item&&c.item.actual&&(l.value(c.item.actual),a.isWriteableObservable(l.dataValue)&&l.dataValue(c.item.data)),j&&j.apply(this,arguments)},m.change=function(b,c){c.item&&c.item.actual||(l.value(b.target&&b.target.value),a.isWriteableObservable(l.dataValue)&&l.dataValue(null)),k&&k.apply(this,arguments)};var o=b(e).autocomplete(m).data("ui-autocomplete");l.template&&(o._renderItem=c.renderItem.bind(c,l.template,i)),a.utils.domNodeDisposal.addDisposeCallback(e,function(){o&&"function"==typeof o.destroy&&(o.destroy(),o=null)})},this.update=function(e,f){var g,h,i=d(f()),j=d(i&&i.value);j||0===j||(j=""),h=d(i.source),g=c.getPropertyNames(f),b.isArray(h)&&g.value&&(j=a.utils.arrayFirst(h,function(a){return a[g.value]==j})||j),e.value=g.input&&j&&"object"==typeof j?j[g.input]:j},this.defaultFilter=function(b,c){return c=c&&c.toLowerCase(),(b||0===b)&&a.toJSON(b).toLowerCase().indexOf(c)>-1},this.processOptions=function(a,b,c,e,f){var g,h,i,j=d(c)||[],k=[],l=this.getPropertyNames(a);for(h=0,i=j.length;i>h;h++)g=j[h],(!b||b(g,e.term))&&k.push({label:l.label?g[l.label]:g.toString(),value:l.input?g[l.input]:g.toString(),actual:l.value?g[l.value]:g,data:g});f(k)},this.renderItem=function(c,d,e,f){var g=b("
  • ").appendTo(e),h=d.createChildContext(f.data);return a.applyBindingsToNode(g[0],{template:c},h),g.one("remove",a.cleanNode.bind(a,g[0])),g},this.getPropertyNames=function(b){var c=a.toJS(b());return{label:c.labelProp||c.valueProp,input:c.inputProp||c.labelProp||c.valueProp,value:c.valueProp}},this.options={autoFocus:!0,delay:50}};a.bindingHandlers.jqAuto=new c}); \ No newline at end of file diff --git a/example/test.html b/example/test.html index e3a93b5..e2c2d60 100644 --- a/example/test.html +++ b/example/test.html @@ -20,7 +20,7 @@ - + - +