<NME> jquery.flexdatalist.min.js
<BEF> !function(e){e.fn.flexdatalist=function(t){var a=e(document);return a.data("flexdatalist")||e(document).mouseup(function(t){var a=e(".flexdatalist-results");a.is(t.target)||0!==a.has(t.target).length||a.remove()}).keydown(function(t){var a=e(".flexdatalist-results"),i=a.find("li"),n=i.filter(".active"),r=n.index(),s=i.length,l=t.keyCode||t.which;if(0!==s)if(13===l)n.click();else if(40===l||38===l){var o=0;40===l?s>r&&n.nextAll(".item").first().length>0&&(n=n.removeClass("active").nextAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,a.animate({scrollTop:o+a.scrollTop()},100)):38===l&&r>0&&n.prevAll(".item").first().length>0&&(n=n.removeClass("active").prevAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,a.animate({scrollTop:o+a.scrollTop()},100)),t.preventDefault()}}).data("flexdatalist",!0),this.each(function(){var a=e(this),i={},n=a.attr("name");a.hasClass("flexdatalist")||(t=e.extend({url:null,data:[],cache:!0,searchContain:!0,minLength:3,dataAsValue:!1,mergeRemoteData:!1,groupBy:!1,selectionRequired:!1,selectFirstResult:!0,visibleProperties:["thumb","text","category","description"],searchProperties:["text"]},t,a.data()),a.init=function(){a.on("keyup",function(e){var i=e.keyCode||e.which;if(13!==i&&38!==i&&40!==i){var n=a.keyword();n.length>=t.minLength?a.search():(a.removeResults(),t.selectionRequired&&a.clearInput())}}).attr("autocomplete","off").addClass("flexdatalist").trigger("init.flexdatalist",[t]),t.selectionRequired&&!a.selected()&&a.clearInput()},a.search=function(){a.data(function(i){var n=[],r=a.keyword();t.mergeRemoteData&&(i=e["extends"](t.data,i));for(var s=t.groupBy,l=0;l<i.length;l++){var o=a.match(i[l],r);if(o)if(s){if("undefined"!=typeof o[s]){var u=o[s];"undefined"==typeof n[u]&&(n[u]=[]),n[u].push(o)}}else n.push(o)}a.showResults(n)})},a.match=function(e,i){for(var n=!1,r=0;r<t.searchProperties.length;r++){var s=t.searchProperties[r];if("undefined"!=typeof e[s]){var l=e[s];a.find(l,i)&&(e[s+"_highlight"]=a.highlight(l,i),n=!0)}}return n?e:null},a.highlight=function(e,t){return e.replace(new RegExp(t,"ig"),'<span class="highlight">$&</span>')},a.find=function(e,i){return e=a.normalizeString(e),i=a.normalizeString(i),t.searchContain?e.indexOf(i)>=0:0===e.indexOf(i)},a.data=function(i){if(t.data.length>0)return void i(t.data);var n=a.attr("list");if(n)return e("#"+n).find("option").each(function(){t.data.push({text:e(this).text(),value:e(this).val()})}),void i(t.data);var r=a.keyword(),s=r.substring(0,t.minLength),l=a.cache(s);return l?void i(l):void(a.hasClass("flexdatalist-loading")||(a.addClass("flexdatalist-loading"),e.ajax({url:t.url,data:{keyword:r,contain:t.searchContain},type:"post",dataType:"json",success:function(e){a.removeClass("flexdatalist-loading");var t=e.results?e.results:e;"string"==typeof t&&0===t.indexOf("[{")&&(t=JSON.parse(t)),"object"==typeof t&&(i(t),a.cache(s,t))}})))},a.cache=function(e,n){if(t.cache){if(e=a.normalizeString(e),"undefined"==typeof n)return"undefined"!=typeof i[e]&&(n=i[e]),n;i[e]=n}return null},a.showResults=function(i){if(a.removeResults(),0!==i.length||0!==Object.keys(i).length){var n=a.getContainer();t.selectionRequired&&a.clearInput(),t.groupBy?Object.keys(i).forEach(function(t){var r=i[t];e("<li>").addClass("group").append(e("<span>").addClass("group-name").text(t)).append(e("<span>").addClass("group-item-count").text(" "+r.length)).appendTo(n);a.items(r,n)}):a.items(i,n);var r=n.find("li:not(.group)");r.on("click",function(){var t=e(this).data("item");a.setValue(t).trigger("select.flexdatalist",[e(this)]),a.removeResults()}).hover(function(){r.removeClass("active"),e(this).addClass("active")},function(){e(this).removeClass("active")}),t.selectFirstResult&&r.filter(":first").addClass("active"),a.position(n)}},a.getContainer=function(){var t=e("ul.flexdatalist-results");return 0===t.length&&(t=e("<ul>").addClass("flexdatalist-results").appendTo("body").css("border-color",a.css("border-left-color"))),t},a.removeResults=function(){return e("ul.flexdatalist-results").remove(),a},a.items=function(e,t){for(var i=0;i<e.length;i++)a.setItem(e[i]).appendTo(t)},a.setItem=function(a){for(var i=e("<li>").data("item",a).addClass("item"),n=0;n<t.visibleProperties.length;n++){var r=t.visibleProperties[n];if((!t.groupBy||t.groupBy!==r)&&"undefined"!=typeof a[r])if("thumb"===r)e("<img>").addClass("item-"+r).attr("src",a[r]).appendTo(i);else{var s=a[r];"undefined"!=typeof a[r+"_highlight"]&&(s=a[r+"_highlight"]),e("<span>").addClass("item-"+r).html(s+" ").appendTo(i)}}return i},a.position=function(e){e.css({width:a.outerWidth()+"px",top:a.offset().top+a.outerHeight()+"px",left:a.offset().left+"px"})},a.setValue=function(e){var i=e.value?e.value:e.text;return i=i.trim(),a.val(i),t.dataAsValue&&(delete e.highlight,i=JSON.stringify(e)),a.getInput().val(i)},a.getInput=function(){if(!t.selectionRequired&&!t.dataAsValue)return a;var i=e('input[type="hidden"][name="'+n+'"]');return i.length>0?i:(a.attr("name",null),e('<input type="hidden">').attr({name:n}).insertAfter(a))},a.clearInput=function(){a.getInput().val("")},a.normalizeString=function(e){return e.toUpperCase()},a.selected=function(){return a.getInput().val().trim().length>0},a.keyword=function(){return this.val().trim()},a.init())})}}(jQuery);
//# sourceMappingURL=jquery.flexdatalist.min.js.map
<MSG> Minor changes and bug fixes

