/**
 * Kendo UI v2023.3.1114 (http://www.telerik.com/kendo-ui)
 * Copyright 2023 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.
 */
import"./kendo.core.js";import"./kendo.icons.js";var __meta__={id:"expansionpanel",name:"ExpansionPanel",category:"web",description:"The ExpansionPanel provides an expandable details-summary view",depends:["core","icons"]};!function(e,a){var n=window.kendo,s=n.ui.Widget,t=n.ui,i=n.keys,o=e.extend,d=n.htmlEncode,p=".kendoExpansionPanel",l="expand",r="collapse",c="[class*='-i-chevron-up']",u="complete",h="k-disabled",x="aria-disabled",m="aria-expanded",C="aria-hidden",f="k-expanded",k="k-d-none",v="k-focus",_=({title:e,subTitle:a,iconClass:s,useBareTemplate:t,ns:i,elementId:o})=>`<div ${t?"":'class="k-expander-header"'} data-${i}expander-header role="button" tabindex="0" aria-controls="${d(o)}">`+(t?e:`<div class="k-expander-title">${d(e)}</div>`)+'<span class="k-expander-spacer"></span>'+(t?"":`<div class="k-expander-sub-title">${d(a)}</div>`)+'<span class="k-expander-indicator">'+(s&&s.includes("k-icon")?`<span class="${d(s)}"></span>`:n.ui.icon({icon:s}))+"</span></div>",g=s.extend({init:function(a,t){var i=this,o=n.attr("expander-header");s.fn.init.call(i,a,t),t=e.extend(!0,{},t),i._wrapper(),i._animations(t),i.element.attr(C,!t.expanded),i.options.useBareTemplate||i.element.addClass("k-expander-content"),i.wrapper.on("click"+p,"["+o+"]",i._click.bind(i)).on("focusin"+p,i._focus.bind(i)).on("focusout"+p,i._blur.bind(i)).on("keydown"+p,i._keydown.bind(i)),i.toggle(i.options.expanded,!1),n.notify(i)},events:[l,r,u],options:{name:"ExpansionPanel",disabled:!1,expanded:!1,animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},height:null,toggleable:!0,expandIconClass:"chevron-down",collapseIconClass:"chevron-up",title:"",subTitle:"",headerClass:null,wrapperClass:null,useBareTemplate:!1},_wrapper:function(){var a,s,t=this,i=t.element,o=i[0],d=i.attr("id");d||(d=n.guid(),i.attr("id",d)),a=i.wrap("<div class='k-expander"+(t.options.expanded?" "+f:"")+"'></div>").parent(),s=n.template(_)({title:t.options.title,subTitle:t.options.subTitle,iconClass:t.options.expanded?t.options.expandIconClass:t.options.collapseIconClass,useBareTemplate:t.options.useBareTemplate,ns:n.ns,elementId:d+"_wrapper"}),t.header=e(s),a.prepend(t.header),t._indicator=a.find(".k-expander-indicator span"),a[0].style.cssText=o.style.cssText,o.style.width="100%",t.wrapper=a.addClass(t.options.disabled?h:""),t.contentWrapper=t.element.wrap('<div id="'+d+'_wrapper"></div>').parent().addClass("k-expander-content-wrapper").toggleClass(k,!t.options.expanded),t.header.attr(x,t.options.disabled).attr(m,t.options.expanded),t.options.useBareTemplate||a.addClass(o.className),t.options.height&&t.wrapper.css("height",t.options.height),t.options.headerClass&&t.header.addClass(t.options.headerClass),t.options.wrapperClass&&t.header.addClass(t.options.wrapperClass)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})},_click:function(e){var a=this,n=a._indicator.is(c),s=a.element;e.stopPropagation(),a.options.toggleable?a.trigger(n?r:l,{item:s[0]})||a.toggle():e.preventDefault()},toggle:function(e,a){var s=this,t=s.options.animation,i=t.expand,d=t.collapse&&"effects"in t.collapse,p=o({},t.expand,t.collapse),l=s.element,r=s.wrapper;undefined!==e?!1===a&&(p=null):e=!s._indicator.is(c),d||(p=o(p,{reverse:!0})),e?i=o({complete:s._completeHandler.bind(s)},i):(i=o(p,{hide:!0})).complete=s._completeHandler.bind(s),e?(s.options.collapseIconClass.includes("k-icon")?(s._indicator.removeClass(this.options.expandIconClass),s._indicator.addClass(this.options.collapseIconClass)):n.ui.icon(s._indicator,{icon:this.options.collapseIconClass}),r.addClass(f)):(s.options.expandIconClass.includes("k-icon")?(s._indicator.removeClass(this.options.collapseIconClass),s._indicator.addClass(this.options.expandIconClass)):n.ui.icon(s._indicator,{icon:this.options.expandIconClass}),r.removeClass(f)),s.contentWrapper.toggleClass(k,!e),l.attr(C,!e),s.header.attr(m,e),s.contentWrapper.kendoStop(!0,!0).kendoAnimate(i)},_completeHandler:function(){this.trigger(u)},_keydown:function(a){var n=a.keyCode;n!=i.ENTER&&n!=i.SPACEBAR||!e(a.target).is("[data-expander-header]")||(this._click(a),a.preventDefault())},destroy:function(){this.wrapper.off(p),s.fn.destroy.call(this)},enable:function(e){this.wrapper.toggleClass(h,!e),this.header.attr(x,!e)},_blur:function(){this.header&&this.wrapper.removeClass(v)},_focus:function(){this.wrapper&&this.wrapper.addClass(v)}});t.plugin(g)}(window.kendo.jQuery);var kendo$1=kendo;export{kendo$1 as default};
//# sourceMappingURL=kendo.expansionpanel.js.map
