From 8b14361e50831ca7146563bb5f888fef11522fd5 Mon Sep 17 00:00:00 2001 From: anovi Date: Sat, 19 Jul 2014 18:56:44 +0400 Subject: [PATCH] Updated dist --- dist/selectonic.js | 28 ++++++++++++++++++---------- dist/selectonic.min.js | 4 ++-- dist/selectonic.min.map | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/dist/selectonic.js b/dist/selectonic.js index 1ee7505..5967e8c 100644 --- a/dist/selectonic.js +++ b/dist/selectonic.js @@ -1,4 +1,4 @@ -/*! Selectonic - v0.6.0 - 2014-07-06 +/*! Selectonic - v0.6.0 - 2014-07-19 * https://github.com/anovi/selectonic * Copyright (c) 2014 Alexey Novichkov; Licensed MIT */ (function($, window, undefined) { @@ -8,7 +8,7 @@ var outerHeight = $.fn.outerHeight ? 'outerHeight' : 'height'; if ( !$.fn.jquery && !$.fn.zepto ) { $.fn.zepto = true; } - // From Underscore library – http://underscorejs.org/#throttle + // From Underscore library - http://underscorejs.org/#throttle var _throttle = function(func, wait, options) { var context, args, result; var timeout = null; @@ -596,7 +596,7 @@ // If there is one selected item and it is focused if ( this._selected && this._selected === 1 && this._getIsSelected(this.ui.focus) ) { /* It is case, when user moves cursor by keys or chooses single items by mouse - — need just clear selection from focus — no need run go whole DOM of list */ + - need just clear selection from focus - no need run go whole DOM of list */ this._unselect( e, params, this.ui.focus, params.isTargetWasSelected ); } else if (this._selected) { @@ -712,8 +712,8 @@ /* If it's unselecting and item is selected target, and is not 'multi' or 'range' select mode - — do nothing because state of selected target should not change - – it is just unselecting other items */ + - do nothing because state of selected target should not change + - it is just unselecting other items */ if (isSelectedTarget && !aboveZero && !params.isMultiSelect && !params.isRangeSelect ) { return; } if( selectedCondition ) { @@ -1012,7 +1012,7 @@ // SHIFT mode } else if ( this.ui.focus && this.options.get('multi') && e.shiftKey && !isAllSelect ) { - // Call multiVariator or rangeVariator – + // Call multiVariator or rangeVariator - // it set all needed params depends from arguments if ( key === Plugin.keyCode.END || key === Plugin.keyCode.HOME || @@ -1099,7 +1099,7 @@ if ( this._keyModes.shift && this._shiftModeAction === 'select' && isTargetSelected ) { /* When user select range of items by holding SHIFT and presses arrow key, there are already can be - selected items — focus should jump through these selected items to first unselected item */ + selected items - focus should jump through these selected items to first unselected item */ // While first unselected item will be found or edge of the list will be reached while( this._getIsSelected(params.items) && params.items.length > 0 ) { @@ -1135,7 +1135,7 @@ /** * Used by _keyHandler - * when UP, DOWN, PageUp, PageDown keys has pressed — find target or first/last element of the list + * when UP, DOWN, PageUp, PageDown keys has pressed - find target or first/last element of the list * @method _findNextTarget * @private * @param {String} direction Indicates 'prev' 'next' or 'pageup' 'pagedown' item to find @@ -1146,7 +1146,7 @@ Plugin.prototype._findNextTarget = function( direction, params ) { var edge = ( direction === 'next' || direction === "pagedown" ) ? 'first' : 'last', // extreme item of the list // If there is the focus - try to find next sibling - // else get first|last item of the list — depends from direction + // else get first|last item of the list - depends from direction res = ( this.ui.focus ) ? this._getItems( params, direction, this.ui.focus ) : this._getItems( params, edge ); // If has not found any items and loop option is ON @@ -1248,6 +1248,8 @@ return; } delete this._mousedownOnItem; + // to prevent blurring when mousedown on element and mouseup on another element + if (!params.target && type === 'click') {return;} } else { return; } if( options.multi && params.target ) { @@ -1337,7 +1339,7 @@ if ( _this[method] && $.isFunction(_this[method]) ) { publicMethod = _this[method]; } - // If method exists and it is not private – call him + // If method exists and it is not private - call him if ( publicMethod && $.isFunction( publicMethod ) && method.charAt(0) !== '_' ) { args = Array.prototype.slice.call( arguments ); args.shift(); @@ -1419,6 +1421,11 @@ }; + /** + * Uunselect one or more items in the list. It is multi-selection. + * @method unselect + * @param {HTMLElement|String} selector A selector or element or set of elements to select. + **/ Plugin.prototype.unselect = function( selector ) { return this.select( selector, true ); }; @@ -1428,6 +1435,7 @@ * Select/unselect one or more items in the list. It is multi-selection. * @method select * @param {HTMLElement|String} selector A selector or element or set of elements to select. + * @param {Boolean} revert If true then method will work as `unselect`. **/ Plugin.prototype.select = function( selector, revert ) { var $elem, params; diff --git a/dist/selectonic.min.js b/dist/selectonic.min.js index 0da4df5..fe00dc9 100644 --- a/dist/selectonic.min.js +++ b/dist/selectonic.min.js @@ -1,6 +1,6 @@ -/*! Selectonic - v0.6.0 - 2014-07-06 +/*! Selectonic - v0.6.0 - 2014-07-19 * https://github.com/anovi/selectonic * Copyright (c) 2014 Alexey Novichkov; Licensed MIT */ -!function(a,b,c){"use strict";function d(b,c,d){return this._schema=b,this._options={},this._callbacks={},this.set(a.extend({},c,d||{}),!0),this}function e(b,c){this._name=e.pluginName,this.el=b,this.$el=a(b),this.ui={},this._selected=0,this._isEnable=!0,this._keyModes={},this.options=new d(l,k,c);var f=this;this.options.on("filter",function(a){return f._itemsSelector="."+f.options.get("listClass")+" "+a,a}),this.options.on("autoScroll",function(a){return f._setScrolledElem(a),a}),this._itemsSelector="."+this.options.get("listClass")+" "+this.options.get("filter"),this._setScrolledElem(this.options.get("autoScroll")),this._init()}var f=a.fn.outerHeight?"outerHeight":"height";a.fn.jquery||a.fn.zepto||(a.fn.zepto=!0);var g=function(a,b,c){var d,e,f,g=null,h=0;c=c||{};var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},h=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},i=function(a,b){return a instanceof Array?h.call(a,b)>=0:!1},j=a(b.document);d.isCorrectType=function(a,b){var c=typeof a,d=null===a&&b.nullable;return b.type instanceof Array?i(b.type,c)||d:c===b.type||d},d.prototype.set=function(b,e){var f,g;for(f in b){var h=b[f],j=this._schema[f];if(j!==c){if(j.unchangeable&&!e)throw new Error('Option "'+f+'" could be setted once at the begining.');if(!d.isCorrectType(h,j)){var k='Option "'+f+'" must be '+(j.type instanceof Array?j.type.join(", "):j.type)+(j.nullable?" or null.":".");throw new TypeError(k)}if(j.values&&!i(j.values,h))throw new RangeError('Option "'+f+'" only could be in these values: "'+j.values.join('", "')+'".')}}for(f in b)(g=this._callbacks[f])&&(b[f]=g.call(this,b[f]));this._options=a.extend(this._options,b)},d.prototype.get=function(b){return b?this._options[b]:a.extend({},this._options)},d.prototype.on=function(a,b){this._callbacks[a]=b},d.prototype.off=function(a){this._callbacks[a]&&delete this._callbacks[a]};var k={filter:"> *",multi:!0,mouseMode:"standard",focusBlur:!1,selectionBlur:!1,handle:null,textSelection:!1,focusOnHover:!1,keyboard:!1,keyboardMode:"select",autoScroll:!0,loop:!1,preventInputs:!0,listClass:"j-selectable",focusClass:"j-focused",selectedClass:"j-selected",disabledClass:"j-disabled",create:null,before:null,focusLost:null,select:null,unselect:null,unselectAll:null,stop:null,destroy:null},l={filter:{type:"string"},multi:{type:"boolean"},mouseMode:{type:"string",values:["standard","mouseup","toggle"]},focusBlur:{type:"boolean"},selectionBlur:{type:"boolean"},handle:{type:"string",nullable:!0},textSelection:{type:"boolean"},focusOnHover:{type:"boolean"},keyboard:{type:"boolean"},keyboardMode:{type:"string",values:["select","toggle"]},autoScroll:{type:["boolean","string"]},loop:{type:"boolean"},preventInputs:{type:"boolean"},listClass:{type:"string",unchangeable:!0},focusClass:{type:"string",unchangeable:!0},selectedClass:{type:"string",unchangeable:!0},disabledClass:{type:"string",unchangeable:!0},create:{type:"function",nullable:!0},before:{type:"function",nullable:!0},focusLost:{type:"function",nullable:!0},select:{type:"function",nullable:!0},unselect:{type:"function",nullable:!0},unselectAll:{type:"function",nullable:!0},stop:{type:"function",nullable:!0},destroy:{type:"function",nullable:!0}};e.pluginName="selectonic",e.keyCode={DOWN:40,UP:38,SHIFT:16,END:35,HOME:36,PAGE_DOWN:34,PAGE_UP:33,A:65,SPACE:32,ENTER:13},e.getDataObject=function(b){return a(b).data("plugin_"+e.pluginName)},e.prototype._init=function(){this.$el.addClass(this.options.get("listClass")),this._bindEvents(),this.$el.data("plugin_"+e.pluginName,this),this._trigger("create")},e.prototype._setScrolledElem=function(b){var c;if(null===b||!1===b)return void delete this._scrolledElem;if("string"==typeof b){if(c=a(b),!(c.length>0))throw new Error('There are no elements that matches to selector - "'+b+'"');return void(this._scrolledElem=c[0])}this._scrolledElem=this.el},e.prototype._cancel=function(b,c){if(!c.wasCancelled){c.isCancellation=this._isPrevented=!0;var d=this;a.each(a(c.changedItems),function(e,f){c.prevItemsStates[e]?d._select(b,c,a(f),!0):d._unselect(b,c,a(f),!0)}),c.prevFocus&&this._setFocus(c.prevFocus),delete c.isCancellation,c.wasCancelled=!0}},e.prototype._bindEvents=function(){var a=this,b=this._name;this._mouseEvent=function(b){a._isEnable&&1===b.which&&a._mouseHandler.call(a,b)},this._keyboardEvent=function(b){a.options.get("keyboard")&&a._isEnable&&a._keyHandler.call(a,b)},this._selectstartEvent=function(){return a.options.get("textSelection")?void 0:!1},this._mousemoveEvent=g(function(b){a._isEnable&&a.options&&a.options.get("focusOnHover")&&a._mousemoveHandler.call(a,b)},20),j.on("keydown."+b,this._keyboardEvent),j.on("keyup."+b,this._keyboardEvent),j.on("mousemove."+b,this._mousemoveEvent),j.on("click."+b,this._mouseEvent),j.on("mousedown."+b,this._mouseEvent),j.on("mouseup."+b,this._mouseEvent),this.$el.on("selectstart."+b,this._selectstartEvent)},e.prototype._unbindEvents=function(){var a=this._name;j.off("keydown."+a,this._keyboardEvent),j.off("keyup."+a,this._keyboardEvent),j.off("mousemove."+a,this._mousemoveEvent),j.off("click."+a,this._mouseEvent),j.off("mousedown."+a,this._mouseEvent),j.off("mouseup."+a,this._mouseEvent),this.$el.off("selectstart."+a,this._selectstartEvent)},e.prototype._getTarget=function(c){for(var d,e,f,g=c.target,h=this.options.get("handle");null!==g&&g!==this.el;)d=a(g),d.context=b.document,d.is(this._itemsSelector)&&(e=g),h&&d.is(h)&&(f=g),g=g.parentNode;return h&&g&&f?e:!h&&g?e:null},e.prototype._getItems=function(c,d,e){var f;switch(d){case"next":case"prev":for(var g=e.jquery?e:a(e),h=a.fn[d];;){if(g=h.call(g),0===g.length)break;if(g.context=b.document,g.is(this._itemsSelector))return g}return null;case"pageup":case"pagedown":return this._getNextPageElem(c,d,e);case"first":return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f.first();case"last":return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f.last();default:return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f}},e.prototype._getNextPageElem=function(c,d,e){var g,h,i,j,k,l=c.isShiftPageRange,m=this._scrolledElem||this.el,n=m.clientHeight,o=a(b)[f](),p=a(e),q=n>o,r=q?o:n,s=p[f](),t=s,u=s,v="pageup"===d?"prev":"next";for(l&&(v="pageup"===d?-1:1,j=this._getItems(c),c.rangeStart=i=j.index(e));;){if(l?(i+=v,k=i>=0?j.eq(i):null,g=k&&k.length>0?k:null):g=this._getItems(c,v,p),!g&&p[0]===e)break;if(!g)return l&&(c.rangeEnd=i-v),p;if(h=g[f](),u+=h,u>r)return t+h>r?(l&&(c.rangeEnd=i),g):(l&&(c.rangeEnd=i-v),p);t=h,p=g}return null},e.prototype._trigger=function(a,b,c){var d,e=this.options.get(a);if(e){if("create"===a||"destroy"===a)return e.call(this.$el);switch(d={},c.target&&(d.target=c.target),this.ui.focus&&(d.focus=this.ui.focus),a){case"select":d.items=c.selected;break;case"unselectAll":case"unselect":d.items=c.unselected;break;case"stop":c.wasCancelled||(d.items=c.changedItems)}e.call(this.$el,b||null,d)}},e.prototype._controller=function(a,b){var d;return b.changedItems=[],b.prevItemsStates=[],delete this._isPrevented,this._trigger("before",a,b),this._isPrevented?(this._cancel(a,b),void this._stop(a,b)):(b.wasSelected=this._selected>0,b.target&&b.isTargetWasSelected===c&&(b.isTargetWasSelected=this._getIsSelected(b.target)),b.isRangeSelect&&b.isTargetWasSelected&&b.target===this.ui.focus||(b.isRangeSelect?this._perfomRangeSelect(a,b):b.isMultiSelect?(d=b.isTargetWasSelected?this._unselect:this._select,d.call(this,a,b,b.items)):b.target&&!b.items&&"mouseover"===a.type||(b.target&&b.items?(this._selected&&1===this._selected&&this._getIsSelected(this.ui.focus)?this._unselect(a,b,this.ui.focus,b.isTargetWasSelected):this._selected&&this._unselectAll(a,b),this._select(a,b,b.items,b.isTargetWasSelected)):!b.target&&this._selected>0&&this.options.get("selectionBlur")&&this._unselectAll(a,b))),!this._selected&&b.wasSelected&&this._trigger("unselectAll",a,b),b.prevFocus=this.ui.focus?this.ui.focus:null,!b.target&&this.options.get("focusBlur")?this._blur(a,b):b.target&&!b.wasCancelled&&this._setFocus(b.target),void this._stop(a,b))},e.prototype._perfomRangeSelect=function(a,b){var c,d,e,f,g,h,i,j=b.rangeStart=0?(e=j?b.rangeStart+e:b.rangeEnd+e,f=e0&&this._unselect(a,b,d)),(i&&!g||h&&!f)&&(d=i?k.slice(l,e):k.slice(e+1,m+1),d.length>0&&this._select(a,b,d))):(c=b.isTargetWasSelected?this._unselect:this._select,c.call(this,a,b,b.items))},e.prototype._changeItemsStates=function(b,c,d){var e=c>0,f=[],g=this;a(b).each(function(b,h){var i=g._getIsSelected(h),j=e?!i:i,k=h===d.target&&d.isTargetWasSelected;(!k||e||d.isMultiSelect||d.isRangeSelect)&&(j&&(d.isCancellation||(f.push(h),d.prevItemsStates.push(i)),g._selected+=c),a(h).toggleClass(g.options.get("selectedClass"),e))}),d.isCancellation||(d[e?"selected":"unselected"]=a(f),d.changedItems=d.changedItems.concat(f))},e.prototype._select=function(a,b,c,d){this._changeItemsStates(c,1,b),d||this._trigger("select",a,b),this._isPrevented&&!b.isCancellation&&this._cancel(a,b)},e.prototype._unselect=function(a,b,c,d){this._changeItemsStates(c,-1,b),d||this._trigger("unselect",a,b),this._isPrevented&&!b.isCancellation&&this._cancel(a,b)},e.prototype._unselectAll=function(a,b){var c,d;this._selected&&0!==this._selected&&(d=this._getItems(b),c=b.target&&b.isTargetWasSelected&&1===this._selected,this._unselect(a,b,d,c))},e.prototype._multiSelect=function(b){return b.isMultiSelect=!0,a(b.target)},e.prototype._rangeSelect=function(b){if(b.isRangeSelect=!0,b.target===this.ui.focus)return a(b.target);var c=b.allItems?b.allItems:this._getItems(b),d=c.index(b.target),e=c.index(this.ui.focus),f=e>d?c.slice(d,e):c.slice(e,d);return f.push(e>d?c[e]:c[d]),b.allItems=c,b.rangeStart=e,b.rangeEnd=d,f},e.prototype._getIsSelected=function(b){var c=this.options.get();return a(b).length<=1?a(b).hasClass(c.selectedClass):a.map(a(b),function(b){return a(b).hasClass(c.selectedClass)})},e.prototype._blur=function(b,c,d){!d&&this.ui.focus&&this._trigger("focusLost",b,c),this.ui.focus&&(a(this.ui.focus).removeClass(this.options.get("focusClass")),delete this.ui.focus)},e.prototype._setFocus=function(b){return b?(this.ui.focus&&a(this.ui.focus).removeClass(this.options.get("focusClass")),this.ui.focus=b,a(this.ui.focus).addClass(this.options.get("focusClass")),this.ui.focus):void 0},e.prototype._stop=function(a,b){this._trigger("stop",a,b),this._isPrevented&&this._cancel(a,b)},e.prototype._checkIfElem=function(b){var c;return b&&(b.jquery||b.zepto||b.nodeType)?(b=b.jquery||b.zepto?b:a(b),c=b.filter(this._itemsSelector),c.length>0?c:null):!1},e.prototype._checkIfSelector=function(a){var b;return a&&"string"==typeof a?(b=this.$el.find(a).filter(this._itemsSelector),b.jquery&&b.length>0?b:null):!1},e.prototype._keyHandler=function(b){if(this.options.get("keyboard")&&!(this.options.get("preventInputs")&&"INPUT"===b.target.tagName||"TEXTAREA"===b.target.tagName)){var c,d,f,g,h=b.which,i={};if("keyup"===b.type)return void(h===e.keyCode.SHIFT&&(delete this._shiftModeAction,delete this._keyModes.shift));if(h===e.keyCode.A&&this._isMulti(b)&&this.options.get("multi"))c=this._getItems(i),d=!0;else switch(h){case e.keyCode.DOWN:f="next",c=this._findNextTarget("next",i);break;case e.keyCode.UP:f="prev",c=this._findNextTarget("prev",i);break;case e.keyCode.HOME:f="prev",c=this._getItems(i,"first");break;case e.keyCode.END:f="next",c=this._getItems(i,"last");break;case e.keyCode.PAGE_DOWN:case e.keyCode.PAGE_UP:var j=h===e.keyCode.PAGE_DOWN;f=j?"next":"prev",g=j?"pagedown":"pageup",i.isShiftPageRange=this.options.get("multi")&&b.shiftKey&&!d,c=this._findNextTarget(g,i);break;case e.keyCode.SPACE:c=a(this.ui.focus);break;case e.keyCode.ENTER:this.options.get("multi")||(c=a(this.ui.focus))}c&&c.length>0?(b.preventDefault(),i.target=c[0],i.items=c,"toggle"===this.options.get("keyboardMode")?(h===e.keyCode.SPACE||h===e.keyCode.ENTER&&!this.options.get("multi")||delete i.items,this.options.get("multi")&&(i.isMultiSelect=!0),delete this.ui.solidInitialElem):this.ui.focus&&this.options.get("multi")&&b.shiftKey&&!d?(h===e.keyCode.END||h===e.keyCode.HOME||h===e.keyCode.PAGE_UP||h===e.keyCode.PAGE_DOWN?this._rangeVariator(i):this._multiVariator(i,h,f,c),this.ui.solidInitialElem||i.target===this.ui.focus||(this.ui.solidInitialElem=this.ui.focus,i.isNewSolidSelection=!0),this._shiftModeAction||(this._shiftModeAction="select"),this._keyModes.shift||(this._keyModes.shift=h)):delete this.ui.solidInitialElem,this._controller(b,i),this.scroll()):(i.prevItemsStates=[],this._trigger("before",b,i),this._trigger("stop",b,i))}},e.prototype._rangeVariator=function(a){var b=void 0===a.isFocusSelected?this._getIsSelected(this.ui.focus):a.isFocusSelected,c=a.isTargetWasSelected=this._getIsSelected(a.target);b||c?(a.items=this._rangeSelect(a),c&&(a.items=a.rangeStart0;)e=a.items,a.items=this._getItems(a,c,a.items);a.target=a.items?a.items:e}else g&&f&&!i?(this._keyModes.shift=this._shiftModeAction=null,a.items=this.ui.focus):f&&g?(a.items=this.ui.focus,this._shiftModeAction||(this._shiftModeAction="unselect")):f||(a.target=a.items=this.ui.focus);a.isMultiSelect=!0},e.prototype._findNextTarget=function(a,b){var c="next"===a||"pagedown"===a?"first":"last",d=this.ui.focus?this._getItems(b,a,this.ui.focus):this._getItems(b,c);return null!==d&&0!==d.length||!this.options.get("loop")||(d=this._getItems(b,c)),d},e.prototype._refreshBoxScroll=function(c){var d=a(c),e=c===b,g=e?d[f]():c.clientHeight,h=d.scrollTop(),i=e?0:d.offset().top,j=a(this.ui.focus),k=j[f](),l=e?j.offset().top:j.offset().top-i+h;h>l?d.scrollTop(l):l+k>h+g&&d.scrollTop(l+k-g)},e.prototype._isRange=function(a){return a.shiftKey||a.shiftKey&&a.ctrlKey||a.shiftKey&&a.metaKey},e.prototype._isMulti=function(a){return a.ctrlKey||a.metaKey},e.prototype._mouseHandler=function(b){var c=this.options.get(),d=b.type,e=this._isMulti(b),f=this._isRange(b),g={};if("mouseup"===c.mouseMode){if(g.target=this._getTarget(b),"click"===d||g.target&&"mousedown"===d)return}else{if("click"===d&&!this._mousedownOnItem)return;if("mousedown"!==d&&"click"!==d)return;if(g.target=this._getTarget(b),"mousedown"===d&&g.target&&(!c.multi||!e&&!f||"standard"!==c.mouseMode))return void(this._mousedownOnItem=g.target);delete this._mousedownOnItem}c.multi&&g.target&&(f&&this.ui.focus?g.items=this._rangeSelect(g):(e||"toggle"===c.mouseMode)&&(g.items=this._multiSelect(g))),g.target&&!g.items&&(g.items=a(g.target)),delete this.ui.solidInitialElem,this._controller(b,g)},e.prototype._mousemoveHandler=function(a){if(!this._isFocusOnHoverPrevented){var b={},c=this._getTarget(a);c?(delete this.ui.solidInitialElem,this._isHovered=!0,c!==this.ui.focus&&(b.target=c,this._controller(a,b))):this._isHovered&&(this._isHovered=!1,this._controller(a,b))}},e.prototype._preventMouseMove=function(){var a=this;this._isFocusOnHoverPrevented=!0,this._focusHoverTimeout&&(clearTimeout(this._focusHoverTimeout),delete this._focusHoverTimeout),this._focusHoverTimeout=setTimeout(function(){delete a._isFocusOnHoverPrevented,delete a._focusHoverTimeout},250)},e._callPublicMethod=function(b){var c,d,f=e.getDataObject(this);if(null===f||void 0===f)throw new Error("Element "+this[0]+" has no plugin "+e.pluginName);if(f[b]&&a.isFunction(f[b])&&(c=f[b]),c&&a.isFunction(c)&&"_"!==b.charAt(0))return d=Array.prototype.slice.call(arguments),d.shift(),c.apply(f,d);throw new Error('Plugin "'+e.pluginName+'" has no method "'+b+'"')},e.prototype.isEnabled=function(){return this._isEnable},e.prototype.option=function(b,c){var d=arguments.length;if(d>0&&"string"==typeof b){if(d>1){var e={};return e[b]=c,this.options.set(e),this.$el}return this.options.get(b)}if(d>0&&a.isPlainObject(b))return this.options.set(b),this.$el;if(0===d)return this.options.get();throw new Error('Format of "option" could be: "option" or "option","name" or "option","name",val or "option",{}')},e.prototype.destroy=function(){this._trigger("destroy"),this._unbindEvents(),this._focusHoverTimeout&&clearTimeout(this._focusHoverTimeout),this.ui.focus&&(a(this.ui.focus).removeClass(this.options.get("focusClass")),delete this.ui.focus),this._selected>0&&this.getSelected().removeClass(this.options.get("selectedClass")),this.$el.removeClass(this.options.get("disabledClass")),this.$el.removeClass(this.options.get("listClass")),this.options.off(),delete this.options,delete this._scrolledElem,delete this.ui.solidInitialElem,this.$el.removeData("plugin_"+e.pluginName),this.$el=null},e.prototype.unselect=function(a){return this.select(a,!0)},e.prototype.select=function(b,c){var d,e;if(c===!0&&void 0===b)e={isTargetWasSelected:!0,isMultiSelect:!0},e.items=this._getItems(e);else{if(d=this._checkIfElem(b),d===!1&&(d=this._checkIfSelector(b)),d===!1)throw new Error('You shold pass DOM element or selector to "select" method.');e={items:d.addClass?d:a(d),isTargetWasSelected:c?!0:!1,isMultiSelect:!0}}return delete this.ui.solidInitialElem,this._controller(null,e),this.$el},e.prototype.blur=function(){return this._controller(null,{target:null}),this.$el},e.prototype.getSelected=function(a){var b,c=this._getItems({}).filter("."+this.options.get("selectedClass"));if(a){b=[];for(var d=0;d0?b:null}return c},e.prototype.getSelectedId=function(){return this.getSelected(!0)},e.prototype.focus=function(a){var b;if(arguments.length>0){if(b=(b=this._checkIfElem(a))===!1?this._checkIfSelector(a):b,b&&(b.jquery||b.zepto))this._setFocus(b[0]);else if(b===!1)throw new Error("You shold pass DOM element or CSS selector to set focus or nothing to get it.");return this.$el}return this.ui.focus?this.ui.focus:null},e.prototype.scroll=function(){this._preventMouseMove(),this.ui.focus&&(this._scrolledElem&&this._refreshBoxScroll(this._scrolledElem),this._refreshBoxScroll(b))},e.prototype.enable=function(){return this._isEnable=!0,this.$el.removeClass(this.options.get("disabledClass")),this.$el},e.prototype.disable=function(){return this._isEnable=!1,this._isHovered=!1,this.$el.addClass(this.options.get("disabledClass")),this.$el},e.prototype.cancel=function(){return this._isPrevented=!0,this.$el},e.prototype.refresh=function(){var b=this.ui.focus;return b&&!a(b).is(":visible")&&delete this.ui.focus,this._selected=this.getSelected().length,this.$el},a.fn[e.pluginName]=function(a){return a&&a.charAt?e._callPublicMethod.apply(this,arguments):this.each(function(b,c){e.getDataObject(c)||new e(c,a)})},a.fn[e.pluginName].defaults=k,b["_"+e.pluginName]=e}(window.jQuery||window.Zepto,window); +!function(a,b,c){"use strict";function d(b,c,d){return this._schema=b,this._options={},this._callbacks={},this.set(a.extend({},c,d||{}),!0),this}function e(b,c){this._name=e.pluginName,this.el=b,this.$el=a(b),this.ui={},this._selected=0,this._isEnable=!0,this._keyModes={},this.options=new d(l,k,c);var f=this;this.options.on("filter",function(a){return f._itemsSelector="."+f.options.get("listClass")+" "+a,a}),this.options.on("autoScroll",function(a){return f._setScrolledElem(a),a}),this._itemsSelector="."+this.options.get("listClass")+" "+this.options.get("filter"),this._setScrolledElem(this.options.get("autoScroll")),this._init()}var f=a.fn.outerHeight?"outerHeight":"height";a.fn.jquery||a.fn.zepto||(a.fn.zepto=!0);var g=function(a,b,c){var d,e,f,g=null,h=0;c=c||{};var i=function(){h=c.leading===!1?0:new Date,g=null,f=a.apply(d,e)};return function(){var j=new Date;h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k?(clearTimeout(g),g=null,h=j,f=a.apply(d,e)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},h=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},i=function(a,b){return a instanceof Array?h.call(a,b)>=0:!1},j=a(b.document);d.isCorrectType=function(a,b){var c=typeof a,d=null===a&&b.nullable;return b.type instanceof Array?i(b.type,c)||d:c===b.type||d},d.prototype.set=function(b,e){var f,g;for(f in b){var h=b[f],j=this._schema[f];if(j!==c){if(j.unchangeable&&!e)throw new Error('Option "'+f+'" could be setted once at the begining.');if(!d.isCorrectType(h,j)){var k='Option "'+f+'" must be '+(j.type instanceof Array?j.type.join(", "):j.type)+(j.nullable?" or null.":".");throw new TypeError(k)}if(j.values&&!i(j.values,h))throw new RangeError('Option "'+f+'" only could be in these values: "'+j.values.join('", "')+'".')}}for(f in b)(g=this._callbacks[f])&&(b[f]=g.call(this,b[f]));this._options=a.extend(this._options,b)},d.prototype.get=function(b){return b?this._options[b]:a.extend({},this._options)},d.prototype.on=function(a,b){this._callbacks[a]=b},d.prototype.off=function(a){this._callbacks[a]&&delete this._callbacks[a]};var k={filter:"> *",multi:!0,mouseMode:"standard",focusBlur:!1,selectionBlur:!1,handle:null,textSelection:!1,focusOnHover:!1,keyboard:!1,keyboardMode:"select",autoScroll:!0,loop:!1,preventInputs:!0,listClass:"j-selectable",focusClass:"j-focused",selectedClass:"j-selected",disabledClass:"j-disabled",create:null,before:null,focusLost:null,select:null,unselect:null,unselectAll:null,stop:null,destroy:null},l={filter:{type:"string"},multi:{type:"boolean"},mouseMode:{type:"string",values:["standard","mouseup","toggle"]},focusBlur:{type:"boolean"},selectionBlur:{type:"boolean"},handle:{type:"string",nullable:!0},textSelection:{type:"boolean"},focusOnHover:{type:"boolean"},keyboard:{type:"boolean"},keyboardMode:{type:"string",values:["select","toggle"]},autoScroll:{type:["boolean","string"]},loop:{type:"boolean"},preventInputs:{type:"boolean"},listClass:{type:"string",unchangeable:!0},focusClass:{type:"string",unchangeable:!0},selectedClass:{type:"string",unchangeable:!0},disabledClass:{type:"string",unchangeable:!0},create:{type:"function",nullable:!0},before:{type:"function",nullable:!0},focusLost:{type:"function",nullable:!0},select:{type:"function",nullable:!0},unselect:{type:"function",nullable:!0},unselectAll:{type:"function",nullable:!0},stop:{type:"function",nullable:!0},destroy:{type:"function",nullable:!0}};e.pluginName="selectonic",e.keyCode={DOWN:40,UP:38,SHIFT:16,END:35,HOME:36,PAGE_DOWN:34,PAGE_UP:33,A:65,SPACE:32,ENTER:13},e.getDataObject=function(b){return a(b).data("plugin_"+e.pluginName)},e.prototype._init=function(){this.$el.addClass(this.options.get("listClass")),this._bindEvents(),this.$el.data("plugin_"+e.pluginName,this),this._trigger("create")},e.prototype._setScrolledElem=function(b){var c;if(null===b||!1===b)return void delete this._scrolledElem;if("string"==typeof b){if(c=a(b),!(c.length>0))throw new Error('There are no elements that matches to selector - "'+b+'"');return void(this._scrolledElem=c[0])}this._scrolledElem=this.el},e.prototype._cancel=function(b,c){if(!c.wasCancelled){c.isCancellation=this._isPrevented=!0;var d=this;a.each(a(c.changedItems),function(e,f){c.prevItemsStates[e]?d._select(b,c,a(f),!0):d._unselect(b,c,a(f),!0)}),c.prevFocus&&this._setFocus(c.prevFocus),delete c.isCancellation,c.wasCancelled=!0}},e.prototype._bindEvents=function(){var a=this,b=this._name;this._mouseEvent=function(b){a._isEnable&&1===b.which&&a._mouseHandler.call(a,b)},this._keyboardEvent=function(b){a.options.get("keyboard")&&a._isEnable&&a._keyHandler.call(a,b)},this._selectstartEvent=function(){return a.options.get("textSelection")?void 0:!1},this._mousemoveEvent=g(function(b){a._isEnable&&a.options&&a.options.get("focusOnHover")&&a._mousemoveHandler.call(a,b)},20),j.on("keydown."+b,this._keyboardEvent),j.on("keyup."+b,this._keyboardEvent),j.on("mousemove."+b,this._mousemoveEvent),j.on("click."+b,this._mouseEvent),j.on("mousedown."+b,this._mouseEvent),j.on("mouseup."+b,this._mouseEvent),this.$el.on("selectstart."+b,this._selectstartEvent)},e.prototype._unbindEvents=function(){var a=this._name;j.off("keydown."+a,this._keyboardEvent),j.off("keyup."+a,this._keyboardEvent),j.off("mousemove."+a,this._mousemoveEvent),j.off("click."+a,this._mouseEvent),j.off("mousedown."+a,this._mouseEvent),j.off("mouseup."+a,this._mouseEvent),this.$el.off("selectstart."+a,this._selectstartEvent)},e.prototype._getTarget=function(c){for(var d,e,f,g=c.target,h=this.options.get("handle");null!==g&&g!==this.el;)d=a(g),d.context=b.document,d.is(this._itemsSelector)&&(e=g),h&&d.is(h)&&(f=g),g=g.parentNode;return h&&g&&f?e:!h&&g?e:null},e.prototype._getItems=function(c,d,e){var f;switch(d){case"next":case"prev":for(var g=e.jquery?e:a(e),h=a.fn[d];;){if(g=h.call(g),0===g.length)break;if(g.context=b.document,g.is(this._itemsSelector))return g}return null;case"pageup":case"pagedown":return this._getNextPageElem(c,d,e);case"first":return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f.first();case"last":return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f.last();default:return f=c.allItems?c.allItems:this.$el.find(this.options.get("filter")),c.allItems=f,f}},e.prototype._getNextPageElem=function(c,d,e){var g,h,i,j,k,l=c.isShiftPageRange,m=this._scrolledElem||this.el,n=m.clientHeight,o=a(b)[f](),p=a(e),q=n>o,r=q?o:n,s=p[f](),t=s,u=s,v="pageup"===d?"prev":"next";for(l&&(v="pageup"===d?-1:1,j=this._getItems(c),c.rangeStart=i=j.index(e));;){if(l?(i+=v,k=i>=0?j.eq(i):null,g=k&&k.length>0?k:null):g=this._getItems(c,v,p),!g&&p[0]===e)break;if(!g)return l&&(c.rangeEnd=i-v),p;if(h=g[f](),u+=h,u>r)return t+h>r?(l&&(c.rangeEnd=i),g):(l&&(c.rangeEnd=i-v),p);t=h,p=g}return null},e.prototype._trigger=function(a,b,c){var d,e=this.options.get(a);if(e){if("create"===a||"destroy"===a)return e.call(this.$el);switch(d={},c.target&&(d.target=c.target),this.ui.focus&&(d.focus=this.ui.focus),a){case"select":d.items=c.selected;break;case"unselectAll":case"unselect":d.items=c.unselected;break;case"stop":c.wasCancelled||(d.items=c.changedItems)}e.call(this.$el,b||null,d)}},e.prototype._controller=function(a,b){var d;return b.changedItems=[],b.prevItemsStates=[],delete this._isPrevented,this._trigger("before",a,b),this._isPrevented?(this._cancel(a,b),void this._stop(a,b)):(b.wasSelected=this._selected>0,b.target&&b.isTargetWasSelected===c&&(b.isTargetWasSelected=this._getIsSelected(b.target)),b.isRangeSelect&&b.isTargetWasSelected&&b.target===this.ui.focus||(b.isRangeSelect?this._perfomRangeSelect(a,b):b.isMultiSelect?(d=b.isTargetWasSelected?this._unselect:this._select,d.call(this,a,b,b.items)):b.target&&!b.items&&"mouseover"===a.type||(b.target&&b.items?(this._selected&&1===this._selected&&this._getIsSelected(this.ui.focus)?this._unselect(a,b,this.ui.focus,b.isTargetWasSelected):this._selected&&this._unselectAll(a,b),this._select(a,b,b.items,b.isTargetWasSelected)):!b.target&&this._selected>0&&this.options.get("selectionBlur")&&this._unselectAll(a,b))),!this._selected&&b.wasSelected&&this._trigger("unselectAll",a,b),b.prevFocus=this.ui.focus?this.ui.focus:null,!b.target&&this.options.get("focusBlur")?this._blur(a,b):b.target&&!b.wasCancelled&&this._setFocus(b.target),void this._stop(a,b))},e.prototype._perfomRangeSelect=function(a,b){var c,d,e,f,g,h,i,j=b.rangeStart=0?(e=j?b.rangeStart+e:b.rangeEnd+e,f=e0&&this._unselect(a,b,d)),(i&&!g||h&&!f)&&(d=i?k.slice(l,e):k.slice(e+1,m+1),d.length>0&&this._select(a,b,d))):(c=b.isTargetWasSelected?this._unselect:this._select,c.call(this,a,b,b.items))},e.prototype._changeItemsStates=function(b,c,d){var e=c>0,f=[],g=this;a(b).each(function(b,h){var i=g._getIsSelected(h),j=e?!i:i,k=h===d.target&&d.isTargetWasSelected;(!k||e||d.isMultiSelect||d.isRangeSelect)&&(j&&(d.isCancellation||(f.push(h),d.prevItemsStates.push(i)),g._selected+=c),a(h).toggleClass(g.options.get("selectedClass"),e))}),d.isCancellation||(d[e?"selected":"unselected"]=a(f),d.changedItems=d.changedItems.concat(f))},e.prototype._select=function(a,b,c,d){this._changeItemsStates(c,1,b),d||this._trigger("select",a,b),this._isPrevented&&!b.isCancellation&&this._cancel(a,b)},e.prototype._unselect=function(a,b,c,d){this._changeItemsStates(c,-1,b),d||this._trigger("unselect",a,b),this._isPrevented&&!b.isCancellation&&this._cancel(a,b)},e.prototype._unselectAll=function(a,b){var c,d;this._selected&&0!==this._selected&&(d=this._getItems(b),c=b.target&&b.isTargetWasSelected&&1===this._selected,this._unselect(a,b,d,c))},e.prototype._multiSelect=function(b){return b.isMultiSelect=!0,a(b.target)},e.prototype._rangeSelect=function(b){if(b.isRangeSelect=!0,b.target===this.ui.focus)return a(b.target);var c=b.allItems?b.allItems:this._getItems(b),d=c.index(b.target),e=c.index(this.ui.focus),f=e>d?c.slice(d,e):c.slice(e,d);return f.push(e>d?c[e]:c[d]),b.allItems=c,b.rangeStart=e,b.rangeEnd=d,f},e.prototype._getIsSelected=function(b){var c=this.options.get();return a(b).length<=1?a(b).hasClass(c.selectedClass):a.map(a(b),function(b){return a(b).hasClass(c.selectedClass)})},e.prototype._blur=function(b,c,d){!d&&this.ui.focus&&this._trigger("focusLost",b,c),this.ui.focus&&(a(this.ui.focus).removeClass(this.options.get("focusClass")),delete this.ui.focus)},e.prototype._setFocus=function(b){return b?(this.ui.focus&&a(this.ui.focus).removeClass(this.options.get("focusClass")),this.ui.focus=b,a(this.ui.focus).addClass(this.options.get("focusClass")),this.ui.focus):void 0},e.prototype._stop=function(a,b){this._trigger("stop",a,b),this._isPrevented&&this._cancel(a,b)},e.prototype._checkIfElem=function(b){var c;return b&&(b.jquery||b.zepto||b.nodeType)?(b=b.jquery||b.zepto?b:a(b),c=b.filter(this._itemsSelector),c.length>0?c:null):!1},e.prototype._checkIfSelector=function(a){var b;return a&&"string"==typeof a?(b=this.$el.find(a).filter(this._itemsSelector),b.jquery&&b.length>0?b:null):!1},e.prototype._keyHandler=function(b){if(this.options.get("keyboard")&&!(this.options.get("preventInputs")&&"INPUT"===b.target.tagName||"TEXTAREA"===b.target.tagName)){var c,d,f,g,h=b.which,i={};if("keyup"===b.type)return void(h===e.keyCode.SHIFT&&(delete this._shiftModeAction,delete this._keyModes.shift));if(h===e.keyCode.A&&this._isMulti(b)&&this.options.get("multi"))c=this._getItems(i),d=!0;else switch(h){case e.keyCode.DOWN:f="next",c=this._findNextTarget("next",i);break;case e.keyCode.UP:f="prev",c=this._findNextTarget("prev",i);break;case e.keyCode.HOME:f="prev",c=this._getItems(i,"first");break;case e.keyCode.END:f="next",c=this._getItems(i,"last");break;case e.keyCode.PAGE_DOWN:case e.keyCode.PAGE_UP:var j=h===e.keyCode.PAGE_DOWN;f=j?"next":"prev",g=j?"pagedown":"pageup",i.isShiftPageRange=this.options.get("multi")&&b.shiftKey&&!d,c=this._findNextTarget(g,i);break;case e.keyCode.SPACE:c=a(this.ui.focus);break;case e.keyCode.ENTER:this.options.get("multi")||(c=a(this.ui.focus))}c&&c.length>0?(b.preventDefault(),i.target=c[0],i.items=c,"toggle"===this.options.get("keyboardMode")?(h===e.keyCode.SPACE||h===e.keyCode.ENTER&&!this.options.get("multi")||delete i.items,this.options.get("multi")&&(i.isMultiSelect=!0),delete this.ui.solidInitialElem):this.ui.focus&&this.options.get("multi")&&b.shiftKey&&!d?(h===e.keyCode.END||h===e.keyCode.HOME||h===e.keyCode.PAGE_UP||h===e.keyCode.PAGE_DOWN?this._rangeVariator(i):this._multiVariator(i,h,f,c),this.ui.solidInitialElem||i.target===this.ui.focus||(this.ui.solidInitialElem=this.ui.focus,i.isNewSolidSelection=!0),this._shiftModeAction||(this._shiftModeAction="select"),this._keyModes.shift||(this._keyModes.shift=h)):delete this.ui.solidInitialElem,this._controller(b,i),this.scroll()):(i.prevItemsStates=[],this._trigger("before",b,i),this._trigger("stop",b,i))}},e.prototype._rangeVariator=function(a){var b=void 0===a.isFocusSelected?this._getIsSelected(this.ui.focus):a.isFocusSelected,c=a.isTargetWasSelected=this._getIsSelected(a.target);b||c?(a.items=this._rangeSelect(a),c&&(a.items=a.rangeStart0;)e=a.items,a.items=this._getItems(a,c,a.items);a.target=a.items?a.items:e}else g&&f&&!i?(this._keyModes.shift=this._shiftModeAction=null,a.items=this.ui.focus):f&&g?(a.items=this.ui.focus,this._shiftModeAction||(this._shiftModeAction="unselect")):f||(a.target=a.items=this.ui.focus);a.isMultiSelect=!0},e.prototype._findNextTarget=function(a,b){var c="next"===a||"pagedown"===a?"first":"last",d=this.ui.focus?this._getItems(b,a,this.ui.focus):this._getItems(b,c);return null!==d&&0!==d.length||!this.options.get("loop")||(d=this._getItems(b,c)),d},e.prototype._refreshBoxScroll=function(c){var d=a(c),e=c===b,g=e?d[f]():c.clientHeight,h=d.scrollTop(),i=e?0:d.offset().top,j=a(this.ui.focus),k=j[f](),l=e?j.offset().top:j.offset().top-i+h;h>l?d.scrollTop(l):l+k>h+g&&d.scrollTop(l+k-g)},e.prototype._isRange=function(a){return a.shiftKey||a.shiftKey&&a.ctrlKey||a.shiftKey&&a.metaKey},e.prototype._isMulti=function(a){return a.ctrlKey||a.metaKey},e.prototype._mouseHandler=function(b){var c=this.options.get(),d=b.type,e=this._isMulti(b),f=this._isRange(b),g={};if("mouseup"===c.mouseMode){if(g.target=this._getTarget(b),"click"===d||g.target&&"mousedown"===d)return}else{if("click"===d&&!this._mousedownOnItem)return;if("mousedown"!==d&&"click"!==d)return;if(g.target=this._getTarget(b),"mousedown"===d&&g.target&&(!c.multi||!e&&!f||"standard"!==c.mouseMode))return void(this._mousedownOnItem=g.target);if(delete this._mousedownOnItem,!g.target&&"click"===d)return}c.multi&&g.target&&(f&&this.ui.focus?g.items=this._rangeSelect(g):(e||"toggle"===c.mouseMode)&&(g.items=this._multiSelect(g))),g.target&&!g.items&&(g.items=a(g.target)),delete this.ui.solidInitialElem,this._controller(b,g)},e.prototype._mousemoveHandler=function(a){if(!this._isFocusOnHoverPrevented){var b={},c=this._getTarget(a);c?(delete this.ui.solidInitialElem,this._isHovered=!0,c!==this.ui.focus&&(b.target=c,this._controller(a,b))):this._isHovered&&(this._isHovered=!1,this._controller(a,b))}},e.prototype._preventMouseMove=function(){var a=this;this._isFocusOnHoverPrevented=!0,this._focusHoverTimeout&&(clearTimeout(this._focusHoverTimeout),delete this._focusHoverTimeout),this._focusHoverTimeout=setTimeout(function(){delete a._isFocusOnHoverPrevented,delete a._focusHoverTimeout},250)},e._callPublicMethod=function(b){var c,d,f=e.getDataObject(this);if(null===f||void 0===f)throw new Error("Element "+this[0]+" has no plugin "+e.pluginName);if(f[b]&&a.isFunction(f[b])&&(c=f[b]),c&&a.isFunction(c)&&"_"!==b.charAt(0))return d=Array.prototype.slice.call(arguments),d.shift(),c.apply(f,d);throw new Error('Plugin "'+e.pluginName+'" has no method "'+b+'"')},e.prototype.isEnabled=function(){return this._isEnable},e.prototype.option=function(b,c){var d=arguments.length;if(d>0&&"string"==typeof b){if(d>1){var e={};return e[b]=c,this.options.set(e),this.$el}return this.options.get(b)}if(d>0&&a.isPlainObject(b))return this.options.set(b),this.$el;if(0===d)return this.options.get();throw new Error('Format of "option" could be: "option" or "option","name" or "option","name",val or "option",{}')},e.prototype.destroy=function(){this._trigger("destroy"),this._unbindEvents(),this._focusHoverTimeout&&clearTimeout(this._focusHoverTimeout),this.ui.focus&&(a(this.ui.focus).removeClass(this.options.get("focusClass")),delete this.ui.focus),this._selected>0&&this.getSelected().removeClass(this.options.get("selectedClass")),this.$el.removeClass(this.options.get("disabledClass")),this.$el.removeClass(this.options.get("listClass")),this.options.off(),delete this.options,delete this._scrolledElem,delete this.ui.solidInitialElem,this.$el.removeData("plugin_"+e.pluginName),this.$el=null},e.prototype.unselect=function(a){return this.select(a,!0)},e.prototype.select=function(b,c){var d,e;if(c===!0&&void 0===b)e={isTargetWasSelected:!0,isMultiSelect:!0},e.items=this._getItems(e);else{if(d=this._checkIfElem(b),d===!1&&(d=this._checkIfSelector(b)),d===!1)throw new Error('You shold pass DOM element or selector to "select" method.');e={items:d.addClass?d:a(d),isTargetWasSelected:c?!0:!1,isMultiSelect:!0}}return delete this.ui.solidInitialElem,this._controller(null,e),this.$el},e.prototype.blur=function(){return this._controller(null,{target:null}),this.$el},e.prototype.getSelected=function(a){var b,c=this._getItems({}).filter("."+this.options.get("selectedClass"));if(a){b=[];for(var d=0;d0?b:null}return c},e.prototype.getSelectedId=function(){return this.getSelected(!0)},e.prototype.focus=function(a){var b;if(arguments.length>0){if(b=(b=this._checkIfElem(a))===!1?this._checkIfSelector(a):b,b&&(b.jquery||b.zepto))this._setFocus(b[0]);else if(b===!1)throw new Error("You shold pass DOM element or CSS selector to set focus or nothing to get it.");return this.$el}return this.ui.focus?this.ui.focus:null},e.prototype.scroll=function(){this._preventMouseMove(),this.ui.focus&&(this._scrolledElem&&this._refreshBoxScroll(this._scrolledElem),this._refreshBoxScroll(b))},e.prototype.enable=function(){return this._isEnable=!0,this.$el.removeClass(this.options.get("disabledClass")),this.$el},e.prototype.disable=function(){return this._isEnable=!1,this._isHovered=!1,this.$el.addClass(this.options.get("disabledClass")),this.$el},e.prototype.cancel=function(){return this._isPrevented=!0,this.$el},e.prototype.refresh=function(){var b=this.ui.focus;return b&&!a(b).is(":visible")&&delete this.ui.focus,this._selected=this.getSelected().length,this.$el},a.fn[e.pluginName]=function(a){return a&&a.charAt?e._callPublicMethod.apply(this,arguments):this.each(function(b,c){e.getDataObject(c)||new e(c,a)})},a.fn[e.pluginName].defaults=k,b["_"+e.pluginName]=e}(window.jQuery||window.Zepto,window); //# sourceMappingURL=selectonic.min.map \ No newline at end of file diff --git a/dist/selectonic.min.map b/dist/selectonic.min.map index 09d5ddb..9299ad4 100644 --- a/dist/selectonic.min.map +++ b/dist/selectonic.min.map @@ -1 +1 @@ -{"version":3,"file":"selectonic.min.js","sources":["selectonic.js"],"names":["$","window","undefined","Options","schema","defaults","initial","this","_schema","_options","_callbacks","set","extend","Plugin","element","options","_name","pluginName","el","$el","ui","_selected","_isEnable","_keyModes","_this","on","value","_itemsSelector","get","_setScrolledElem","_init","outerHeight","fn","jquery","zepto","_throttle","func","wait","context","args","result","timeout","previous","later","leading","Date","apply","now","remaining","arguments","clearTimeout","trailing","setTimeout","__indexOf","Array","prototype","indexOf","item","i","l","length","itContains","array","elem","call","$document","document","isCorrectType","val","type","isNullable","nullable","obj","isNew","option","callback","unchangeable","Error","msg","join","TypeError","values","RangeError","opt","cb","off","filter","multi","mouseMode","focusBlur","selectionBlur","handle","textSelection","focusOnHover","keyboard","keyboardMode","autoScroll","loop","preventInputs","listClass","focusClass","selectedClass","disabledClass","create","before","focusLost","select","unselect","unselectAll","stop","destroy","keyCode","DOWN","UP","SHIFT","END","HOME","PAGE_DOWN","PAGE_UP","A","SPACE","ENTER","getDataObject","data","addClass","_bindEvents","_trigger","selector","_scrolledElem","_cancel","e","params","wasCancelled","isCancellation","_isPrevented","each","changedItems","index","prevItemsStates","_select","_unselect","prevFocus","_setFocus","name","_mouseEvent","which","_mouseHandler","_keyboardEvent","_keyHandler","_selectstartEvent","_mousemoveEvent","_mousemoveHandler","_unbindEvents","_getTarget","$elem","target","handleElem","is","parentNode","_getItems","items","find","_getNextPageElem","allItems","first","last","$candidate","candHeight","currentIndex","cand","_isOptimized","isShiftPageRange","box","boxViewHeight","clientHeight","winViewHeight","$current","isBoxBigger","pageHeight","itemHeight","currentHeight","itemsHeight","direction","rangeStart","eq","rangeEnd","event","focus","selected","unselected","_controller","method","_stop","wasSelected","isTargetWasSelected","_getIsSelected","isRangeSelect","_perfomRangeSelect","isMultiSelect","_unselectAll","_blur","beforeStart","afterStart","beforeEnd","afterEnd","endAfterStart","top","bot","isNewSolidSelection","slice","add","solidInitialElem","_changeItemsStates","delta","aboveZero","isSelected","selectedCondition","isSelectedTarget","push","toggleClass","concat","silent","isOnlyTargetSelected","_multiSelect","_rangeSelect","arr","x","y","subArr","hasClass","map","removeClass","_checkIfElem","res","nodeType","_checkIfSelector","tagName","isAllSelect","page","key","_shiftModeAction","shift","_isMulti","_findNextTarget","isDown","shiftKey","preventDefault","_rangeVariator","_multiVariator","scroll","isFocusSelected","isTargetSelected","prevItem","afterTarget","isSelectedAfterTarget","edge","_refreshBoxScroll","$box","isWindow","boxScrollTop","scrollTop","boxWindowY","offset","$item","itemBoxTop","_isRange","ctrlKey","metaKey","isMulti","isRange","_mousedownOnItem","_isFocusOnHoverPrevented","_isHovered","_preventMouseMove","_focusHoverTimeout","_callPublicMethod","publicMethod","isFunction","charAt","isEnabled","isPlainObject","getSelected","removeData","revert","blur","getIds","id","getSelectedId","enable","disable","cancel","refresh","jQuery","Zepto"],"mappings":";;;;CAGC,SAASA,EAAGC,EAAQC,GACnB,YAsDA,SAASC,GAAUC,EAAQC,EAAUC,GAKnC,MAJAC,MAAKC,QAAaJ,EAClBG,KAAKE,YACLF,KAAKG,cACLH,KAAKI,IAAKX,EAAEY,UAAWP,EAAUC,QAAc,GACxCC,KA8HT,QAASM,GAAQC,EAASC,GACxBR,KAAKS,MAAaH,EAAOI,WACzBV,KAAKW,GAAaJ,EAClBP,KAAKY,IAAanB,EAAGc,GACrBP,KAAKa,MACLb,KAAKc,UAAa,EAClBd,KAAKe,WAAa,EAClBf,KAAKgB,aACLhB,KAAKQ,QAAa,GAAIZ,GAASC,EAAQC,EAAUU,EAEjD,IAAIS,GAAQjB,IACZA,MAAKQ,QAAQU,GAAG,SAAU,SAAUC,GAGlC,MADAF,GAAMG,eAAiB,IAAMH,EAAMT,QAAQa,IAAI,aAAe,IAAMF,EAC7DA,IAETnB,KAAKQ,QAAQU,GAAG,aAAc,SAAUC,GAEtC,MADAF,GAAMK,iBAAkBH,GACjBA,IAETnB,KAAKoB,eAAiB,IAAMpB,KAAKQ,QAAQa,IAAI,aAAe,IAAMrB,KAAKQ,QAAQa,IAAI,UACnFrB,KAAKsB,iBAAkBtB,KAAKQ,QAAQa,IAAI,eACxCrB,KAAKuB,QA5MP,GAAIC,GAAc/B,EAAEgC,GAAGD,YAAc,cAAgB,QAC/C/B,GAAEgC,GAAGC,QA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AAKY,KAQdN,EAAO0C,UAAU0O,QAAU,WAIzB,MAHA1R,MAAKe,WAAY,EACjBf,KAAKyQ,YAAa,EAClBzQ,KAAKY,IAAIyG,SAAUrH,KAAKQ,QAAQa,IAAI,kBAC7BrB,KAAKY,KAUdN,EAAO0C,UAAU2O,OAAS,WAExB,MADA3R,MAAK+H,cAAe,EACb/H,KAAKY,KAQdN,EAAO0C,UAAU4O,QAAU,WACzB,GAAIxG,GAAQpL,KAAKa,GAAGuK,KAGpB,OAFKA,KAAU3L,EAAE2L,GAAO9B,GAAG,mBAAuBtJ,MAAKa,GAAGuK,MAC1DpL,KAAKc,UAAcd,KAAKkR,cAAgB7N,OACjCrD,KAAKY,KAUdnB,EAAEgC,GAAGnB,EAAOI,YAAc,SAAUF,GAClC,MAAIA,IAAWA,EAAQuQ,OACdzQ,EAAOsQ,kBAAkBrO,MAAOvC,KAAM0C,WAExC1C,KAAKgI,KAAM,SAASwG,EAAKhL,GACxBlD,EAAO6G,cAAc3D,IAAU,GAAIlD,GAAQkD,EAAMhD,MAI3Df,EAAEgC,GAAGnB,EAAOI,YAAYZ,SAAWA,EAUnCJ,EAAQ,IAAMY,EAAOI,YAAeJ,GAMnCZ,OAAOmS,QAAUnS,OAAOoS,MAAQpS"} \ No newline at end of file +{"version":3,"file":"selectonic.min.js","sources":["selectonic.js"],"names":["$","window","undefined","Options","schema","defaults","initial","this","_schema","_options","_callbacks","set","extend","Plugin","element","options","_name","pluginName","el","$el","ui","_selected","_isEnable","_keyModes","_this","on","value","_itemsSelector","get","_setScrolledElem","_init","outerHeight","fn","jquery","zepto","_throttle","func","wait","context","args","result","timeout","previous","later","leading","Date","apply","now","remaining","arguments","clearTimeout","trailing","setTimeout","__indexOf","Array","prototype","indexOf","item","i","l","length","itContains","array","elem","call","$document","document","isCorrectType","val","type","isNullable","nullable","obj","isNew","option","callback","unchangeable","Error","msg","join","TypeError","values","RangeError","opt","cb","off","filter","multi","mouseMode","focusBlur","selectionBlur","handle","textSelection","focusOnHover","keyboard","keyboardMode","autoScroll","loop","preventInputs","listClass","focusClass","selectedClass","disabledClass","create","before","focusLost","select","unselect","unselectAll","stop","destroy","keyCode","DOWN","UP","SHIFT","END","HOME","PAGE_DOWN","PAGE_UP","A","SPACE","ENTER","getDataObject","data","addClass","_bindEvents","_trigger","selector","_scrolledElem","_cancel","e","params","wasCancelled","isCancellation","_isPrevented","each","changedItems","index","prevItemsStates","_select","_unselect","prevFocus","_setFocus","name","_mouseEvent","which","_mouseHandler","_keyboardEvent","_keyHandler","_selectstartEvent","_mousemoveEvent","_mousemoveHandler","_unbindEvents","_getTarget","$elem","target","handleElem","is","parentNode","_getItems","items","find","_getNextPageElem","allItems","first","last","$candidate","candHeight","currentIndex","cand","_isOptimized","isShiftPageRange","box","boxViewHeight","clientHeight","winViewHeight","$current","isBoxBigger","pageHeight","itemHeight","currentHeight","itemsHeight","direction","rangeStart","eq","rangeEnd","event","focus","selected","unselected","_controller","method","_stop","wasSelected","isTargetWasSelected","_getIsSelected","isRangeSelect","_perfomRangeSelect","isMultiSelect","_unselectAll","_blur","beforeStart","afterStart","beforeEnd","afterEnd","endAfterStart","top","bot","isNewSolidSelection","slice","add","solidInitialElem","_changeItemsStates","delta","aboveZero","isSelected","selectedCondition","isSelectedTarget","push","toggleClass","concat","silent","isOnlyTargetSelected","_multiSelect","_rangeSelect","arr","x","y","subArr","hasClass","map","removeClass","_checkIfElem","res","nodeType","_checkIfSelector","tagName","isAllSelect","page","key","_shiftModeAction","shift","_isMulti","_findNextTarget","isDown","shiftKey","preventDefault","_rangeVariator","_multiVariator","scroll","isFocusSelected","isTargetSelected","prevItem","afterTarget","isSelectedAfterTarget","edge","_refreshBoxScroll","$box","isWindow","boxScrollTop","scrollTop","boxWindowY","offset","$item","itemBoxTop","_isRange","ctrlKey","metaKey","isMulti","isRange","_mousedownOnItem","_isFocusOnHoverPrevented","_isHovered","_preventMouseMove","_focusHoverTimeout","_callPublicMethod","publicMethod","isFunction","charAt","isEnabled","isPlainObject","getSelected","removeData","revert","blur","getIds","id","getSelectedId","enable","disable","cancel","refresh","jQuery","Zepto"],"mappings":";;;;CAGC,SAASA,EAAGC,EAAQC,GACnB,YAsDA,SAASC,GAAUC,EAAQC,EAAUC,GAKnC,MAJAC,MAAKC,QAAaJ,EAClBG,KAAKE,YACLF,KAAKG,cACLH,KAAKI,IAAKX,EAAEY,UAAWP,EAAUC,QAAc,GACxCC,KA8HT,QAASM,GAAQC,EAASC,GACxBR,KAAKS,MAAaH,EAAOI,WACzBV,KAAKW,GAAaJ,EAClBP,KAAKY,IAAanB,EAAGc,GACrBP,KAAKa,MACLb,KAAKc,UAAa,EAClBd,KAAKe,WAAa,EAClBf,KAAKgB,aACLhB,KAAKQ,QAAa,GAAIZ,GAASC,EAAQC,EAAUU,EAEjD,IAAIS,GAAQjB,IACZA,MAAKQ,QAAQU,GAAG,SAAU,SAAUC,GAGlC,MADAF,GAAMG,eAAiB,IAAMH,EAAMT,QAAQa,IAAI,aAAe,IAAMF,EAC7DA,IAETnB,KAAKQ,QAAQU,GAAG,aAAc,SAAUC,GAEtC,MADAF,GAAMK,iBAAkBH,GACjBA,IAETnB,KAAKoB,eAAiB,IAAMpB,KAAKQ,QAAQa,IAAI,aAAe,IAAMrB,KAAKQ,QAAQa,IAAI,UACnFrB,KAAKsB,iBAAkBtB,KAAKQ,QAAQa,IAAI,eACxCrB,KAAKuB,QA5MP,GAAIC,GAAc/B,EAAEgC,GAAGD,YAAc,cAAgB,QAC/C/B,GAAEgC,GAAGC,QAAWjC,EAAEgC,GAAGE,QAAUlC,EAAEgC,GAAGE,OAAQ,EAGlD,IAAIC,GAAY,SAASC,EAAMC,EAAMtB,GACnC,GAAIuB,GAASC,EAAMC,EACfC,EAAU,KACVC,EAAW,CACf3B,GAAUA,KACV,IAAI4B,GAAQ,WACVD,EAAW3B,EAAQ6B,WAAY,EAAQ,EAAI,GAAIC,MAC/CJ,EAAU,KACVD,EAASJ,EAAKU,MAAMR,EAASC,GAE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