<DFF> @@ -1,1 +1,1 @@
-!function(e){e.fn.flexdatalist=function(t){var a=e(document);return a.data("flexdatalist")||e(document).mouseup(function(t){var a=e(".flexdatalist-results");a.is(t.target)||0!==a.has(t.target).length||a.remove()}).keydown(function(t){var a=e(".flexdatalist-results"),i=a.find("li"),n=i.filter(".active"),r=n.index(),s=i.length,l=t.keyCode||t.which;if(0!==s)if(13===l)n.click();else if(40===l||38===l){var o=0;40===l?s>r&&n.nextAll(".item").first().length>0&&(n=n.removeClass("active").nextAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,a.animate({scrollTop:o+a.scrollTop()},100)):38===l&&r>0&&n.prevAll(".item").first().length>0&&(n=n.removeClass("active").prevAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,a.animate({scrollTop:o+a.scrollTop()},100)),t.preventDefault()}}).data("flexdatalist",!0),this.each(function(){var a=e(this),i={},n=a.attr("name");a.hasClass("flexdatalist")||(t=e.extend({url:null,data:[],cache:!0,searchContain:!0,minLength:3,dataAsValue:!1,mergeRemoteData:!1,groupBy:!1,selectionRequired:!1,selectFirstResult:!0,visibleProperties:["thumb","text","category","description"],searchProperties:["text"]},t,a.data()),a.init=function(){a.on("keyup",function(e){var i=e.keyCode||e.which;if(13!==i&&38!==i&&40!==i){var n=a.keyword();n.length>=t.minLength?a.search():(a.removeResults(),t.selectionRequired&&a.clearInput())}}).attr("autocomplete","off").addClass("flexdatalist").trigger("init.flexdatalist",[t]),t.selectionRequired&&!a.selected()&&a.clearInput()},a.search=function(){a.data(function(i){var n=[],r=a.keyword();t.mergeRemoteData&&(i=e["extends"](t.data,i));for(var s=t.groupBy,l=0;l<i.length;l++){var o=a.match(i[l],r);if(o)if(s){if("undefined"!=typeof o[s]){var u=o[s];"undefined"==typeof n[u]&&(n[u]=[]),n[u].push(o)}}else n.push(o)}a.showResults(n)})},a.match=function(e,i){for(var n=!1,r=0;r<t.searchProperties.length;r++){var s=t.searchProperties[r];if("undefined"!=typeof e[s]){var l=e[s];a.find(l,i)&&(e[s+"_highlight"]=a.highlight(l,i),n=!0)}}return n?e:null},a.highlight=function(e,t){return e.replace(new RegExp(t,"ig"),'<span class="highlight">$&</span>')},a.find=function(e,i){return e=a.normalizeString(e),i=a.normalizeString(i),t.searchContain?e.indexOf(i)>=0:0===e.indexOf(i)},a.data=function(i){if(t.data.length>0)return void i(t.data);var n=a.attr("list");if(n)return e("#"+n).find("option").each(function(){t.data.push({text:e(this).text(),value:e(this).val()})}),void i(t.data);var r=a.keyword(),s=r.substring(0,t.minLength),l=a.cache(s);return l?void i(l):void(a.hasClass("flexdatalist-loading")||(a.addClass("flexdatalist-loading"),e.ajax({url:t.url,data:{keyword:r,contain:t.searchContain},type:"post",dataType:"json",success:function(e){a.removeClass("flexdatalist-loading");var t=e.results?e.results:e;"string"==typeof t&&0===t.indexOf("[{")&&(t=JSON.parse(t)),"object"==typeof t&&(i(t),a.cache(s,t))}})))},a.cache=function(e,n){if(t.cache){if(e=a.normalizeString(e),"undefined"==typeof n)return"undefined"!=typeof i[e]&&(n=i[e]),n;i[e]=n}return null},a.showResults=function(i){if(a.removeResults(),0!==i.length||0!==Object.keys(i).length){var n=a.getContainer();t.selectionRequired&&a.clearInput(),t.groupBy?Object.keys(i).forEach(function(t){var r=i[t];e("<li>").addClass("group").append(e("<span>").addClass("group-name").text(t)).append(e("<span>").addClass("group-item-count").text(" "+r.length)).appendTo(n);a.items(r,n)}):a.items(i,n);var r=n.find("li:not(.group)");r.on("click",function(){var t=e(this).data("item");a.setValue(t).trigger("select.flexdatalist",[e(this)]),a.removeResults()}).hover(function(){r.removeClass("active"),e(this).addClass("active")},function(){e(this).removeClass("active")}),t.selectFirstResult&&r.filter(":first").addClass("active"),a.position(n)}},a.getContainer=function(){var t=e("ul.flexdatalist-results");return 0===t.length&&(t=e("<ul>").addClass("flexdatalist-results").appendTo("body").css("border-color",a.css("border-left-color"))),t},a.removeResults=function(){return e("ul.flexdatalist-results").remove(),a},a.items=function(e,t){for(var i=0;i<e.length;i++)a.setItem(e[i]).appendTo(t)},a.setItem=function(a){for(var i=e("<li>").data("item",a).addClass("item"),n=0;n<t.visibleProperties.length;n++){var r=t.visibleProperties[n];if((!t.groupBy||t.groupBy!==r)&&"undefined"!=typeof a[r])if("thumb"===r)e("<img>").addClass("item-"+r).attr("src",a[r]).appendTo(i);else{var s=a[r];"undefined"!=typeof a[r+"_highlight"]&&(s=a[r+"_highlight"]),e("<span>").addClass("item-"+r).html(s+" ").appendTo(i)}}return i},a.position=function(e){e.css({width:a.outerWidth()+"px",top:a.offset().top+a.outerHeight()+"px",left:a.offset().left+"px"})},a.setValue=function(e){var i=e.value?e.value:e.text;return i=i.trim(),a.val(i),t.dataAsValue&&(delete e.highlight,i=JSON.stringify(e)),a.getInput().val(i)},a.getInput=function(){if(!t.selectionRequired&&!t.dataAsValue)return a;var i=e('input[type="hidden"][name="'+n+'"]');return i.length>0?i:(a.attr("name",null),e('<input type="hidden">').attr({name:n}).insertAfter(a))},a.clearInput=function(){a.getInput().val("")},a.normalizeString=function(e){return e.toUpperCase()},a.selected=function(){return a.getInput().val().trim().length>0},a.keyword=function(){return this.val().trim()},a.init())})}}(jQuery);
\ No newline at end of file
+!function(e){e.fn.flexdatalist=function(t){if("value"===t){var i=e(this).next('input[type="hidden"]');return i.length>0?i.val():""}var a=e(document);return a.data("flexdatalist")||e(document).mouseup(function(t){var i=e(".flexdatalist-results");i.is(t.target)||0!==i.has(t.target).length||i.remove()}).keydown(function(t){var i=e(".flexdatalist-results"),a=i.find("li"),n=a.filter(".active"),r=n.index(),l=a.length,s=t.keyCode||t.which;if(0!==l)if(13===s)t.preventDefault(),n.click();else if(40===s||38===s){var o=0;40===s?l>r&&n.nextAll(".item").first().length>0&&(n=n.removeClass("active").nextAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,i.animate({scrollTop:o+i.scrollTop()},100)):38===s&&r>0&&n.prevAll(".item").first().length>0&&(n=n.removeClass("active").prevAll(".item").first().addClass("active"),o=(0===n.prev().length?n:n.prev()).position().top,i.animate({scrollTop:o+i.scrollTop()},100))}}).data("flexdatalist",!0),this.each(function(){var t=e(this),i={},a=t.attr("name");if(!t.hasClass("flexdatalist-set")){var n=e.extend({url:null,data:[],file:null,cache:!0,searchContain:!1,minLength:2,mergeRemoteData:!1,groupBy:!1,selectionRequired:!1,focusFirstResult:!0,valueProperty:"value",sendProperty:"value",visibleProperties:[],searchIn:["label"]},n,t.data());n.searchIn="string"==typeof n.searchIn?n.searchIn.split(","):n.searchIn,n.visibleProperties=0===n.visibleProperties.length?n.searchIn:n.visibleProperties,t.init=function(){t.on("input keyup",function(e){var i=e.keyCode||e.which;if(13!==i&&38!==i&&40!==i){var a=t.keyword();a.length>=n.minLength?t.search():t.removeResults(),n.selectionRequired||t.value(a)}}).blur(function(){n.selectionRequired&&!t.selected()&&t.val("").value("")}).attr("autocomplete","off").addClass("flexdatalist-set").trigger("init.flexdatalist",[n]),n.selectionRequired&&!t.selected()&&t.val("").value(""),window.onresize=function(){t.position()},t.datalist()},t.search=function(){t._data(function(i){var a=[],r=t.keyword();n.mergeRemoteData&&(i=e["extends"](n.data,i));for(var l=n.groupBy,s=0;s<i.length;s++){var o=t.match(i[s],r);if(o)if(l){if("undefined"!=typeof o[l]){var d=o[l];"undefined"==typeof a[d]&&(a[d]=[]),a[d].push(o)}}else a.push(o)}t.results(a)})},t.match=function(e,i){for(var a=!1,r=0;r<n.searchIn.length;r++){var l=n.searchIn[r];if("undefined"!=typeof e[l]){var s=e[l];t.find(s,i)&&(e[l+"_highlight"]=t.highlight(s,i),a=!0)}}return a?e:null},t.highlight=function(e,t){return e.replace(new RegExp(t,n.searchContain?"ig":"i"),'<span class="highlight">$&</span>')},t.find=function(e,i){return e=t.normalizeString(e),i=t.normalizeString(i),n.searchContain?e.indexOf(i)>=0:0===e.indexOf(i)},t._data=function(i){if(n.data.length>0)return void i(n.data);if(n.url||n.file){var a=t.keyword(),r=n.url?n.url:n.file,l=a.substring(0,n.minLength),s=t.cache(l);return s?void i(s):void(t.hasClass("flexdatalist-loading")||(t.addClass("flexdatalist-loading"),e.ajax({url:r,data:{keyword:l,contain:n.searchContain},type:"post",dataType:"json",success:function(e){t.removeClass("flexdatalist-loading");var a=e.results?e.results:e;"string"==typeof a&&0===a.indexOf("[{")&&(a=JSON.parse(a)),"object"==typeof a&&(i(a),n.url?t.cache(l,a):n.file&&(n.data=e))}})))}},t.datalist=function(){var i=t.attr("list");i&&(t.attr("list",null),e("#"+i).find("option").each(function(){var t=e(this).val();n.data.push({label:t,value:t})}))},t.cache=function(e,a){if(n.cache){if(e=t.normalizeString(e),"undefined"==typeof a)return"undefined"!=typeof i[e]&&(a=i[e]),a;i[e]=a}return null},t.results=function(i){if(t.removeResults(),0!==i.length||0!==Object.keys(i).length){var a=t.getContainer();t.selected()&&t.selected(!1).value(""),n.groupBy?Object.keys(i).forEach(function(r){var l=i[r],s=n.groupBy,o=t.getHighlight(l[0],s,r);e("<li>").addClass("group").append(e("<span>").addClass("group-name").html(o)).append(e("<span>").addClass("group-item-count").text(" "+l.length)).appendTo(a);t.items(l,a)}):t.items(i,a);var r=a.find("li:not(.group)");r.on("click",function(){var i=e(this).data("item");t.selected(!0).removeResults().value(i)}).hover(function(){r.removeClass("active"),e(this).addClass("active")},function(){e(this).removeClass("active")}),n.focusFirstResult&&r.filter(":first").addClass("active"),t.position()}},t.getContainer=function(){var i=e("ul.flexdatalist-results");return 0===i.length&&(i=e("<ul>").addClass("flexdatalist-results").appendTo("body").css({"border-color":t.css("border-left-color"),"border-width":t.css("border-left-width")})),i},t.removeResults=function(){return e("ul.flexdatalist-results").remove(),t},t.items=function(e,i){for(var a=0;a<e.length;a++)t.item(e[a]).appendTo(i)},t.item=function(i){for(var a=e("<li>").data("item",i).addClass("item"),r=0;r<n.visibleProperties.length;r++){var l=n.visibleProperties[r];if(!(n.groupBy&&n.groupBy===l||"undefined"==typeof i[l])){var s={};if("thumb"===l)s=e("<img>").addClass("item-"+l).attr("src",i[l]);else{var o=t.getHighlight(i,l);s=e("<span>").addClass("item-"+l).html(o+" ")}s.appendTo(a)}}return a},t.hiddenInput=function(){var i=e('input[type="hidden"][name="'+a+'"]');return i.length>0?i:(t.attr("name",null),e('<input type="hidden">').attr({name:a}).insertAfter(t))},t.value=function(e){var i="",a=e;return"object"==typeof e&&(i=e[n.searchIn[0]],"undefined"!=typeof e[n.valueProperty]&&(i=e[n.valueProperty]),n.sendProperty?n.sendProperty===n.valueProperty?a=i:"undefined"!=typeof e[n.sendProperty]&&(a=e[n.sendProperty]):a=JSON.stringify(e),t.trigger("select.flexdatalist",[a,i]).val(i)),i=i.trim(),t.data("value",a).hiddenInput().val(a),t},t.normalizeString=function(e){return e.toUpperCase()},t.selected=function(e){var i="flexdatalist-selected";return"undefined"==typeof e?t.hasClass(i):(e?t.addClass(i):t.removeClass(i),t)},t.keyword=function(){return this.val().replace(/^\s+/,"")},t.getHighlight=function(e,t,i){return"undefined"!=typeof e[t+"_highlight"]?e[t+"_highlight"]:"undefined"!==e[t]?e[t]:i},t.position=function(){e("ul.flexdatalist-results").css({width:t.outerWidth()+"px",top:t.offset().top+t.outerHeight()+"px",left:t.offset().left+"px","z-index":t.css("z-index")+1})},t.init()}})},e(".flexdatalist").flexdatalist()}(jQuery);
\ No newline at end of file

Minor changes and bug fixes