kendo.toolbar.min.js 29 KB

1234567891011121314151617181920212223242526
  1. /**
  2. * Kendo UI v2019.2.619 (http://www.telerik.com/kendo-ui)
  3. * Copyright 2019 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
  4. *
  5. * Kendo UI commercial licenses may be obtained at
  6. * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
  7. * If you do not own a commercial license, this file shall be governed by the trial license terms.
  8. */
  9. !function(t,define){define("kendo.toolbar.min",["kendo.core.min","kendo.userevents.min","kendo.popup.min"],t)}(function(){return function(t,e){function o(t){t.target.is(".k-toggle-button")||t.target.toggleClass(W,"press"==t.type)}function i(e){return e=t(e),e.hasClass("km-actionsheet")?e.closest(".km-popup-wrapper"):e.addClass("km-widget km-actionsheet").wrap('<div class="km-actionsheet-wrapper km-actionsheet-tablet km-widget km-popup"></div>').parent().wrap('<div class="km-popup-wrapper k-popup"></div>').parent()}function n(e){t(e.target).closest("a.k-button").length&&e.preventDefault()}function s(e,o){var i="next"===o?t.fn.next:t.fn.prev,n="next"===o?t.fn.first:t.fn.last,l=i.call(e);return!l.length&&e.is("."+$)?e:l.is(":kendoFocusable")||!l.length?l:l.find(":kendoFocusable").length?n.call(l.find(":kendoFocusable")):s(l,o)}var l,r,a,d,h,p,u,c,f,v,m,b,g,w,k,C,y,A=window.kendo,_=A.Class,x=A.ui.Widget,B=t.proxy,E=A.isFunction,T=A.keys,O=A._outerWidth,I="k-toolbar",F="k-button",P="k-overflow-button",U="k-toggle-button",D="k-button-group",z="k-split-button",G="k-separator",H="k-spacer",N="spacer",R="k-popup",M="k-toolbar-resizable",W="k-state-active",S="k-state-disabled",K="k-state-hidden",j="k-group-start",q="k-group-end",Q="k-primary",V="k-icon",L="k-i-",J="k-button-icon",X="k-button-icontext",Y="k-list-container k-split-container",Z="k-split-button-arrow",$="k-overflow-anchor",tt="k-overflow-container",et="k-toolbar-first-visible",ot="k-toolbar-last-visible",it="click",nt="toggle",st="open",lt="close",rt="overflowOpen",at="overflowClose",dt="never",ht="auto",pt="always",ut="k-overflow-hidden",ct="_optionlist",ft=A.attr("uid");A.toolbar={},l={overflowAnchor:'<div tabindex="0" class="k-overflow-anchor k-button"></div>',overflowContainer:'<ul class="k-overflow-container k-list-container"></ul>'},A.toolbar.registerComponent=function(t,e,o){l[t]={toolbar:e,overflow:o}},r=A.Class.extend({addOverflowAttr:function(){this.element.attr(A.attr("overflow"),this.options.overflow||ht)},addUidAttr:function(){this.element.attr(ft,this.options.uid)},addIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id)},addOverflowIdAttr:function(){this.options.id&&this.element.attr("id",this.options.id+"_overflow")},attributes:function(){this.options.attributes&&this.element.attr(this.options.attributes)},show:function(){this.element.removeClass(K).show(),this.options.hidden=!1},hide:function(){this.element.addClass(K).hide(),this.overflow&&this.overflowHidden&&this.overflowHidden(),this.options.hidden=!0},remove:function(){this.element.remove()},enable:function(t){t===e&&(t=!0),this.element.toggleClass(S,!t),this.options.enable=t},twin:function(){var o=this.element.attr(ft);return this.overflow&&this.options.splitContainerId?t("#"+this.options.splitContainerId).find("["+ft+"='"+o+"']").data(this.options.type):this.overflow?this.toolbar.element.find("["+ft+"='"+o+"']").data(this.options.type):this.toolbar.options.resizable?this.toolbar.popup.element.find("["+ft+"='"+o+"']").data(this.options.type):e}}),A.toolbar.Item=r,a=r.extend({init:function(o,i){var n=t(o.useButtonTag?'<button tabindex="0"></button>':'<a href tabindex="0"></a>');this.element=n,this.options=o,this.toolbar=i,this.attributes(),o.primary&&n.addClass(Q),o.togglable&&(n.addClass(U),this.toggle(o.selected)),o.url===e||o.useButtonTag||(n.attr("href",o.url),o.mobile&&n.attr(A.attr("role"),"button")),o.group&&(n.attr(A.attr("group"),o.group),this.group=this.toolbar.addToGroup(this,o.group)),!o.togglable&&o.click&&E(o.click)&&(this.clickHandler=o.click),o.togglable&&o.toggle&&E(o.toggle)&&(this.toggleHandler=o.toggle)},toggle:function(t,e){t=!!t,this.group&&t?this.group.select(this):this.group||this.select(t),e&&this.twin()&&this.twin().toggle(t)},getParentGroup:function(){if(this.options.isChild)return this.element.closest("."+D).data("buttonGroup")},_addGraphics:function(){var e,o,i,n=this.element,s=this.options.icon,l=this.options.spriteCssClass,r=this.options.imageUrl;(l||r||s)&&(e=!0,n.contents().filter(function(){return!t(this).hasClass("k-sprite")&&!t(this).hasClass(V)&&!t(this).hasClass("k-image")}).each(function(o,i){(1==i.nodeType||3==i.nodeType&&t.trim(i.nodeValue).length>0)&&(e=!1)}),n.addClass(e?J:X)),s?(o=n.children("span."+V).first(),o[0]||(o=t('<span class="'+V+'"></span>').prependTo(n)),o.addClass(L+s)):l?(o=n.children("span.k-sprite").first(),o[0]||(o=t('<span class="k-sprite '+V+'"></span>').prependTo(n)),o.addClass(l)):r&&(i=n.children("img.k-image").first(),i[0]||(i=t('<img alt="icon" class="k-image" />').prependTo(n)),i.attr("src",r))}}),A.toolbar.Button=a,d=a.extend({init:function(t,e){a.fn.init.call(this,t,e);var o=this.element;o.addClass(F),this.addIdAttr(),t.align&&o.addClass("k-align-"+t.align),"overflow"!=t.showText&&t.text&&o.html(t.mobile?'<span class="km-text">'+t.text+"</span>":t.text),t.hasIcon="overflow"!=t.showIcon&&(t.icon||t.spriteCssClass||t.imageUrl),t.hasIcon&&this._addGraphics(),this.addUidAttr(),this.addOverflowAttr(),this.enable(t.enable),t.hidden&&this.hide(),this.element.data({type:"button",button:this})},select:function(t){t===e&&(t=!1),this.element.toggleClass(W,t),this.options.selected=t}}),A.toolbar.ToolBarButton=d,h=a.extend({init:function(e,o){this.overflow=!0,a.fn.init.call(this,t.extend({},e),o);var i=this.element;"toolbar"!=e.showText&&e.text&&i.html(e.mobile?'<span class="km-text">'+e.text+"</span>":'<span class="k-text">'+e.text+"</span>"),e.hasIcon="toolbar"!=e.showIcon&&(e.icon||e.spriteCssClass||e.imageUrl),e.hasIcon&&this._addGraphics(),e.isChild||this._wrap(),this.addOverflowIdAttr(),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.enable(e.enable),i.addClass(P+" "+F),e.hidden&&this.hide(),e.togglable&&this.toggle(e.selected),this.element.data({type:"button",button:this})},_wrap:function(){this.element=this.element.wrap("<li></li>").parent()},overflowHidden:function(){this.element.addClass(ut)},select:function(t){t===e&&(t=!1),this.options.isChild?this.element.toggleClass(W,t):this.element.find(".k-button").toggleClass(W,t),this.options.selected=t}}),A.toolbar.OverflowButton=h,A.toolbar.registerComponent("button",d,h),p=r.extend({createButtons:function(e){var o,i,n=this.options,s=n.buttons||[];for(i=0;i<s.length;i++)s[i].uid||(s[i].uid=A.guid()),o=new e(t.extend({mobile:n.mobile,isChild:!0,type:"button"},s[i]),this.toolbar),o.element.appendTo(this.element)},refresh:function(){this.element.children().filter(":not('."+K+"'):first").addClass(j),this.element.children().filter(":not('."+K+"'):last").addClass(q)}}),A.toolbar.ButtonGroup=p,u=p.extend({init:function(e,o){var i=this.element=t("<div></div>");this.options=e,this.toolbar=o,this.addIdAttr(),e.align&&i.addClass("k-align-"+e.align),this.createButtons(d),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass(D),this.element.data({type:"buttonGroup",buttonGroup:this})}}),A.toolbar.ToolBarButtonGroup=u,c=p.extend({init:function(e,o){var i=this.element=t("<li></li>");this.options=e,this.toolbar=o,this.overflow=!0,this.addOverflowIdAttr(),this.createButtons(h),this.attributes(),this.addUidAttr(),this.addOverflowAttr(),this.refresh(),i.addClass((e.mobile?"":D)+" k-overflow-group"),this.element.data({type:"buttonGroup",buttonGroup:this})},overflowHidden:function(){this.element.addClass(ut)}}),A.toolbar.OverflowButtonGroup=c,A.toolbar.registerComponent("buttonGroup",u,c),f=r.extend({init:function(e,o){var i=this.element=t('<div class="'+z+'" tabindex="0"></div>');this.options=e,this.toolbar=o,this.mainButton=new d(t.extend({},e,{hidden:!1}),o),this.arrowButton=t('<a class="'+F+" "+Z+'"><span class="'+(e.mobile?"km-icon km-arrowdown":"k-icon k-i-arrow-60-down")+'"></span></a>'),this.popupElement=t('<ul class="'+Y+'"></ul>'),this.mainButton.element.removeAttr("href tabindex").appendTo(i),this.arrowButton.appendTo(i),this.popupElement.appendTo(i),e.align&&i.addClass("k-align-"+e.align),e.id||(e.id=e.uid),i.attr("id",e.id+"_wrapper"),this.addOverflowAttr(),this.addUidAttr(),this.createMenuButtons(),this.createPopup(),this._navigatable(),this.mainButton.main=!0,this.enable(e.enable),e.hidden&&this.hide(),i.data({type:"splitButton",splitButton:this,kendoPopup:this.popup})},_navigatable:function(){var e=this;e.popupElement.on("keydown","."+F,function(o){var i=t(o.target).parent();o.preventDefault(),o.keyCode===T.ESC||o.keyCode===T.TAB||o.altKey&&o.keyCode===T.UP?(e.toggle(),e.focus()):o.keyCode===T.DOWN?s(i,"next").focus():o.keyCode===T.UP?s(i,"prev").focus():o.keyCode===T.SPACEBAR||o.keyCode===T.ENTER?e.toolbar.userEvents.trigger("tap",{target:t(o.target)}):o.keyCode===T.HOME?i.parent().find(":kendoFocusable").first().focus():o.keyCode===T.END&&i.parent().find(":kendoFocusable").last().focus()})},createMenuButtons:function(){var e,o,i=this.options,n=i.menuButtons;for(o=0;o<n.length;o++)e=new d(t.extend({mobile:i.mobile,type:"button",click:i.click},n[o]),this.toolbar),e.element.wrap("<li></li>").parent().appendTo(this.popupElement)},createPopup:function(){var o=this,s=this.options,l=this.element;this.popupElement.attr("id",s.id+ct).attr(ft,s.rootUid),s.mobile&&(this.popupElement=i(this.popupElement)),this.popup=this.popupElement.kendoPopup({appendTo:s.mobile?t(s.mobile).children(".km-pane"):null,anchor:l,isRtl:this.toolbar._isRtl,copyAnchorStyles:!1,animation:s.animation,open:function(t){var i=o.toolbar.trigger(st,{target:l});return i?(t.preventDefault(),e):(o.adjustPopupWidth(t.sender),e)},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(t){var e=o.toolbar.trigger(lt,{target:l});e&&t.preventDefault(),l.focus()}}).data("kendoPopup"),this.popup.element.on(it,"a.k-button",n)},adjustPopupWidth:function(t){var e,o=t.options.anchor,i=O(o);A.wrap(t.element).addClass("k-split-wrapper"),e="border-box"!==t.element.css("box-sizing")?i-(O(t.element)-t.element.width()):i,t.element.css({fontFamily:o.css("font-family"),"min-width":e})},remove:function(){this.popup.element.off(it,"a.k-button"),this.popup.destroy(),this.element.remove()},toggle:function(){(this.options.enable||this.popup.visible())&&this.popup.toggle()},enable:function(t){t===e&&(t=!0),this.mainButton.enable(t),this.element.toggleClass(S,!t),this.options.enable=t},focus:function(){this.element.focus()},hide:function(){this.popup&&this.popup.close(),this.element.addClass(K).hide(),this.options.hidden=!0},show:function(){this.element.removeClass(K).hide(),this.options.hidden=!1}}),A.toolbar.ToolBarSplitButton=f,v=r.extend({init:function(e,o){var i,n,s,l=this.element=t('<li class="'+z+'"></li>'),r=e.menuButtons;for(this.options=e,this.toolbar=o,this.overflow=!0,n=(e.id||e.uid)+ct,this.mainButton=new h(t.extend({},e)),this.mainButton.element.appendTo(l),s=0;s<r.length;s++)i=new h(t.extend({mobile:e.mobile,type:"button",splitContainerId:n},r[s]),this.toolbar),i.element.appendTo(l);this.addUidAttr(),this.addOverflowAttr(),this.mainButton.main=!0,l.data({type:"splitButton",splitButton:this})},overflowHidden:function(){this.element.addClass(ut)}}),A.toolbar.OverflowSplitButton=v,A.toolbar.registerComponent("splitButton",f,v),m=r.extend({init:function(e,o){var i=this.element=t("<div>&nbsp;</div>");this.element=i,this.options=e,this.toolbar=o,this.attributes(),this.addIdAttr(),this.addUidAttr(),this.addOverflowAttr(),i.addClass(G),i.data({type:"separator",separator:this})}}),b=r.extend({init:function(e,o){var i=this.element=t("<li>&nbsp;</li>");this.element=i,this.options=e,this.toolbar=o,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),i.addClass(G),i.data({type:"separator",separator:this})},overflowHidden:function(){this.element.addClass(ut)}}),A.toolbar.registerComponent("separator",m,b),g=r.extend({init:function(e,o){var i=this.element=t("<div>&nbsp;</div>");this.element=i,this.options=e,this.toolbar=o,i.addClass(H),i.data({type:N})}}),A.toolbar.registerComponent(N,g),w=r.extend({init:function(e,o,i){var n=E(e)?e(o):e;n=n instanceof jQuery?n.wrap("<div></div>").parent():t("<div></div>").html(n),this.element=n,this.options=o,this.options.type="template",this.toolbar=i,this.attributes(),this.addUidAttr(),this.addIdAttr(),this.addOverflowAttr(),n.data({type:"template",template:this})}}),A.toolbar.TemplateItem=w,k=r.extend({init:function(e,o,i){var n=t(E(e)?e(o):e);n=n instanceof jQuery?n.wrap("<li></li>").parent():t("<li></li>").html(n),this.element=n,this.options=o,this.options.type="template",this.toolbar=i,this.overflow=!0,this.attributes(),this.addUidAttr(),this.addOverflowIdAttr(),this.addOverflowAttr(),n.data({type:"template",template:this})},overflowHidden:function(){this.element.addClass(ut)}}),A.toolbar.OverflowTemplateItem=k,C=_.extend({init:function(t){this.name=t,this.buttons=[]},add:function(t){this.buttons[this.buttons.length]=t},remove:function(e){var o=t.inArray(e,this.buttons);this.buttons.splice(o,1)},select:function(t){var e,o;for(o=0;o<this.buttons.length;o++)e=this.buttons[o],e.select(!1);t.select(!0),t.twin()&&t.twin().select(!0)}}),y=x.extend({init:function(e,i){var s,l=this;if(x.fn.init.call(l,e,i),i=l.options,e=l.wrapper=l.element,e.addClass(I+" k-widget"),this.uid=A.guid(),this._isRtl=A.support.isRtl(e),this._groups={},e.attr(ft,this.uid),l.isMobile="boolean"==typeof i.mobile?i.mobile:l.element.closest(".km-root")[0],l.animation=l.isMobile?{open:{effects:"fade"}}:{},l.isMobile&&(e.addClass("km-widget"),V="km-icon",L="km-",F="km-button",D="km-buttongroup",W="km-state-active",S="km-state-disabled"),i.resizable?(l._renderOverflow(),e.addClass(M),l.overflowUserEvents=new A.UserEvents(l.element,{threshold:5,allowSelection:!0,filter:"."+$,tap:B(l._toggleOverflow,l)}),l._resizeHandler=A.onResize(function(){l.resize()})):l.popup={element:t([])},i.items&&i.items.length){for(s=0;s<i.items.length;s++)l.add(i.items[s]);i.resizable&&l._shrink(l.element.innerWidth())}l.userEvents=new A.UserEvents(document,{threshold:5,allowSelection:!0,filter:"["+ft+"="+this.uid+"] a."+F+", ["+ft+"="+this.uid+"] ."+P,tap:B(l._buttonClick,l),press:o,release:o}),l.element.on(it,"a.k-button",n),l._navigatable(),i.resizable&&l.popup.element.on(it,NaN,n),i.resizable&&this._toggleOverflowAnchor(),A.notify(l)},events:[it,nt,st,lt,rt,at],options:{name:"ToolBar",items:[],resizable:!0,mobile:null},addToGroup:function(t,e){var o;return o=this._groups[e]?this._groups[e]:this._groups[e]=new C,o.add(t),o},destroy:function(){var e=this;e.element.find("."+z).each(function(e,o){t(o).data("kendoPopup").destroy()}),e.element.off(it,"a.k-button"),e.userEvents.destroy(),e.options.resizable&&(A.unbindResize(e._resizeHandler),e.overflowUserEvents.destroy(),e.popup.element.off(it,"a.k-button"),e.popup.destroy()),x.fn.destroy.call(e)},add:function(e){var o,i,n,s=l[e.type],r=e.template,a=this,d=a.isMobile?"":"k-item k-state-default",h=e.overflowTemplate;if(t.extend(e,{uid:A.guid(),animation:a.animation,mobile:a.isMobile,rootUid:a.uid}),e.menuButtons)for(n=0;n<e.menuButtons.length;n++)t.extend(e.menuButtons[n],{uid:A.guid()});r&&!h||e.type===N?e.overflow=dt:e.overflow||(e.overflow=ht),e.overflow!==dt&&a.options.resizable&&(h?i=new k(h,e,a):s&&(i=new s.overflow(e,a),i.element.addClass(d)),i&&(e.overflow===ht&&i.overflowHidden(),i.element.appendTo(a.popup.container),a.angular("compile",function(){return{elements:i.element.get()}}))),e.overflow!==pt&&(r?o=new w(r,e,a):s&&(o=new s.toolbar(e,a)),o&&(o.element.appendTo(a.element),a.angular("compile",function(){return{elements:o.element.get()}})))},_getItem:function(e){var o,i,n,s,l=this.options.resizable;return o=this.element.find(e),o.length||(o=t(".k-split-container[data-uid="+this.uid+"]").find(e)),s=o.length?o.data("type"):"",i=o.data(s),i?(i.main&&(o=o.parent("."+z),s="splitButton",i=o.data(s)),l&&(n=i.twin())):l&&(o=this.popup.element.find(e),s=o.length?o.data("type"):"",n=o.data(s),n&&n.main&&(o=o.parent("."+z),s="splitButton",n=o.data(s))),{type:s,toolbar:i,overflow:n}},remove:function(t){var e=this._getItem(t);e.toolbar&&e.toolbar.remove(),e.overflow&&e.overflow.remove(),this.resize(!0)},hide:function(t){var e,o=this._getItem(t);o.toolbar&&("button"===o.toolbar.options.type&&o.toolbar.options.isChild?(e=o.toolbar.getParentGroup(),o.toolbar.hide(),e&&e.refresh()):o.toolbar.options.hidden||o.toolbar.hide()),o.overflow&&("button"===o.overflow.options.type&&o.overflow.options.isChild?(e=o.overflow.getParentGroup(),o.overflow.hide(),e&&e.refresh()):o.overflow.options.hidden||o.overflow.hide()),this.resize(!0)},show:function(t){var e=this._getItem(t);e.toolbar&&("button"===e.toolbar.options.type&&e.toolbar.options.isChild?(e.toolbar.show(),e.toolbar.getParentGroup().refresh()):e.toolbar.options.hidden&&e.toolbar.show()),e.overflow&&("button"===e.overflow.options.type&&e.overflow.options.isChild?(e.toolbar.show(),e.overflow.getParentGroup().refresh()):e.overflow.options.hidden&&e.overflow.show()),this.resize(!0)},enable:function(t,o){var i=this._getItem(t);e===o&&(o=!0),i.toolbar&&i.toolbar.enable(o),i.overflow&&i.overflow.enable(o)},getSelectedFromGroup:function(t){return this.element.find("."+U+"[data-group='"+t+"']").filter("."+W)},toggle:function(o,i){var n=t(o),s=n.data("button");s.options.togglable&&(i===e&&(i=!0),s.toggle(i,!0))},_renderOverflow:function(){var e=this,o=l.overflowContainer,n=e._isRtl,r=n?"left":"right";e.overflowAnchor=t(l.overflowAnchor).addClass(F),e.element.append(e.overflowAnchor),e.isMobile?(e.overflowAnchor.append('<span class="km-icon km-more"></span>'),o=i(o)):e.overflowAnchor.append('<span class="k-icon k-i-more-vertical"></span>'),e.popup=new A.ui.Popup(o,{origin:"bottom "+r,position:"top "+r,anchor:e.overflowAnchor,isRtl:n,animation:e.animation,appendTo:e.isMobile?t(e.isMobile).children(".km-pane"):null,copyAnchorStyles:!1,open:function(o){var i=A.wrap(e.popup.element).addClass("k-overflow-wrapper");e.isMobile?e.popup.container.css("max-height",parseFloat(t(".km-content:visible").innerHeight())-15+"px"):i.css("margin-left",(n?-1:1)*((O(i)-i.width())/2+1)),e.trigger(rt)&&o.preventDefault()},activate:function(){this.element.find(":kendoFocusable").first().focus()},close:function(t){e.trigger(at)&&t.preventDefault(),this.element.focus()}}),e.popup.element.on("keydown","."+F,function(o){var i,n=t(o.target),l=n.parent(),r=l.is("."+D)||l.is("."+z);o.preventDefault(),o.keyCode===T.ESC||o.keyCode===T.TAB||o.altKey&&o.keyCode===T.UP?(e._toggleOverflow(),e.overflowAnchor.focus()):o.keyCode===T.DOWN?(i=!r||r&&n.is(":last-child")?l:n,s(i,"next").focus()):o.keyCode===T.UP?(i=!r||r&&n.is(":first-child")?l:n,s(i,"prev").focus()):o.keyCode===T.SPACEBAR||o.keyCode===T.ENTER?(e.userEvents.trigger("tap",{target:t(o.target)}),e.overflowAnchor.focus()):o.keyCode===T.HOME?l.parent().find(":kendoFocusable").first().focus():o.keyCode===T.END&&l.parent().find(":kendoFocusable").last().focus()}),e.popup.container=e.isMobile?e.popup.element.find("."+tt):e.popup.element,e.popup.container.attr(ft,this.uid)},_toggleOverflowAnchor:function(){var t=!1,e=this._isRtl?"padding-left":"padding-right";t=this.options.mobile?this.popup.element.find("."+tt).children(":not(."+ut+", ."+R+")").length>0:this.popup.element.children(":not(."+ut+", ."+R+")").length>0,t?(this.overflowAnchor.css({visibility:"visible",width:""}),this.wrapper.css(e,this.overflowAnchor.outerWidth(!0))):(this.overflowAnchor.css({visibility:"hidden",width:"1px"}),this.wrapper.css(e,""))},_buttonClick:function(o){var i,n,s,l,r,a,d,h=this,p=o.target.closest("."+Z).length;return o.preventDefault(),p?(h._toggle(o),e):(n=t(o.target).closest("."+F,h.element),n.hasClass($)||(s=n.data("button"),!s&&h.popup&&(n=t(o.target).closest("."+P,h.popup.container),s=n.parent("li").data("button")),s&&s.options.enable&&(s.options.togglable?(r=E(s.toggleHandler)?s.toggleHandler:null,s.toggle(!s.options.selected,!0),a={target:n,group:s.options.group,checked:s.options.selected,id:s.options.id,item:s},r&&r.call(h,a),h.trigger(nt,a)):(r=E(s.clickHandler)?s.clickHandler:null,a={sender:h,target:n,id:s.options.id,item:s},r&&r.call(h,a),h.trigger(it,a)),s.options.url&&(s.options.attributes&&s.options.attributes.target&&(d=s.options.attributes.target),window.open(s.options.url,d||"_self")),n.hasClass(P)&&h.popup.close(),l=n.closest(".k-split-container"),l[0]&&(i=l.data("kendoPopup"),(i?i:l.parents(".km-popup-wrapper").data("kendoPopup")).close()))),e)},_navigatable:function(){var e=this;e.element.attr("tabindex",0).on("focusin",function(e){var o=t(e.target),i=t(this).find(":kendoFocusable:first");o.is("."+I)&&0!==i.length&&(i.is("."+$)&&(i=s(i,"next")),i.length&&i[0].focus())}).on("keydown",B(e._keydown,e))},_keydown:function(o){var i,n,s,l,r,a,d,h,p,u=t(o.target),c=o.keyCode,f=this.element.children(":not(.k-separator):visible"),v=this._isRtl?-1:1;if(c===T.TAB&&(i=u.parentsUntil(this.element).last(),n=!1,s=!1,l=!1,f.not("."+$).length||(l=!0),i.length||(i=u),i.is("."+$)&&!l&&(r=f.last(),o.shiftKey&&o.preventDefault(),r.is(":kendoFocusable")?f.last().focus():f.last().find(":kendoFocusable").last().focus()),o.shiftKey||f.index(i)!==f.length-1||(n=!i.is("."+D)||u.is(":last-child")),a=f.index(i)===f.not(".k-overflow-anchor").first().index(),o.shiftKey&&a&&(s=!i.is("."+D)||u.is(":first-child")),n&&this.overflowAnchor&&"hidden"!==this.overflowAnchor.css("visibility")&&!l&&(o.preventDefault(),this.overflowAnchor.focus()),(s||l&&o.shiftKey)&&(o.preventDefault(),d=this._getPrevFocusable(this.wrapper),d&&d.focus()),this._preventNextFocus=!1),o.altKey&&c===T.DOWN)return h=t(document.activeElement).data("splitButton"),p=t(document.activeElement).is("."+$),h?h.toggle():p&&this._toggleOverflow(),e;if((c===T.SPACEBAR||c===T.ENTER)&&!u.is("input, checkbox"))return c===T.SPACEBAR&&o.preventDefault(),u.is("."+z)?(u=u.children().first(),this.userEvents.trigger("tap",{target:u})):c===T.SPACEBAR&&this.userEvents.trigger("tap",{target:u}),e;if(c===T.HOME){if(u.is(".k-dropdown")||u.is("input"))return;this.overflowAnchor?f.eq(1).focus():f.first().focus(),o.preventDefault()}else if(c===T.END){if(u.is(".k-dropdown")||u.is("input"))return;this.overflowAnchor&&"hidden"!=t(this.overflowAnchor).css("visibility")?this.overflowAnchor.focus():f.last().focus(),o.preventDefault()}else c!==T.RIGHT||this._preventNextFocus||u.is("input, select, .k-dropdown, .k-colorpicker")||!this._getNextElement(o.target,1*v)?c!==T.LEFT||this._preventNextFocus||u.is("input, select, .k-dropdown, .k-colorpicker")||!this._getNextElement(o.target,-1*v)||(this._getNextElement(o.target,-1*v).focus(),o.preventDefault()):(this._getNextElement(o.target,1*v).focus(),o.preventDefault())},_getNextElement:function(e,o){var i=this.element.children(":not(.k-separator):visible"),n=i.index(i.index(e)===-1?e.parentElement:e),s=this.overflowAnchor?1:0,l=o,r=1===o?i.length-1:s,a=1===o?s:i.length-1,d=i[n+o];if(this._preventNextFocus=!1,t(e).closest("."+D).length&&!t(e).is(1===o?":last-child":":first-child"))return t(e).closest("."+D).children()[t(e).closest("."+D).children().index(e)+o];for(this.overflowAnchor&&e===this.overflowAnchor[0]&&o===-1&&(d=i[i.length-1]),n===r&&(d=!this.overflowAnchor||this.overflowAnchor&&"hidden"===t(this.overflowAnchor).css("visibility")?i[a]:this.overflowAnchor);!t(d).is(":kendoFocusable");){if(d=o===-1&&t(d).closest("."+D).length?t(d).children(":not(label, div)").last():t(d).children(":not(label, div)").first(),!d.length&&(l+=o,d=i[n+l],!d))return this.overflowAnchor;this._preventNextFocus=!t(d).closest("."+D).length}return d},_getPrevFocusable:function(o){if(o.is("html"))return o;var i,n,s=o.prevAll();return s.each(function(){return n=t(this),n.is(":kendoFocusable")?(i=n,!1):n.find(":kendoFocusable").length>0?(i=n.find(":kendoFocusable").last(),!1):e}),i?i:this._getPrevFocusable(o.parent())},_toggle:function(e){var o=t(e.target).closest("."+z).data("splitButton");e.preventDefault(),o.options.enable&&o.toggle()},_toggleOverflow:function(){this.popup.toggle()},_resize:function(t){var e=t.width;this.options.resizable&&(this.popup.close(),this._shrink(e),this._stretch(e),this._markVisibles(),this._toggleOverflowAnchor())},_childrenWidth:function(){var e=0;return this.element.children(":visible:not(."+K+", ."+H+")").each(function(){e+=O(t(this),!0)}),Math.ceil(e)},_shrink:function(t){var e,o,i;if(t<this._childrenWidth())for(o=this.element.children(":visible:not([data-overflow='never'], ."+$+")"),i=o.length-1;i>=0&&(e=o.eq(i),!(t>this._childrenWidth()));i--)this._hideItem(e)},_stretch:function(t){var e,o,i;if(t>this._childrenWidth())for(o=this.element.children(":hidden:not('."+K+"')"),i=0;i<o.length&&(e=o.eq(i),!(t<this._childrenWidth())&&this._showItem(e,t));i++);},_hideItem:function(t){t.hide(),this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").removeClass(ut)},_showItem:function(t,e){return!!(t.length&&e>this._childrenWidth()+O(t,!0))&&(t.show(),this.popup&&this.popup.container.find(">li[data-uid='"+t.data("uid")+"']").addClass(ut),!0)},_markVisibles:function(){var t=this.popup.container.children(),e=this.element.children(":not(.k-overflow-anchor)"),o=t.filter(":not(.k-overflow-hidden)"),i=e.filter(":visible");t.add(e).removeClass(et+" "+ot),o.first().add(i.first()).addClass(et),o.last().add(i.last()).addClass(ot)}}),A.ui.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(t,e,o){(o||e)()});
  10. //# sourceMappingURL=kendo.toolbar.min.js.map