demo20230512/Scripts/kendo/2014.2.716/kendo.panelbar.min.js

16 lines
14 KiB
JavaScript
Raw Normal View History

2023-05-12 10:20:28 +08:00
/**
* Copyright 2014 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t){function n(t){t=e(t),t.children(v).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(I)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(x),t.filter(".k-last:not(:last-child)").removeClass(m),t.filter(":first-child").addClass(x),t.filter(":last-child").addClass(m)}var r=window.kendo,o=r.ui,a=r.keys,s=e.extend,l=e.each,d=r.template,c=o.Widget,u=/^(ul|a|div)$/i,p=".kendoPanelBar",f="img",h="href",m="k-last",g="k-link",v="."+g,_="error",k=".k-item",b=".k-group",w=b+":visible",y="k-image",x="k-first",C="expand",T="select",S="k-content",F="activate",D="collapse",E="mouseenter",A="mouseleave",H="contentLoad",I="k-state-active",N="> .k-panel",M="> .k-content",R="k-state-focused",O="k-state-disabled",z="k-state-selected",P="."+z,L="k-state-highlight",B=k+":not(.k-state-disabled)",U=B+" > .k-link",W=k+".k-state-disabled > .k-link",q="> li > "+P+", .k-panel > li > "+P,V="k-state-default",j="aria-disabled",$="aria-expanded",G="aria-hidden",Y="aria-selected",Q=":visible",K=":empty",J="single",X={content:d("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:d("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:d("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:d("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:d("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:d("<span class='#= arrowClass(item) #'></span>"),sprite:d("<span class='k-sprite #= spriteCssClass #'></span>"),empty:d("")},Z={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=$+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=j+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+O:t.expanded===!0?" "+I:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=g;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},et=c.extend({init:function(t,n){var i,o=this;c.fn.init.call(o,t,n),t=o.wrapper=o.element.addClass("k-widget k-reset k-header k-panelbar"),n=o.options,t[0].id&&(o._itemId=t[0].id+"_pb_active"),o._tabindex(),o._initData(n),o._updateClasses(),o._animations(n),t.on("click"+p,U,function(t){o._click(e(t.currentTarget))&&t.preventDefault()}).on(E+p+" "+A+p,U,o._toggleHover).on("click"+p,W,!1).on("keydown"+p,e.proxy(o._keydown,o)).on("focus"+p,function(){var e=o.select();o._current(e[0]?e:o._first())}).on("blur"+p,function(){o._current(null)}).attr("role","menu"),i=t.find("li."+I+" > ."+S),i[0]&&o.expand(i.parent(),!1),r.notify(o)},events:[C,D,T,F,_,H],options:{name:"PanelBar",animation:{expand:{effec