diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..dacf83a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.code-workspace
+prepros.config
diff --git a/README.md b/README.md
index c44d4e1..2700445 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,9 @@ Check out the [examples and documentation](http://projects.sergiodinislopes.pt/f
## Roadmap
+- Improve accessibility
- Allow the search to be disabled on flexdatalist and just use the given list (from server-side)
+- Use CSS grid to list multiple selected values
- Regex in JS has bad support for special and accented characters, I'll try to make some improvements __(it works since v2.3.0, but it won't highlight the word, though)__
- Make it jQuery independent (this will take a while to make it to a release)
diff --git a/bower.json b/bower.json
index 4005c29..69ff491 100644
--- a/bower.json
+++ b/bower.json
@@ -1,6 +1,6 @@
{
"name": "jquery-flexdatalist",
- "version": "2.2.4",
+ "version": "2.3.0",
"main": ["jquery.flexdatalist.js"],
"dependencies": {
"jquery": ">=1.8"
diff --git a/jquery.flexdatalist.css b/jquery.flexdatalist.css
index e506042..03e1b9c 100644
--- a/jquery.flexdatalist.css
+++ b/jquery.flexdatalist.css
@@ -107,6 +107,7 @@
border-radius: 3px;
color: #444;
line-height: 20px;
+ float: left;
}
.flexdatalist-multiple li.toggle {
cursor: pointer;
diff --git a/jquery.flexdatalist.js b/jquery.flexdatalist.js
index 647204a..6fef98b 100644
--- a/jquery.flexdatalist.js
+++ b/jquery.flexdatalist.js
@@ -124,6 +124,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
redoSearchOnFocus: true,
requestType: 'get',
requestContentType: 'x-www-form-urlencoded',
+ requestHeaders: null,
resultsProperty: 'results',
keywordParamName: 'keyword',
searchContainParamName: 'contain',
@@ -163,11 +164,11 @@ jQuery.fn.flexdatalist = function (_option, _value) {
_this.results.remove();
}
_this.action.keypressValue(event, 188);
- _this.action.keypressValue(event, 13);
_this.action.backSpaceKeyRemove(event);
})
// Keyup
.on('input keyup', function (event) {
+ _this.action.keypressValue(event, 13);
_this.action.keypressSearch(event);
_this.action.copyValue(event);
_this.action.backSpaceKeyRemove(event);
@@ -219,6 +220,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
&& options.multiple) {
var val = $alias[0].value;
event.preventDefault();
+ event.stopPropagation();
_this.fvalue.extract(val);
_this.results.remove();
}
@@ -369,9 +371,12 @@ jQuery.fn.flexdatalist = function (_option, _value) {
} else {
$alias.insertAfter($this);
}
+
+ this.accessibility($alias);
+
// Respect autofocus attribute
if ($this.attr('autofocus')) {
- $alias.focus();
+ $alias.trigger('focus');
}
$this.data('aliascontainer', ($multiple ? $multiple : $alias)).addClass('flexdatalist flexdatalist-set').css({
@@ -417,8 +422,8 @@ jQuery.fn.flexdatalist = function (_option, _value) {
'border-radius': $this.css('border-top-left-radius'),
'background-color': $this.css('background-color')
})
- .insertAfter($this).click(function () {
- $(this).find('input').focus();
+ .insertAfter($this).on('click', function () {
+ $(this).find('input').trigger('focus');
});
$('
')
@@ -450,6 +455,19 @@ jQuery.fn.flexdatalist = function (_option, _value) {
});
toggle(true);
}
+ },
+ /**
+ * Accessibility.
+ */
+ accessibility: function ($input) {
+ var aliasid = ($this.attr('id') ? $this.attr('id') + '-flexdatalist' : fid);
+ var scrReaderAttr = {
+ 'aria-autocomplete': 'list',
+ 'aria-expanded': 'false',
+ 'aria-owns': aliasid + '-results',
+ };
+
+ $input.attr(scrReaderAttr);
}
}
@@ -507,7 +525,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
val = this.toObj(val);
$this.trigger('before:flexdatalist.remove', [val]);
var result = [];
- if ($.isArray(val)) {
+ if (_this.isArray(val)) {
$.each(val, function (i, value) {
var removed = _this.fvalue.multiple.remove(value);
if (removed) {
@@ -551,7 +569,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
_this.data.load(function (data) {
if (!_this.isObject(values)) {
values = values.split(',');
- } else if (!$.isArray(values)) {
+ } else if (!_this.isArray(values)) {
values = [values];
}
var found = [];
@@ -589,7 +607,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
$this.trigger('before:flexdatalist.value', [values, options]);
}
- if ($.isArray(values)) {
+ if (_this.isArray(values)) {
$.each(values, function (i, value) {
result.push(_this.fvalue._extract(value));
});
@@ -649,28 +667,29 @@ jQuery.fn.flexdatalist = function (_option, _value) {
$li = this.li(val, txt);
// Toggle
- $li.click(function () {
+ $li.on('click', function () {
_multiple.toggle($(this));
// Remove
- }).find('.fdl-remove').click(function () {
+ }).find('.fdl-remove').on('click', function () {
_this.fvalue.remove($(this).parent());
});
this.push(val);
$alias[0].value = '';
- this.checkLimit();
+ this.handleLimit();
},
/**
* Push value to input.
*/
push: function (val, index) {
var current = _this.fvalue.get();
- if (!current.includes(val)) {
- val = _this.fvalue.toObj(val);
- current.push(val);
- val = _this.fvalue.toStr(current);
- _this.value = val;
+ if (current.includes(val)) {
+ return;
}
+ val = _this.fvalue.toObj(val);
+ current.push(val);
+ val = _this.fvalue.toStr(current);
+ _this.value = val;
},
/**
* Toggle value.
@@ -680,34 +699,36 @@ jQuery.fn.flexdatalist = function (_option, _value) {
if (!options.toggleSelected) {
return;
}
+
var $li = this.findLi(val);
- if ($li) {
+ if (!$li) {
return;
}
- var index = $li.index(),
- data = $li.data(),
+ var data = $li.data(),
action = $li.hasClass('disabled') ? 'enable' : 'disable',
- current = _this.fvalue.get(),
- args = [{value: data.value, text: data.text, action: action}, options];
+ eventArgs = [{value: data.value, text: data.text, action: action}, options];
- $this.trigger('before:flexdatalist.toggle', args);
+ $this.trigger('before:flexdatalist.toggle', eventArgs);
if (action === 'enable') {
- var value = $li.data('value');
- current.splice(index, 0, value);
$li.removeClass('disabled');
} else {
- current.splice(index, 1);
$li.addClass('disabled');
}
+ var current = [];
+ $multiple.find('li.toggle:not(.disabled)').each(function () {
+ var $item = $(this);
+ current.push($item.data('value'));
+ });
+
current = _this.fvalue.toStr(current);
_this.value = current;
$this
- .trigger('after:flexdatalist.toggle', args)
- .trigger('change:flexdatalist', args)
+ .trigger('after:flexdatalist.toggle', eventArgs)
+ .trigger('change:flexdatalist', eventArgs)
.trigger('change');
},
@@ -729,10 +750,13 @@ jQuery.fn.flexdatalist = function (_option, _value) {
values = _this.fvalue.toStr(values);
_this.value = values;
$li.remove();
- _this.fvalue.multiple.checkLimit();
+ _this.fvalue.multiple.handleLimit();
// For allowDuplicateValues
_values.splice(index, 1);
+
+ this.handleLimit();
+
return arg;
},
/**
@@ -749,33 +773,47 @@ jQuery.fn.flexdatalist = function (_option, _value) {
_this.value = '';
_values = [];
+ this.handleLimit();
+
$this.trigger('after:flexdatalist.remove.all', [values, options]);
},
/**
* Create new item and return it.
*/
li: function (val, txt) {
- var $inputContainer = $multiple.find('li.input-container')
+ var $inputContainer = $multiple.find('li.input-container');
+ var options = _this.options.get();
return $('')
- .addClass('value' + (_this.options.get('toggleSelected') ? ' toggle' : ''))
+ .addClass('value' + (options.toggleSelected ? ' toggle' : ''))
.append('' + txt + '')
.append('×')
.data({
'text': txt,
- 'value': _this.fvalue.toObj(val)
+ 'value': _this.fvalue.toStr(val)
})
.insertBefore($inputContainer);
},
/**
- * Create new item and return it.
+ * Handle the limit.
+ *
+ * @return void
*/
- checkLimit: function () {
+ handleLimit: function () {
+ var isAtLimit = this.isAtLimit();
+ var $input = $multiple.find('li.input-container');
+ isAtLimit ? $input.hide() : $input.show();
+ },
+ /**
+ * Check the limit of items.
+ *
+ * @return bool True if reached the limit, false otherwise
+ */
+ isAtLimit: function () {
var limit = _this.options.get('limitOfValues');
- if (limit > 0) {
- var $input = $multiple.find('li.input-container'),
- count = _values.length;
- (limit == count ? $input.hide() : $input.show());
+ if (!(limit > 0)) {
+ return false;
}
+ return limit == _values.length;
},
/**
* Get li item from value.
@@ -814,7 +852,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
if (_this.isObject(item)) {
if (this.isJSON() || this.isMixed()) {
delete item.name_highlight;
- if ($.isArray(valueProperty)) {
+ if (_this.isArray(valueProperty)) {
var _value = {};
for (var i = 0; i < valueProperty.length; i++) {
var propValue = _this.getPropertyValue(item, valueProperty[i]);
@@ -857,7 +895,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
return text;
},
/**
- * Text placeholders processing.
+ * Process text placeholders.
*/
placeholders: {
replace: function (item, pattern, fallback) {
@@ -896,6 +934,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
if (options.multiple) {
this.multiple.removeAll();
}
+
_this.value = '';
if (alias) {
$alias[0].value = '';
@@ -919,8 +958,8 @@ jQuery.fn.flexdatalist = function (_option, _value) {
val = options.multiple ? [] : (this.isJSON() ? {} : '');
} else if (this.isCSV()) {
val = val.toString().split(options.valuesSeparator);
- val = $.map(val, function (v) {
- return $.trim(v);
+ val = val.map(function (v) {
+ return v.trim();
});
} else if ((this.isMixed() || this.isJSON()) && this.isJSON(val)) {
val = JSON.parse(val);
@@ -958,7 +997,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
} else if (typeof str !== 'string') {
return false;
}
- return (str.indexOf('{') === 0 || str.indexOf('[') === 0 || str.indexOf('[{') === 0);
+ return (str.indexOf('{') === 0 || str.indexOf('[{') === 0);
}
var options = _this.options.get(),
prop = options.valueProperty;
@@ -1131,18 +1170,22 @@ jQuery.fn.flexdatalist = function (_option, _value) {
remote: function (settings) {
var __this = this,
options = _this.options.get();
- // Prevent get data when pressing backspace button
+
+ // Prevent get data when pressing backspace button
if ($this.hasClass('flexdatalist-loading')) {
return;
}
$this.addClass('flexdatalist-loading');
+
if (options.requestContentType === 'json') {
settings.data = JSON.stringify(settings.data);
}
+
$.ajax($.extend(
{
type: options.requestType,
dataType: 'json',
+ headers: options.requestHeaders,
contentType: 'application/' + options.requestContentType + '; charset=UTF-8',
complete: function () {
$this.removeClass('flexdatalist-loading');
@@ -1204,7 +1247,8 @@ jQuery.fn.flexdatalist = function (_option, _value) {
*/
get: function (keywords, data, callback) {
var __this = this,
- options = _this.options.get();
+ options = _this.options.get(),
+ matches = data;
if (!options.searchDisabled) {
var matches = _this.cache.read(keywords);
@@ -1227,8 +1271,6 @@ jQuery.fn.flexdatalist = function (_option, _value) {
_this.cache.write(keywords, matches, 2);
$this.trigger('after:flexdatalist.search', [keywords, data, matches]);
}
- } else {
- matches = data;
}
callback(matches);
@@ -1399,7 +1441,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
__this.remove();
$this.trigger('select:flexdatalist', [item, options]);
}
- }).hover(function () {
+ }).on('hover', function () {
$li.removeClass('active');
$(this).addClass('active').trigger('active:flexdatalist.results', [$(this).data('item')]);
}, function () {
@@ -1440,7 +1482,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
if (max > 0 && max === index) {
break;
}
- this.item(items[index]).appendTo($resultsContainer);
+ this.item(items[index], index, items.length).appendTo($resultsContainer);
}
$this.trigger('shown:flexdatalist.results', [items]);
@@ -1448,8 +1490,16 @@ jQuery.fn.flexdatalist = function (_option, _value) {
/**
* Result item creation.
*/
- item: function (item) {
- var $li = $('').data('item', item).addClass('item'),
+ item: function (item, index, total) {
+ var $li = $('')
+ .attr({
+ 'role': 'option',
+ 'tabindex': '-1',
+ 'aria-posinset': index + 1,
+ 'aria-setsize': total
+ })
+ .data('item', item)
+ .addClass('item'),
options = _this.options.get(),
visibleProperties = options.visibleProperties;
@@ -1504,7 +1554,10 @@ jQuery.fn.flexdatalist = function (_option, _value) {
$container = $('')
.addClass('flexdatalist-results ')
.appendTo('body')
- .attr('id', $alias.attr('id') + '-results')
+ .attr({
+ 'id': $alias.attr('id') + '-results',
+ 'role': 'listbox'
+ })
.css({
'border-color': $target.css("border-left-color"),
'border-width': '1px',
@@ -1549,6 +1602,12 @@ jQuery.fn.flexdatalist = function (_option, _value) {
}
return (_this.isDefined(item, property) ? item[property] : fallback);
},
+ /**
+ * Set given item as active
+ */
+ active: function ($item) {
+
+ },
/**
* Remove results
*/
@@ -1851,6 +1910,13 @@ jQuery.fn.flexdatalist = function (_option, _value) {
return _variable;
}
+ /**
+ * Check if variable is an array.
+ */
+ this.isArray = function (variable) {
+ return Object.prototype.toString.call(variable) === '[object Array]';
+ }
+
/**
* Get unixtime stamp.
*
@@ -1891,7 +1957,7 @@ jQuery.fn.flexdatalist = function (_option, _value) {
*/
this.getPropertyValue = function (obj, path) {
if (!obj || typeof path !== 'string') {
- return obj;
+ return undefined;
}
var parts = path.split('.');
@@ -1943,14 +2009,14 @@ jQuery(function ($) {
// Handle results selection list keyboard shortcuts and events.
if (!$document.data('flexdatalist')) {
// Remove results on outside click
- $(document).mouseup(function (event) {
+ $(document).on('mouseup', function (event) {
var $container = $('.flexdatalist-results'),
$target = $container.data('target');
if ((!$target || !$target.is(':focus')) && !$container.is(event.target) && $container.has(event.target).length === 0) {
$container.remove();
}
// Keyboard navigation
- }).keydown(function (event) {
+ }).on('keydown', function (event) {
var $ul = $('.flexdatalist-results'),
$li = $ul.find('li'),
$active = $li.filter('.active'),
@@ -1971,7 +2037,7 @@ jQuery(function ($) {
// Enter/tab key
if (keynum === 13) {
event.preventDefault();
- $active.click();
+ $active.trigger('click');
// Up/Down key
} else if (keynum === 40 || keynum === 38) {
event.preventDefault();
diff --git a/jquery.flexdatalist.min.css b/jquery.flexdatalist.min.css
index 45baee0..e5729e5 100644
--- a/jquery.flexdatalist.min.css
+++ b/jquery.flexdatalist.min.css
@@ -1 +1 @@
-.flexdatalist-results{position:absolute;top:0;left:0;border:1px solid #444;border-top:none;background:#fff;z-index:100000;max-height:300px;overflow-y:auto;-webkit-box-shadow:0 4px 5px rgba(0,0,0,0.15);box-shadow:0 4px 5px rgba(0,0,0,0.15);color:#333;list-style:none;margin:0;padding:0}.flexdatalist-results li{border-bottom:1px solid #ccc;padding:8px 15px;font-size:14px;line-height:20px}.flexdatalist-results li span.highlight{font-weight:700;text-decoration:underline}.flexdatalist-results li.active{background:#2B82C9;color:#fff;cursor:pointer}.flexdatalist-results li.no-results{font-style:italic;color:#888}.flexdatalist-results li.group{background:#F3F3F4;color:#666;padding:8px 8px}.flexdatalist-results li .group-name{font-weight:700}.flexdatalist-results li .group-item-count{font-size:85%;color:#777;display:inline-block;padding-left:10px}.flexdatalist-multiple:before{content:'';display:block;clear:both}.flexdatalist-multiple{width:100%;margin:0;padding:0;list-style:none;text-align:left;cursor:text}.flexdatalist-multiple.disabled{background-color:#eee;cursor:default}.flexdatalist-multiple:after{content:'';display:block;clear:both}.flexdatalist-multiple li{display:inline-block;position:relative;margin:5px}.flexdatalist-multiple li.input-container,.flexdatalist-multiple li.input-container input{border:none;height:auto;padding:0 0 0 4px;line-height:24px}.flexdatalist-multiple li.value{display:inline-block;padding:2px 25px 2px 7px;background:#efefef;border-radius:3px;color:#444;line-height:20px}.flexdatalist-multiple li.toggle{cursor:pointer;-webkit-transition:opacity ease-in-out 300ms;-o-transition:opacity ease-in-out 300ms;transition:opacity ease-in-out 300ms}.flexdatalist-multiple li.toggle.disabled{text-decoration:line-through;opacity:0.80}.flexdatalist-multiple li.value span.fdl-remove{font-weight:700;padding:2px 5px;font-size:20px;line-height:20px;cursor:pointer;position:absolute;top:0;right:0;opacity:0.70}.flexdatalist-multiple li.value span.fdl-remove:hover{opacity:1}
\ No newline at end of file
+.flexdatalist-results{position:absolute;top:0;left:0;border:1px solid #444;border-top:none;background:#fff;z-index:100000;max-height:300px;overflow-y:auto;box-shadow:0 4px 5px rgba(0,0,0,0.15);color:#333;list-style:none;margin:0;padding:0}.flexdatalist-results li{border-bottom:1px solid #ccc;padding:8px 15px;font-size:14px;line-height:20px}.flexdatalist-results li span.highlight{font-weight:700;text-decoration:underline}.flexdatalist-results li.active{background:#2B82C9;color:#fff;cursor:pointer}.flexdatalist-results li.no-results{font-style:italic;color:#888}.flexdatalist-results li.group{background:#F3F3F4;color:#666;padding:8px 8px}.flexdatalist-results li .group-name{font-weight:700}.flexdatalist-results li .group-item-count{font-size:85%;color:#777;display:inline-block;padding-left:10px}.flexdatalist-multiple:before{content:'';display:block;clear:both}.flexdatalist-multiple{width:100%;margin:0;padding:0;list-style:none;text-align:left;cursor:text}.flexdatalist-multiple.disabled{background-color:#eee;cursor:default}.flexdatalist-multiple:after{content:'';display:block;clear:both}.flexdatalist-multiple li{display:inline-block;position:relative;margin:5px}.flexdatalist-multiple li.input-container,.flexdatalist-multiple li.input-container input{border:none;height:auto;padding:0 0 0 4px;line-height:24px}.flexdatalist-multiple li.value{display:inline-block;padding:2px 25px 2px 7px;background:#efefef;border-radius:3px;color:#444;line-height:20px;float:left}.flexdatalist-multiple li.toggle{cursor:pointer;transition:opacity ease-in-out 300ms}.flexdatalist-multiple li.toggle.disabled{text-decoration:line-through;opacity:0.80}.flexdatalist-multiple li.value span.fdl-remove{font-weight:700;padding:2px 5px;font-size:20px;line-height:20px;cursor:pointer;position:absolute;top:0;right:0;opacity:0.70}.flexdatalist-multiple li.value span.fdl-remove:hover{opacity:1}
\ No newline at end of file
diff --git a/jquery.flexdatalist.min.js b/jquery.flexdatalist.min.js
index e46eb37..ba0493a 100644
--- a/jquery.flexdatalist.min.js
+++ b/jquery.flexdatalist.min.js
@@ -1 +1,2 @@
-jQuery.fn.flexdatalist=function(e,t){"use strict";var i=function(e,t){e.each((function(){var e=$(this),i=e.data(),a=i.flexdatalist,r=i.aliascontainer;r&&(e.removeClass("flexdatalist-set").attr({style:null,tabindex:null}).val(a&&a.originalValue&&!t?a.originalValue:"").removeData("flexdatalist").removeData("aliascontainer").off(),r.remove())}))};if("string"==typeof e&&"reset"!==e){if("object"==typeof this[0]&&void 0!==this[0].fvalue){var a=this[0];if("destroy"===e)i(this,t);else if("value"===e){if(void 0===t)return a.fvalue.get();a.fvalue.set(t)}else if("add"===e){if(void 0===t)return a.debug("Missing value to add!");a.fvalue.add(t)}else if("toggle"===e){if(void 0===t)return a.debug("Missing value to toggle!");a.fvalue.toggle(t)}else if("remove"===e){if(void 0===t)return a.debug("Missing value to remove!");a.fvalue.remove(t)}else if("disabled"===e){if(void 0===t)return a.fdisabled();a.fdisabled(t)}else if("string"==typeof e){if(void 0===t)return a.options.get(e);a.options.set(e,t)}return this}e={_option:t}}this.length>0&&void 0!==this[0].fvalue&&i(this);var r=$.extend({url:null,data:[],params:{},relatives:null,chainedRelatives:!1,cache:!0,cacheLifetime:60,minLength:3,groupBy:!1,selectionRequired:!1,focusFirstResult:!1,textProperty:null,valueProperty:null,visibleProperties:[],iconProperty:"thumb",searchIn:["label"],searchContain:!1,searchEqual:!1,searchByWord:!1,searchDisabled:!1,searchDelay:400,normalizeString:null,multiple:null,disabled:null,maxShownResults:100,removeOnBackspace:!0,noResultsText:'No results found for "{keyword}"',toggleSelected:!1,allowDuplicateValues:!1,redoSearchOnFocus:!0,requestType:"get",requestContentType:"x-www-form-urlencoded",resultsProperty:"results",keywordParamName:"keyword",searchContainParamName:"contain",limitOfValues:0,valuesSeparator:",",debug:!0},e);return this.each((function(e){var t=$(this),i=this,a=null,s=[],l="flex"+e,n=null,o=null;this.init=function(){var e=this.options.init();this.set.up(),n.on("focusin",(function(e){i.action.redoSearchFocus(e),i.action.showAllResults(e),o&&o.addClass("focus")})).on("input keydown",(function(e){9===i.keyNum(e)&&i.results.remove(),i.action.keypressValue(e,188),i.action.backSpaceKeyRemove(e)})).on("input keyup",(function(e){i.action.keypressValue(e,13),i.action.keypressSearch(e),i.action.copyValue(e),i.action.backSpaceKeyRemove(e),i.action.showAllResults(e),i.action.clearValue(e),i.action.removeResults(e),i.action.inputWidth(e)})).on("focusout",(function(e){o&&o.removeClass("focus"),i.action.clearText(e),i.action.clearValue(e)})),window.onresize=function(e){i.position()},this.cache.gc(),e.selectionRequired&&i.fvalue.clear(!0,!0),this.fvalue._load(e.originalValue,(function(a,r){i.fdisabled(e.disabled),t.trigger("init:flexdatalist",[e])}),!0)},this.action={keypressValue:function(e,t){var a=i.keyNum(e),r=n[0].value,s=i.options.get();if(r.length>0&&a===t&&!s.selectionRequired&&s.multiple){r=n[0].value;e.preventDefault(),i.fvalue.extract(r),i.results.remove()}},keypressSearch:function(e){var t=i.keyNum(e),r=n.val(),s=r.length,l=i.options.get();clearTimeout(a),(!t||13!==t&&(t<37||t>40))&&(a=setTimeout((function(){(0===l.minLength&&s>0||l.minLength>0&&s>=l.minLength)&&i.data.load((function(e){i.search.get(r,e,(function(e){i.results.show(e)}))}))}),l.searchDelay))},redoSearchFocus:function(e){var t=i.fvalue.get(),a=i.options.get(),r=n.val();a.redoSearchOnFocus&&(r.length>0&&a.multiple||r.length>0&&0===t.length)&&this.keypressSearch(e)},copyValue:function(e){if(13!==i.keyNum(e)){var t=n.val(),a=i.fvalue.get(!0),r=i.options.get();r.multiple||r.selectionRequired||t.length===a.length||i.fvalue.extract(t)}},backSpaceKeyRemove:function(e){var t=i.options.get();if(t.removeOnBackspace&&t.multiple){var a=n.val(),r=n.data("_remove");8===i.keyNum(e)&&(0===a.length?r?(i.fvalue.remove(r),n.data("_remove",null)):n.data("_remove",n.parents("li:eq(0)").prev()):n.data("_remove",null))}},showAllResults:function(e){var t=n.val();""===(t=$.trim(t))&&0===i.options.get("minLength")&&i.data.load((function(e){i.results.show(e)}))},inputWidth:function(e){if(i.options.get().multiple){var a=n.val(),r=parseInt(n.css("fontSize").replace("px","")),s=t.innerWidth(),l=(a.length+1)*r;l>=40&&l<=s&&(n[0].style.width=l+"px")}},clearText:function(e){var t=i.fvalue.get(),a=i.options.get();!a.multiple&&a.selectionRequired&&0===t.length&&(n[0].value="")},clearValue:function(e){i.fvalue.get();var t=n.val(),a=i.options.get();!a.multiple&&a.selectionRequired&&t.length<=a.minLength&&i.fvalue.clear()},removeResults:function(e){var t=n.val(),a=i.options.get();a.minLength>0&&t.length').attr({class:t.attr("class"),name:t.attr("name")?"flexdatalist-"+t.attr("name"):null,id:e,placeholder:t.attr("placeholder")}).addClass("flexdatalist-alias "+e).removeClass("flexdatalist").attr("autocomplete","off")},multipleInput:function(e){return o=$('').addClass("flexdatalist-multiple "+l).css({"border-color":t.css("border-left-color"),"border-width":t.css("border-left-width"),"border-style":t.css("border-left-style"),"border-radius":t.css("border-top-left-radius"),"background-color":t.css("background-color")}).insertAfter(t).click((function(){$(this).find("input").focus()})),$('- ').addClass("flexdatalist-multiple-value").append(e).appendTo(o),o},chained:function(){var e=i.options.get();if(e.relatives&&e.chainedRelatives){var t=function(t){e.relatives.each((function(){var e=i.isEmpty($(this).val()),t=i.isEmpty(i.value);!e&&t||i.fvalue.clear(),i.fdisabled(e)}))};e.relatives.on("change",(function(){t()})),t()}}},this.fvalue={get:function(e){var t=i.value;return!i.options.get().multiple&&!this.isJSON()||e?t:this.toObj(t)},set:function(e,a){return i.fdisabled()||(a||this.clear(!0),this._load(e)),t},add:function(e){return i.options.get("multiple")&&this.set(e,!0),this},toggle:function(e){return i.fdisabled()||this.multiple.toggle(e),this},remove:function(e){if(!i.fdisabled()){e=this.toObj(e),t.trigger("before:flexdatalist.remove",[e]);var a=[];if($.isArray(e))$.each(e,(function(e,t){var r=i.fvalue.multiple.remove(t);r&&a.push(r)}));else{var r=this.multiple.remove(e);r&&a.push(r)}t.trigger("after:flexdatalist.remove",[e,a]).trigger("change:flexdatalist",[a,i.options.get()]).trigger("change")}return this},_load:function(e,t,a){var r=i.options.get().valueProperty,s=this.toStr(e),l=this.get(!0);if(t=t||$.noop,0!=s.length||0!=l.length){if(e=this.toObj(e),!i.isEmpty(e)&&!i.isEmpty(r)&&"*"!==r)return i.isObject(r)||(r=r.split(",")),void i.data.load((function(a){i.isObject(e)?$.isArray(e)||(e=[e]):e=e.split(",");for(var s=[],l=0;l0&&i.fvalue.extract(s,!0),t(e)}),e);t(e),i.fvalue.extract(e,a)}else t(e)},extract:function(e,a){var r=i.options.get(),s=[];a||t.trigger("before:flexdatalist.value",[e,r]),$.isArray(e)?$.each(e,(function(e,t){s.push(i.fvalue._extract(t))})):s=i.fvalue._extract(e),a||t.data("result_selected",e).trigger("after:flexdatalist.value",[s,r]).trigger("change:flexdatalist",[s,r]).trigger("change")},_extract:function(e){var t=this.text(e),a=this.value(e);if(i.options.get().multiple){if(!i.isEmpty(t)){if(i.isDup(t))return;s.push(t),this.multiple.add(a,t)}}else this.single(a,t);return{value:a,text:t}},single:function(e,t){t&&t!==n.val()&&(n[0].value=t),i.value=e},multiple:{add:function(e,t){var a=this;this.li(e,t).click((function(){a.toggle($(this))})).find(".fdl-remove").click((function(){i.fvalue.remove($(this).parent())})),this.push(e),n[0].value="",this.checkLimit()},push:function(e,t){var a=i.fvalue.get();e=i.fvalue.toObj(e),a.push(e),e=i.fvalue.toStr(a),i.value=e},toggle:function(e){var a=i.options.get();if(a.toggleSelected){var r=this.findLi(e);if(!r){var s=r.index(),l=r.data(),n=r.hasClass("disabled")?"enable":"disable",o=i.fvalue.get(),u=[{value:l.value,text:l.text,action:n},a];if(t.trigger("before:flexdatalist.toggle",u),"enable"===n){var c=r.data("value");o.splice(s,0,c),r.removeClass("disabled")}else o.splice(s,1),r.addClass("disabled");o=i.fvalue.toStr(o),i.value=o,t.trigger("after:flexdatalist.toggle",u).trigger("change:flexdatalist",u).trigger("change")}}},remove:function(e){var t=this.findLi(e);if(t){var a=i.fvalue.get(),r=t.index(),l=t.data(),n={value:l.value,text:l.text};return a.splice(r,1),a=i.fvalue.toStr(a),i.value=a,t.remove(),i.fvalue.multiple.checkLimit(),s.splice(r,1),n}},removeAll:function(){var e=i.fvalue.get(),a=i.options.get();t.trigger("before:flexdatalist.remove.all",[e,a]),o.find("li:not(.input-container)").remove(),i.value="",s=[],t.trigger("after:flexdatalist.remove.all",[e,a])},li:function(e,t){var a=o.find("li.input-container");return $("
- ").addClass("value"+(i.options.get("toggleSelected")?" toggle":"")).append(''+t+"").append('×').data({text:t,value:i.fvalue.toObj(e)}).insertBefore(a)},checkLimit:function(){var e=i.options.get("limitOfValues");if(e>0){var t=o.find("li.input-container");e==s.length?t.hide():t.show()}},findLi:function(e){if(e instanceof jQuery)0===e.length&&(e=null);else{var t=e;e=null,o.find("li:not(.input-container)").each((function(){var i=$(this);if(i.data("value")===t)return e=i,!1}))}return e},isEmpty:function(){return this.get().length>0}},value:function(e){var t=e,a=i.options.get(),r=a.valueProperty;if(i.isObject(e))if(this.isJSON()||this.isMixed())if(delete e.name_highlight,$.isArray(r)){for(var s={},l=0;l0?i:t,value:t})})),e(r)},url:function(e,a){var r=n.val(),s=i.options.get(),l=s.keywordParamName,o=s.searchContainParamName,u=i.fvalue.get(),c=this.relativesData();if(i.isEmpty(s.url))return e([]);var f={};"post"===s.requestType&&($.each(s,(function(e,t){0!=e.indexOf("_")&&"data"!=e&&(f[e]=t)})),delete f.relatives);var d=i.cache.keyGen({relative:c,load:a,keyword:r,contain:s.searchContain},s.url),h=i.cache.read(d,!0);if(h)e(h);else{var p="function"==typeof s.params?s.params.call(t[0],r):s.params,g=$.extend(c,p,{load:a,selected:u,original:s.originalValue,options:f});g[l]=r,g[o]=s.searchContain,this.remote({url:s.url,data:g,success:function(t){n.val().length>=r.length&&e(t),i.cache.write(d,t,s.cacheLifetime,!0)}})}},remote:function(e){var a=this,r=i.options.get();t.hasClass("flexdatalist-loading")||(t.addClass("flexdatalist-loading"),"json"===r.requestContentType&&(e.data=JSON.stringify(e.data)),$.ajax($.extend({type:r.requestType,dataType:"json",contentType:"application/"+r.requestContentType+"; charset=UTF-8",complete:function(){t.removeClass("flexdatalist-loading")}},e,{success:function(t){t=a.extractRemoteData(t),e.success(t)}})))},extractRemoteData:function(e){var t=i.options.get(),a=i.isDefined(e,t.resultsProperty)?e[t.resultsProperty]:e;return"string"==typeof a&&0===a.indexOf("[{")&&(a=JSON.parse(a)),a&&a.options&&i.options.set($.extend({},t,a.options)),i.isObject(a)?a:[]},relativesData:function(){var e=i.options.get("relatives"),t={};return e&&(t.relatives={},e.each((function(){var e=$(this),i=e.attr("name").split("][").join("-").split("]").join("-").split("[").join("-").replace(/^\|+|\-+$/g,"");t.relatives[i]=e.val()}))),t}},this.search={get:function(e,a,r){if(i.options.get().searchDisabled)s=a;else{var s=i.cache.read(e);if(!s){if(t.trigger("before:flexdatalist.search",[e,a]),!i.isEmpty(e)){s=[];for(var l=this.split(e),n=0;n0)for(var n=0;n')).split("|::|").join("")},find:function(e,t){for(var a=i.options.get(),r=0;r=0:0===s.indexOf(e))return!0}return!1},split:function(e){if("string"==typeof e&&(e=[$.trim(e)]),i.options.get("searchByWord"))for(var t=0;t0){var r=a.split(" ");$.merge(e,r)}}return e},normalizeString:function(e){if("string"==typeof e){var t=i.options.get("normalizeString");return"function"==typeof t&&(e=t(e)),(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).toUpperCase()}return e}},this.results={show:function(e){var a=this,r=i.options.get();if(this.remove(!0),e)if(0!==e.length){var s=this.container();r.groupBy?(e=this.group(e),Object.keys(e).forEach((function(t,l){var n=e[t],o=r.groupBy,u=i.results.highlight(n[0],o,t);$("
- ").addClass("group").append($("").addClass("group-name").html(u)).append($("").addClass("group-item-count").text(" "+n.length)).appendTo(s);a.items(n,s)}))):this.items(e,s);var l=s.find("li:not(.group)");l.on("click",(function(e){var s=$(this).data("item");s&&(i.fvalue.extract(s),a.remove(),t.trigger("select:flexdatalist",[s,r]))})).hover((function(){l.removeClass("active"),$(this).addClass("active").trigger("active:flexdatalist.results",[$(this).data("item")])}),(function(){$(this).removeClass("active")})),r.focusFirstResult&&l.filter(":first").addClass("active")}else this.empty(r.noResultsText)},empty:function(e){if(!i.isEmpty(e)){var a=this.container(),r=n.val();e=e.split("{keyword}").join(r),$("
- ").addClass("item no-results").append(e).appendTo(a),t.trigger("empty:flexdatalist.results",[e])}},items:function(e,a){var r=i.options.get("maxShownResults");t.trigger("show:flexdatalist.results",[e]);for(var s=0;s0&&r===s);s++)this.item(e[s]).appendTo(a);t.trigger("shown:flexdatalist.results",[e])},item:function(e){for(var a=$("
- ").data("item",e).addClass("item"),r=i.options.get(),s=r.visibleProperties,l=0;l-1){var o=i.fvalue.placeholders.replace(e,n),u=i.fvalue.placeholders.parse(n);c=$("").addClass("item item-"+Object.values(u).join("-")).html(o+" ")}else{if(r.groupBy&&r.groupBy===n||!i.isDefined(e,n))continue;var c={};if(n===r.iconProperty)c=$("").addClass("item item-"+n).attr("src",e[n]);else{var f=i.results.highlight(e,n);c=$("").addClass("item item-"+n).html(f+" ")}}c.appendTo(a)}return t.trigger("item:flexdatalist.results",[a,e]),a},container:function(){var e=t;o&&(e=o);var a=$("ul.flexdatalist-results");return 0===a.length&&(a=$("
").addClass("flexdatalist-results ").appendTo("body").attr("id",n.attr("id")+"-results").css({"border-color":e.css("border-left-color"),"border-width":"1px","border-bottom-left-radius":e.css("border-bottom-left-radius"),"border-bottom-right-radius":e.css("border-bottom-right-radius")}).data({target:o||n,input:t}),i.position(n)),a},group:function(e){for(var t=[],a=i.options.get("groupBy"),r=0;r-1||e.indexOf("global")>-1)&&localStorage.removeItem(e);localStorage.clear()}},gc:function(){if(i.cache.isSupported())for(var e in localStorage)if(e.indexOf(l)>-1||e.indexOf("global")>-1){var t=localStorage.getItem(e);t=JSON.parse(t),this.expired(t)&&localStorage.removeItem(e)}},isSupported:function(){if(i.options.get("cache"))try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}return!1},expired:function(e){if(e.lifetime){var t=i.unixtime()-e.timestamp;return e.lifetime<=t}return!1},keyGen:function(e,t,i){"object"==typeof e&&(e=JSON.stringify(e));var a,r,s=void 0===t?2166136261:t;for(a=0,r=e.length;a>>0).toString(16)).substr(-8)}},this.options={init:function(){var e=$.extend({},r,t.data(),{multiple:null===r.multiple?t.is("[multiple]"):r.multiple,disabled:null===r.disabled?t.is("[disabled]"):r.disabled,originalValue:i.value});return this.set(e),e},get:function(e){var a=t.data("flexdatalist");return e?i.isDefined(a,e)?a[e]:null:a||{}},set:function(e,a){var r=this.get();return i.isDefined(r,e)&&i.isDefined(a)?r[e]=a:i.isObject(e)&&(r=this._normalize(e)),t.data("flexdatalist",r),t},_normalize:function(e){if(e.searchIn=i.csvToArray(e.searchIn),e.relatives=e.relatives&&$(e.relatives).length>0?$(e.relatives):null,e.textProperty=null===e.textProperty?e.searchIn[0]:e.textProperty,e.visibleProperties=i.csvToArray(e.visibleProperties,e.searchIn),"*"===e.valueProperty&&e.multiple&&!e.selectionRequired)throw new Error("Selection must be required for multiple, JSON fields!");return e}},this.position=function(){var e=$("ul.flexdatalist-results"),t=e.data("target");e.length>0&&e.css({width:t.outerWidth()+"px",top:t.offset().top+t.outerHeight()+"px",left:t.offset().left+"px"})},this.fdisabled=function(e){if(this.isDefined(e)){if(t.prop("disabled",e),n.prop("disabled",e),o){o.css("background-color",t.css("background-color"));var i=o.find("li .fdl-remove"),a=o.find("li.input-container");e?(o.addClass("disabled"),i.length>0&&a.hide(),i.hide()):(o.removeClass("disabled"),a.show(),i.show())}this.options.set("disabled",e)}return this.options.get("disabled")},this.isDup=function(e){return!this.options.get("allowDuplicateValues")&&(s.length>0&&s.indexOf(this.fvalue.text(e))>-1)},this.keyNum=function(e){return e.which||e.keyCode},this.isEmpty=function(e){return!i.isDefined(e)||(null===e||!0!==e&&(0===this.length(e)||""===$.trim(e)))},this.isObject=function(e){return e&&"object"==typeof e},this.length=function(e){return this.isObject(e)?Object.keys(e).length:"number"==typeof e||"number"==typeof e.length?e.toString().length:0},this.isDefined=function(e,t){var i=void 0!==e;return i&&void 0!==t?void 0!==this.getPropertyValue(e,t):i},this.unixtime=function(e){var t=new Date;return e&&(t=new Date(e)),Math.round(t.getTime()/1e3)},this.csvToArray=function(e,t){return 0===e.length?t:"string"==typeof e?e.split(i.options.get("valuesSeparator")):e},this.getPropertyValue=function(e,t){if(!e||"string"!=typeof t)return e;for(var i=t.split(".");i.length&&(e=e[i.shift()]););return e},this.escapeHtml=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},this.debug=function(e,a){var r=i.options.get();r.debug&&(a||(a={}),e="Flexdatalist: "+e,console.warn(e),console.log($.extend({inputName:t.attr("name"),options:r},a)),console.log("--- /flexdatalist ---"))},this.init()}))},jQuery((function(e){e(document).data("flexdatalist")||e(document).mouseup((function(t){var i=e(".flexdatalist-results"),a=i.data("target");a&&a.is(":focus")||i.is(t.target)||0!==i.has(t.target).length||i.remove()})).keydown((function(t){var i=e(".flexdatalist-results"),a=i.find("li"),r=a.filter(".active"),s=r.index(),l=a.length,n=t.which||t.keyCode;if(0!==l)if(27!==n){if(13===n)t.preventDefault(),r.click();else if(40===n||38===n){t.preventDefault(),40===n?r=s0?r.removeClass("active").nextAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:first").addClass("active"):38===n&&(r=s>0&&r.prevAll(".item").first().length>0?r.removeClass("active").prevAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:last").addClass("active")),r.trigger("active:flexdatalist.results",[r.data("item")]);var o=(0===r.prev().length?r:r.prev()).position().top;i.animate({scrollTop:o+i.scrollTop()},100)}}else i.remove()})).data("flexdatalist",!0),jQuery("input.flexdatalist:not(.flexdatalist-set):not(.autodiscover-disabled)").flexdatalist()})),function(e){var t=e.fn.val;e.fn.val=function(e){var i=this.length>0&&void 0!==this[0].fvalue;return void 0===e?i?this[0].fvalue.get(!0):t.call(this):i?this[0].fvalue.set(e):t.call(this,e)}}(jQuery);
\ No newline at end of file
+jQuery.fn.flexdatalist=function(e,t){"use strict";var i=function(e,t){e.each((function(){var e=$(this),i=e.data(),a=i.flexdatalist,r=i.aliascontainer;r&&(e.removeClass("flexdatalist-set").attr({style:null,tabindex:null}).val(a&&a.originalValue&&!t?a.originalValue:"").removeData("flexdatalist").removeData("aliascontainer").off(),r.remove())}))};if("string"==typeof e&&"reset"!==e){if("object"==typeof this[0]&&void 0!==this[0].fvalue){var a=this[0];if("destroy"===e)i(this,t);else if("value"===e){if(void 0===t)return a.fvalue.get();a.fvalue.set(t)}else if("add"===e){if(void 0===t)return a.debug("Missing value to add!");a.fvalue.add(t)}else if("toggle"===e){if(void 0===t)return a.debug("Missing value to toggle!");a.fvalue.toggle(t)}else if("remove"===e){if(void 0===t)return a.debug("Missing value to remove!");a.fvalue.remove(t)}else if("disabled"===e){if(void 0===t)return a.fdisabled();a.fdisabled(t)}else if("string"==typeof e){if(void 0===t)return a.options.get(e);a.options.set(e,t)}return this}e={_option:t}}this.length>0&&void 0!==this[0].fvalue&&i(this);var r=$.extend({url:null,data:[],params:{},relatives:null,chainedRelatives:!1,cache:!0,cacheLifetime:60,minLength:3,groupBy:!1,selectionRequired:!1,focusFirstResult:!1,textProperty:null,valueProperty:null,visibleProperties:[],iconProperty:"thumb",searchIn:["label"],searchContain:!1,searchEqual:!1,searchByWord:!1,searchDisabled:!1,searchDelay:400,normalizeString:null,multiple:null,disabled:null,maxShownResults:100,removeOnBackspace:!0,noResultsText:'No results found for "{keyword}"',toggleSelected:!1,allowDuplicateValues:!1,redoSearchOnFocus:!0,requestType:"get",requestContentType:"x-www-form-urlencoded",requestHeaders:null,resultsProperty:"results",keywordParamName:"keyword",searchContainParamName:"contain",limitOfValues:0,valuesSeparator:",",debug:!0},e);return this.each((function(e){var t=$(this),i=this,a=null,s=[],n="flex"+e,l=null,o=null;this.init=function(){var e=this.options.init();this.set.up(),l.on("focusin",(function(e){i.action.redoSearchFocus(e),i.action.showAllResults(e),o&&o.addClass("focus")})).on("input keydown",(function(e){9===i.keyNum(e)&&i.results.remove(),i.action.keypressValue(e,188),i.action.backSpaceKeyRemove(e)})).on("input keyup",(function(e){i.action.keypressValue(e,13),i.action.keypressSearch(e),i.action.copyValue(e),i.action.backSpaceKeyRemove(e),i.action.showAllResults(e),i.action.clearValue(e),i.action.removeResults(e),i.action.inputWidth(e)})).on("focusout",(function(e){o&&o.removeClass("focus"),i.action.clearText(e),i.action.clearValue(e)})),window.onresize=function(e){i.position()},this.cache.gc(),e.selectionRequired&&i.fvalue.clear(!0,!0),this.fvalue._load(e.originalValue,(function(a,r){i.fdisabled(e.disabled),t.trigger("init:flexdatalist",[e])}),!0)},this.action={keypressValue:function(e,t){var a=i.keyNum(e),r=l[0].value,s=i.options.get();if(r.length>0&&a===t&&!s.selectionRequired&&s.multiple){r=l[0].value;e.preventDefault(),e.stopPropagation(),i.fvalue.extract(r),i.results.remove()}},keypressSearch:function(e){var t=i.keyNum(e),r=l.val(),s=r.length,n=i.options.get();clearTimeout(a),(!t||13!==t&&(t<37||t>40))&&(a=setTimeout((function(){(0===n.minLength&&s>0||n.minLength>0&&s>=n.minLength)&&i.data.load((function(e){i.search.get(r,e,(function(e){i.results.show(e)}))}))}),n.searchDelay))},redoSearchFocus:function(e){var t=i.fvalue.get(),a=i.options.get(),r=l.val();a.redoSearchOnFocus&&(r.length>0&&a.multiple||r.length>0&&0===t.length)&&this.keypressSearch(e)},copyValue:function(e){if(13!==i.keyNum(e)){var t=l.val(),a=i.fvalue.get(!0),r=i.options.get();r.multiple||r.selectionRequired||t.length===a.length||i.fvalue.extract(t)}},backSpaceKeyRemove:function(e){var t=i.options.get();if(t.removeOnBackspace&&t.multiple){var a=l.val(),r=l.data("_remove");8===i.keyNum(e)&&(0===a.length?r?(i.fvalue.remove(r),l.data("_remove",null)):l.data("_remove",l.parents("li:eq(0)").prev()):l.data("_remove",null))}},showAllResults:function(e){var t=l.val();""===(t=$.trim(t))&&0===i.options.get("minLength")&&i.data.load((function(e){i.results.show(e)}))},inputWidth:function(e){if(i.options.get().multiple){var a=l.val(),r=parseInt(l.css("fontSize").replace("px","")),s=t.innerWidth(),n=(a.length+1)*r;n>=40&&n<=s&&(l[0].style.width=n+"px")}},clearText:function(e){var t=i.fvalue.get(),a=i.options.get();!a.multiple&&a.selectionRequired&&0===t.length&&(l[0].value="")},clearValue:function(e){i.fvalue.get();var t=l.val(),a=i.options.get();!a.multiple&&a.selectionRequired&&t.length<=a.minLength&&i.fvalue.clear()},removeResults:function(e){var t=l.val(),a=i.options.get();a.minLength>0&&t.length').attr({class:t.attr("class"),name:t.attr("name")?"flexdatalist-"+t.attr("name"):null,id:e,placeholder:t.attr("placeholder")}).addClass("flexdatalist-alias "+e).removeClass("flexdatalist").attr("autocomplete","off")},multipleInput:function(e){return o=$('').addClass("flexdatalist-multiple "+n).css({"border-color":t.css("border-left-color"),"border-width":t.css("border-left-width"),"border-style":t.css("border-left-style"),"border-radius":t.css("border-top-left-radius"),"background-color":t.css("background-color")}).insertAfter(t).on("click",(function(){$(this).find("input").trigger("focus")})),$('- ').addClass("flexdatalist-multiple-value").append(e).appendTo(o),o},chained:function(){var e=i.options.get();if(e.relatives&&e.chainedRelatives){var t=function(t){e.relatives.each((function(){var e=i.isEmpty($(this).val()),t=i.isEmpty(i.value);!e&&t||i.fvalue.clear(),i.fdisabled(e)}))};e.relatives.on("change",(function(){t()})),t()}},accessibility:function(e){var i={"aria-autocomplete":"list","aria-expanded":"false","aria-owns":(t.attr("id")?t.attr("id")+"-flexdatalist":n)+"-results"};e.attr(i)}},this.fvalue={get:function(e){var t=i.value;return!i.options.get().multiple&&!this.isJSON()||e?t:this.toObj(t)},set:function(e,a){return i.fdisabled()||(a||this.clear(!0),this._load(e)),t},add:function(e){return i.options.get("multiple")&&this.set(e,!0),this},toggle:function(e){return i.fdisabled()||this.multiple.toggle(e),this},remove:function(e){if(!i.fdisabled()){e=this.toObj(e),t.trigger("before:flexdatalist.remove",[e]);var a=[];if(i.isArray(e))$.each(e,(function(e,t){var r=i.fvalue.multiple.remove(t);r&&a.push(r)}));else{var r=this.multiple.remove(e);r&&a.push(r)}t.trigger("after:flexdatalist.remove",[e,a]).trigger("change:flexdatalist",[a,i.options.get()]).trigger("change")}return this},_load:function(e,t,a){var r=i.options.get().valueProperty,s=this.toStr(e),n=this.get(!0);if(t=t||$.noop,0!=s.length||0!=n.length){if(e=this.toObj(e),!i.isEmpty(e)&&!i.isEmpty(r)&&"*"!==r)return i.isObject(r)||(r=r.split(",")),void i.data.load((function(a){i.isObject(e)?i.isArray(e)||(e=[e]):e=e.split(",");for(var s=[],n=0;n0&&i.fvalue.extract(s,!0),t(e)}),e);t(e),i.fvalue.extract(e,a)}else t(e)},extract:function(e,a){var r=i.options.get(),s=[];a||t.trigger("before:flexdatalist.value",[e,r]),i.isArray(e)?$.each(e,(function(e,t){s.push(i.fvalue._extract(t))})):s=i.fvalue._extract(e),a||t.data("result_selected",e).trigger("after:flexdatalist.value",[s,r]).trigger("change:flexdatalist",[s,r]).trigger("change")},_extract:function(e){var t=this.text(e),a=this.value(e);if(i.options.get().multiple){if(!i.isEmpty(t)){if(i.isDup(t))return;s.push(t),this.multiple.add(a,t)}}else this.single(a,t);return{value:a,text:t}},single:function(e,t){t&&t!==l.val()&&(l[0].value=t),i.value=e},multiple:{add:function(e,t){var a=this;this.li(e,t).on("click",(function(){a.toggle($(this))})).find(".fdl-remove").on("click",(function(){i.fvalue.remove($(this).parent())})),this.push(e),l[0].value="",this.handleLimit()},push:function(e,t){var a=i.fvalue.get();a.includes(e)||(e=i.fvalue.toObj(e),a.push(e),e=i.fvalue.toStr(a),i.value=e)},toggle:function(e){var a=i.options.get();if(a.toggleSelected){var r=this.findLi(e);if(r){var s=r.data(),n=r.hasClass("disabled")?"enable":"disable",l=[{value:s.value,text:s.text,action:n},a];t.trigger("before:flexdatalist.toggle",l),"enable"===n?r.removeClass("disabled"):r.addClass("disabled");var u=[];o.find("li.toggle:not(.disabled)").each((function(){var e=$(this);u.push(e.data("value"))})),u=i.fvalue.toStr(u),i.value=u,t.trigger("after:flexdatalist.toggle",l).trigger("change:flexdatalist",l).trigger("change")}}},remove:function(e){var t=this.findLi(e);if(t){var a=i.fvalue.get(),r=t.index(),n=t.data(),l={value:n.value,text:n.text};return a.splice(r,1),a=i.fvalue.toStr(a),i.value=a,t.remove(),i.fvalue.multiple.handleLimit(),s.splice(r,1),this.handleLimit(),l}},removeAll:function(){var e=i.fvalue.get(),a=i.options.get();t.trigger("before:flexdatalist.remove.all",[e,a]),o.find("li:not(.input-container)").remove(),i.value="",s=[],this.handleLimit(),t.trigger("after:flexdatalist.remove.all",[e,a])},li:function(e,t){var a=o.find("li.input-container"),r=i.options.get();return $("
- ").addClass("value"+(r.toggleSelected?" toggle":"")).append(''+t+"").append('×').data({text:t,value:i.fvalue.toStr(e)}).insertBefore(a)},handleLimit:function(){var e=this.isAtLimit(),t=o.find("li.input-container");e?t.hide():t.show()},isAtLimit:function(){var e=i.options.get("limitOfValues");return e>0&&e==s.length},findLi:function(e){if(e instanceof jQuery)0===e.length&&(e=null);else{var t=e;e=null,o.find("li:not(.input-container)").each((function(){var i=$(this);if(i.data("value")===t)return e=i,!1}))}return e},isEmpty:function(){return this.get().length>0}},value:function(e){var t=e,a=i.options.get(),r=a.valueProperty;if(i.isObject(e))if(this.isJSON()||this.isMixed())if(delete e.name_highlight,i.isArray(r)){for(var s={},n=0;n0?i:t,value:t})})),e(r)},url:function(e,a){var r=l.val(),s=i.options.get(),n=s.keywordParamName,o=s.searchContainParamName,u=i.fvalue.get(),c=this.relativesData();if(i.isEmpty(s.url))return e([]);var f={};"post"===s.requestType&&($.each(s,(function(e,t){0!=e.indexOf("_")&&"data"!=e&&(f[e]=t)})),delete f.relatives);var d=i.cache.keyGen({relative:c,load:a,keyword:r,contain:s.searchContain},s.url),h=i.cache.read(d,!0);if(h)e(h);else{var p="function"==typeof s.params?s.params.call(t[0],r):s.params,g=$.extend(c,p,{load:a,selected:u,original:s.originalValue,options:f});g[n]=r,g[o]=s.searchContain,this.remote({url:s.url,data:g,success:function(t){l.val().length>=r.length&&e(t),i.cache.write(d,t,s.cacheLifetime,!0)}})}},remote:function(e){var a=this,r=i.options.get();t.hasClass("flexdatalist-loading")||(t.addClass("flexdatalist-loading"),"json"===r.requestContentType&&(e.data=JSON.stringify(e.data)),$.ajax($.extend({type:r.requestType,dataType:"json",headers:r.requestHeaders,contentType:"application/"+r.requestContentType+"; charset=UTF-8",complete:function(){t.removeClass("flexdatalist-loading")}},e,{success:function(t){t=a.extractRemoteData(t),e.success(t)}})))},extractRemoteData:function(e){var t=i.options.get(),a=i.isDefined(e,t.resultsProperty)?e[t.resultsProperty]:e;return"string"==typeof a&&0===a.indexOf("[{")&&(a=JSON.parse(a)),a&&a.options&&i.options.set($.extend({},t,a.options)),i.isObject(a)?a:[]},relativesData:function(){var e=i.options.get("relatives"),t={};return e&&(t.relatives={},e.each((function(){var e=$(this),i=e.attr("name").split("][").join("-").split("]").join("-").split("[").join("-").replace(/^\|+|\-+$/g,"");t.relatives[i]=e.val()}))),t}},this.search={get:function(e,a,r){var s=a;if(!i.options.get().searchDisabled&&!(s=i.cache.read(e))){if(t.trigger("before:flexdatalist.search",[e,a]),!i.isEmpty(e)){s=[];for(var n=this.split(e),l=0;l0)for(var l=0;l')).split("|::|").join("
")},find:function(e,t){for(var a=i.options.get(),r=0;r=0:0===s.indexOf(e))return!0}return!1},split:function(e){if("string"==typeof e&&(e=[$.trim(e)]),i.options.get("searchByWord"))for(var t=0;t0){var r=a.split(" ");$.merge(e,r)}}return e},normalizeString:function(e){if("string"==typeof e){var t=i.options.get("normalizeString");return"function"==typeof t&&(e=t(e)),(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).toUpperCase()}return e}},this.results={show:function(e){var a=this,r=i.options.get();if(this.remove(!0),e)if(0!==e.length){var s=this.container();r.groupBy?(e=this.group(e),Object.keys(e).forEach((function(t,n){var l=e[t],o=r.groupBy,u=i.results.highlight(l[0],o,t);$("- ").addClass("group").append($("").addClass("group-name").html(u)).append($("").addClass("group-item-count").text(" "+l.length)).appendTo(s);a.items(l,s)}))):this.items(e,s);var n=s.find("li:not(.group)");n.on("click",(function(e){var s=$(this).data("item");s&&(i.fvalue.extract(s),a.remove(),t.trigger("select:flexdatalist",[s,r]))})).on("hover",(function(){n.removeClass("active"),$(this).addClass("active").trigger("active:flexdatalist.results",[$(this).data("item")])}),(function(){$(this).removeClass("active")})),r.focusFirstResult&&n.filter(":first").addClass("active")}else this.empty(r.noResultsText)},empty:function(e){if(!i.isEmpty(e)){var a=this.container(),r=l.val();e=e.split("{keyword}").join(r),$("
- ").addClass("item no-results").append(e).appendTo(a),t.trigger("empty:flexdatalist.results",[e])}},items:function(e,a){var r=i.options.get("maxShownResults");t.trigger("show:flexdatalist.results",[e]);for(var s=0;s0&&r===s);s++)this.item(e[s],s,e.length).appendTo(a);t.trigger("shown:flexdatalist.results",[e])},item:function(e,a,r){var s=$("
- ").attr({role:"option",tabindex:"-1","aria-posinset":a+1,"aria-setsize":r}).data("item",e).addClass("item"),n=i.options.get(),l=n.visibleProperties;for(a=0;a-1){var u=i.fvalue.placeholders.replace(e,o),c=i.fvalue.placeholders.parse(o);f=$("").addClass("item item-"+Object.values(c).join("-")).html(u+" ")}else{if(n.groupBy&&n.groupBy===o||!i.isDefined(e,o))continue;var f={};if(o===n.iconProperty)f=$("").addClass("item item-"+o).attr("src",e[o]);else{var d=i.results.highlight(e,o);f=$("").addClass("item item-"+o).html(d+" ")}}f.appendTo(s)}return t.trigger("item:flexdatalist.results",[s,e]),s},container:function(){var e=t;o&&(e=o);var a=$("ul.flexdatalist-results");return 0===a.length&&(a=$("
").addClass("flexdatalist-results ").appendTo("body").attr({id:l.attr("id")+"-results",role:"listbox"}).css({"border-color":e.css("border-left-color"),"border-width":"1px","border-bottom-left-radius":e.css("border-bottom-left-radius"),"border-bottom-right-radius":e.css("border-bottom-right-radius")}).data({target:o||l,input:t}),i.position(l)),a},group:function(e){for(var t=[],a=i.options.get("groupBy"),r=0;r-1||e.indexOf("global")>-1)&&localStorage.removeItem(e);localStorage.clear()}},gc:function(){if(i.cache.isSupported())for(var e in localStorage)if(e.indexOf(n)>-1||e.indexOf("global")>-1){var t=localStorage.getItem(e);t=JSON.parse(t),this.expired(t)&&localStorage.removeItem(e)}},isSupported:function(){if(i.options.get("cache"))try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}return!1},expired:function(e){if(e.lifetime){var t=i.unixtime()-e.timestamp;return e.lifetime<=t}return!1},keyGen:function(e,t,i){"object"==typeof e&&(e=JSON.stringify(e));var a,r,s=void 0===t?2166136261:t;for(a=0,r=e.length;a>>0).toString(16)).substr(-8)}},this.options={init:function(){var e=$.extend({},r,t.data(),{multiple:null===r.multiple?t.is("[multiple]"):r.multiple,disabled:null===r.disabled?t.is("[disabled]"):r.disabled,originalValue:i.value});return this.set(e),e},get:function(e){var a=t.data("flexdatalist");return e?i.isDefined(a,e)?a[e]:null:a||{}},set:function(e,a){var r=this.get();return i.isDefined(r,e)&&i.isDefined(a)?r[e]=a:i.isObject(e)&&(r=this._normalize(e)),t.data("flexdatalist",r),t},_normalize:function(e){if(e.searchIn=i.csvToArray(e.searchIn),e.relatives=e.relatives&&$(e.relatives).length>0?$(e.relatives):null,e.textProperty=null===e.textProperty?e.searchIn[0]:e.textProperty,e.visibleProperties=i.csvToArray(e.visibleProperties,e.searchIn),"*"===e.valueProperty&&e.multiple&&!e.selectionRequired)throw new Error("Selection must be required for multiple, JSON fields!");return e}},this.position=function(){var e=$("ul.flexdatalist-results"),t=e.data("target");e.length>0&&e.css({width:t.outerWidth()+"px",top:t.offset().top+t.outerHeight()+"px",left:t.offset().left+"px"})},this.fdisabled=function(e){if(this.isDefined(e)){if(t.prop("disabled",e),l.prop("disabled",e),o){o.css("background-color",t.css("background-color"));var i=o.find("li .fdl-remove"),a=o.find("li.input-container");e?(o.addClass("disabled"),i.length>0&&a.hide(),i.hide()):(o.removeClass("disabled"),a.show(),i.show())}this.options.set("disabled",e)}return this.options.get("disabled")},this.isDup=function(e){return!this.options.get("allowDuplicateValues")&&(s.length>0&&s.indexOf(this.fvalue.text(e))>-1)},this.keyNum=function(e){return e.which||e.keyCode},this.isEmpty=function(e){return!i.isDefined(e)||(null===e||!0!==e&&(0===this.length(e)||""===$.trim(e)))},this.isObject=function(e){return e&&"object"==typeof e},this.length=function(e){return this.isObject(e)?Object.keys(e).length:"number"==typeof e||"number"==typeof e.length?e.toString().length:0},this.isDefined=function(e,t){var i=void 0!==e;return i&&void 0!==t?void 0!==this.getPropertyValue(e,t):i},this.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},this.unixtime=function(e){var t=new Date;return e&&(t=new Date(e)),Math.round(t.getTime()/1e3)},this.csvToArray=function(e,t){return 0===e.length?t:"string"==typeof e?e.split(i.options.get("valuesSeparator")):e},this.getPropertyValue=function(e,t){if(e&&"string"==typeof t){for(var i=t.split(".");i.length&&(e=e[i.shift()]););return e}},this.escapeHtml=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},this.debug=function(e,a){var r=i.options.get();r.debug&&(a||(a={}),e="Flexdatalist: "+e,console.warn(e),console.log($.extend({inputName:t.attr("name"),options:r},a)),console.log("--- /flexdatalist ---"))},this.init()}))},jQuery((function(e){e(document).data("flexdatalist")||e(document).on("mouseup",(function(t){var i=e(".flexdatalist-results"),a=i.data("target");a&&a.is(":focus")||i.is(t.target)||0!==i.has(t.target).length||i.remove()})).on("keydown",(function(t){var i=e(".flexdatalist-results"),a=i.find("li"),r=a.filter(".active"),s=r.index(),n=a.length,l=t.which||t.keyCode;if(0!==n)if(27!==l){if(13===l)t.preventDefault(),r.trigger("click");else if(40===l||38===l){t.preventDefault(),40===l?r=s0?r.removeClass("active").nextAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:first").addClass("active"):38===l&&(r=s>0&&r.prevAll(".item").first().length>0?r.removeClass("active").prevAll(".item").first().addClass("active"):a.removeClass("active").filter(".item:last").addClass("active")),r.trigger("active:flexdatalist.results",[r.data("item")]);var o=(0===r.prev().length?r:r.prev()).position().top;i.animate({scrollTop:o+i.scrollTop()},100)}}else i.remove()})).data("flexdatalist",!0),jQuery("input.flexdatalist:not(.flexdatalist-set):not(.autodiscover-disabled)").flexdatalist()})),function(e){var t=e.fn.val;e.fn.val=function(e){var i=this.length>0&&void 0!==this[0].fvalue;return void 0===e?i?this[0].fvalue.get(!0):t.call(this):i?this[0].fvalue.set(e):t.call(this,e)}}(jQuery);
+//# sourceMappingURL=jquery.flexdatalist.min.js.map
\ No newline at end of file
diff --git a/jquery.flexdatalist.min.js.map b/jquery.flexdatalist.min.js.map
new file mode 100644
index 0000000..27d4ef7
--- /dev/null
+++ b/jquery.flexdatalist.min.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["jquery.flexdatalist.js"],"names":[],"mappings":"AAkBC,MAAO,GAAG,aAAe,SAAU,EAAS,GACxC,aAEA,IAAI,EAAU,SAAU,EAAO,GAC3B,EAAM,MAAK,WACP,IAAI,EAAQ,EAAE,MACV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WAjCH,EAAI,YAmCT,KAAK,gBAAgB,GAG5B,OAAO,yEAAyE,kBAGpF,SAAW,GACP,IAAI,EAAO,EAAE,GAAG,IAChB,EAAE,GAAG,IAAM,SAAU,GACjB,IAAI,EAAS,KAAK,OAAS,QAA+B,IAAnB,KAAK,GAAG,OAC/C,YAAqB,IAAV,EACA,EAAS,KAAK,GAAG,OAAO,KAAI,GAAQ,EAAK,KAAK,MAElD,EAAS,KAAK,GAAG,OAAO,IAAI,GAAS,EAAK,KAAK,KAAM,IAPpE,CASG,S"}
\ No newline at end of file
diff --git a/package.json b/package.json
index 5cb31ae..a9dda3e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "jQuery.Flexdatalist",
"description": "jQuery Datalist Autocomplete plugin",
- "version": "2.2.4",
+ "version": "2.3.0",
"repository": {
"type": "git",
"url": "https://github.com/sergiodlopes/jquery-flexdatalist.git"