Files
jube-fork/Jube.App/wwwroot/kendo/js/kendo.selectable.min.js
2022-11-04 13:24:24 +02:00

27 lines
10 KiB
JavaScript
Executable File

/**
* Kendo UI v2021.1.224 (http://www.telerik.com/kendo-ui)
* Copyright 2021 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
!function(e,define){define("kendo.selectable.min",["kendo.core.min","kendo.userevents.min"],e)}(function(){return function(e,t){function n(e,t){if(!e.is(":visible"))return!1;var n=s.getOffset(e),i=t.left+t.width,l=t.top+t.height;return n.right=n.left+s._outerWidth(e),n.bottom=n.top+s._outerHeight(e),!(n.left>i||n.right<t.left||n.top>l||n.bottom<t.top)}function i(e,t){return!(e.right<=t.left||e.left>=t.right||e.bottom<=t.top||e.top>=t.bottom)}var l,s=window.kendo,o=s.ui.Widget,a=e.proxy,r=Math.abs,c="aria-selected",u="k-state-selected",f="k-state-selecting",d="k-selectable",h="change",p=".kendoSelectable",v="unselect",m="k-state-unselecting",_="input,a,textarea,.k-multiselect-wrap,select,button,.k-button>span,.k-button>img,span.k-icon.k-i-arrow-60-down,span.k-icon.k-i-arrow-60-up,label.k-checkbox-label.k-no-text,.k-icon.k-i-collapse,.k-icon.k-i-expand,span.k-numeric-wrap,.k-focusable",g=s.support.browser.msie,k=!1,y=e.extend;!function(e){!function(){e('<div class="parent"><span></span></div>').on("click",">*",function(){k=!0}).find("span").trigger("click").end().off()}()}(e),l=o.extend({init:function(t,n){var i,l=this;o.fn.init.call(l,t,n),l._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),l._lastActive=null,l.element.addClass(d),l.relatedTarget=l.options.relatedTarget,i=l.options.multiple,this.options.aria&&i&&l.element.attr("aria-multiselectable",!0),l.userEvents=new s.UserEvents(l.element,{global:!0,allowSelection:!0,filter:(k?"":"."+d+" ")+l.options.filter,tap:a(l._tap,l),touchAction:i?"none":"pan-x pan-y"}),i&&l.userEvents.bind("start",a(l._start,l)).bind("move",a(l._move,l)).bind("end",a(l._end,l)).bind("select",a(l._select,l))},events:[h,v],options:{name:"Selectable",filter:">*",inputSelectors:_,multiple:!1,relatedTarget:e.noop,ignoreOverlapped:!1},_isElement:function(e){var t,n=this.element,i=n.length,l=!1;for(e=e[0],t=0;t<i;t++)if(n[t]===e){l=!0;break}return l},_tap:function(t){var n,i=e(t.target),l=this,s=t.event.ctrlKey||t.event.metaKey,o=l.options.multiple,a=o&&t.event.shiftKey,r=t.event.which,c=t.event.button;!l._isElement(i.closest("."+d))||r&&3==r||c&&2==c||this._allowSelection(t.event.target)&&(n=i.hasClass(u),o&&s||l.clear(),i=i.add(l.relatedTarget(i)),a?l.selectRange(l._firstSelectee(),i,t):(n&&s?(l._unselect(i),l._notify(h,t)):l.value(i,t),l._lastActive=l._downTarget=i))},_start:function(n){var i,l=this,s=e(n.target),o=s.hasClass(u),a=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(l._downTarget=s,!l._isElement(s.closest("."+d)))return l.userEvents.cancel(),t;l.options.useAllItems?l._items=l.element.find(l.options.filter):(i=s.closest(l.element),l._items=i.find(l.options.filter)),n.sender.capture(),l._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),a||l.clear(),s=s.add(l.relatedTarget(s)),o&&(l._selectElement(s,!0),a&&s.addClass(m))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:r(e.x.initialDelta),height:r(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(e){var t,n=this;n._marquee.remove(),n._unselect(n.element.find(n.options.filter+"."+m)).removeClass(m),t=n.element.find(n.options.filter+"."+f),t=t.add(n.relatedTarget(t)),n.value(t,e),n._lastActive=n._downTarget,n._items=null},_invalidateSelectables:function(e,t){var i,l,s,o,a=this._downTarget[0],r=this._items;for(this._currentlyActive=[],i=0,l=r.length;i<l;i++)o=r.eq(i),s=o.add(this.relatedTarget(o)),n(o,e)?(o.hasClass(u)?t&&a!==o[0]&&s.removeClass(u).addClass(m):o.hasClass(f)||o.hasClass(m)||this._collidesWithActiveElement(s,e)||s.addClass(f),this._currentlyActive.push(s[0])):o.hasClass(f)?s.removeClass(f):t&&o.hasClass(m)&&s.removeClass(m).addClass(u)},_collidesWithActiveElement:function(e,t){var n,l,o,a,r,c,u,f;if(!this.options.ignoreOverlapped)return!1;for(n=this._currentlyActive,l=e[0].getBoundingClientRect(),a=!1,r=s.support.isRtl(e),c=r?"right":"left",u={},t.right=t.left+t.width,t.bottom=t.top+t.height,f=0;f<n.length;f++)if(o=n[f].getBoundingClientRect(),i(l,o)){if(u[c]="left"===c?o.right:o.left,l=y({},l,u),l.left>l.right)return!0;a=!i(l,t)}return a},value:function(e,n){var i=this,l=a(i._selectElement,i);return e?(e.each(function(){l(this)}),i._notify(h,n),t):i.element.find(i.options.filter+"."+u)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),l=!n&&this._notify("select",{element:t});i.removeClass(f),l||(i.addClass(u),this.options.aria&&i.attr(c,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){if(!this.trigger(v,{element:e}))return e.removeClass(u),this.options.aria&&e.attr(c,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!g||g&&!e(s._activeElement()).is(this.options.inputSelectors))&&t.preventDefault()},_allowSelection:function(t){return!e(t).is(this.options.inputSelectors)||(this.userEvents.cancel(),this._downTarget=null,!1)},resetTouchEvents:function(){this.userEvents.cancel()},clear:function(){var e=this.element.find(this.options.filter+"."+u);this._unselect(e)},selectRange:function(t,n,i){var l,s,o,a=this;for(a.clear(),a.element.length>1&&(o=a.options.continuousItems()),o&&o.length||(o=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],o),n=e.inArray(e(n)[0],o),t>n&&(s=t,t=n,n=s),a.options.useAllItems||(n+=a.element.length-1),l=t;l<=n;l++)a._selectElement(o[l]);a._notify(h,i)},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(p),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),l.parseOptions=function(e){var t=e.mode||e,n="string"==typeof t&&t.toLowerCase();return{multiple:n&&n.indexOf("multiple")>-1,cell:n&&n.indexOf("cell")>-1}},s.ui.plugin(l)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.selectable.min.js.map