text: /*!
   * @package   yii2-grid
   * @author    Kartik Visweswaran <kartikv2@gmail.com>
   * @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2016
   * @version   3.1.3
   *
   * jQuery methods library for yii2-grid expand row column
   * 
   * Author: Kartik Visweswaran
   * Copyright: 2015, Kartik Visweswaran, Krajee.com
   * For more JQuery plugins visit http://plugins.krajee.com
   * For more Yii related demos visit http://demos.krajee.com
   */var kvRowNum=0,kvExpandRow;!function(a){"use strict";kvExpandRow=function(b){var c=b.gridId,d=b.hiddenFromExport,e=b.detailUrl,f=b.onDetailLoaded,g=b.expandIcon,h=b.collapseIcon,i=b.expandTitle,j=b.collapseTitle,k=b.expandAllTitle,l=b.collapseAllTitle,m=b.expandOneOnly,n=b.enableRowClick,o=b.rowClickExcludedTags,p=b.enableCache,q=b.extraData,r=d?b.rowCssClass+" skip-export":b.rowCssClass,s=b.animationDuration,t=a("#"+c),u=t.find(".kv-expand-header-cell.kv-batch-toggle"),v=u.find(".kv-expand-header-icon"),w=void 0!==b.collapseAll&&b.collapseAll,x=void 0!==b.expandAll&&b.expandAll,y=t.find("td .kv-expand-row."+c+":not(.kv-state-disabled)"),z=y.length,A="kv-expand-detail-loading",B=function(){var b=t.find(".kv-expand-icon:first").closest("tr"),c=0;return b.length?(b=b.clone(),b.find(".kv-expand-row").remove(),b.find("td").each(function(){"none"!==a(this).css("display")&&c++}),c):0},C=B(),D=function(a){return a.hasClass("kv-state-collapsed")&&!a.hasClass("kv-state-disabled")},E=function(a){return a.hasClass("kv-state-expanded")&&!a.hasClass("kv-state-disabled")},F=function(a,b){a.length&&a.removeClass(b).addClass(b)},G=function(a){a.removeClass("kv-state-collapsed").addClass("kv-state-expanded")},H=function(a){a.removeClass("kv-state-expanded").addClass("kv-state-collapsed")},I=function(a){F(a,A)},J=function(a){if(a.length){var b=isNaN(s)?1e3:s+200;setTimeout(function(){a.removeClass(A)},b)}};return 0===q.length&&(q={}),0===y.length?void F(u,"kv-state-disabled"):(y.each(function(){var k,l,d=a(this),B=d.find(".kv-expand-icon."+c),F=d.find(".kv-expand-icon"),K=d.closest("tr"),L=d.closest(".kv-expand-icon-cell"),M=d.find(".kv-expand-detail."+c),N=d.find(".kv-expanded-row."+c),O=N.data("key"),P=N.data("index");if(!D(B)&&!E(B))return!0;0===N.length&&(O=K.data("key"),k=K.next('tr.kv-expand-detail-row[data-key="'+O+'"]'),N=k.find(".kv-expanded-row"));var Q=function(b){var c=a.extend({expandRowKey:O,expandRowInd:P},q),d=!p||0===N.html().length;return I(L),e.length>0&&d?(t.trigger("kvexprow.beforeLoad",[P,O,q]),void N.load(e,c,function(){J(L),"function"==typeof f&&f(),b(),t.trigger("kvexprow.loaded",[P,O,q])})):(J(L),void b())},R=function(a){t.find('tr[data-index="'+P+'"]').remove(),N.hide(),K.after(N);var b='<tr class="kv-expand-detail-row '+r+'" data-key="'+O+'" data-index="'+P+'">';N.wrap('<td colspan="'+C+'">').parent().wrap(b),B.html(h),L.attr("title",j),a?N.slideDown(s,function(){H(B),N.show()}):(N.show(),H(B)),0===e.length&&J(L)},S=function(){I(L),M.html(""),F.html(g),L.attr("title",i),l=N.closest(".kv-expand-detail-row"),N.slideUp(s,function(){N.unwrap().unwrap(),N.appendTo(M),G(F)}),J(L)},T=function(){var c,d,e=!1,f=!1;if(!L.hasClass(A)){if(E(B)){if(d=m&&!w){if(c=a.extend({},b,{collapseAll:!0}),y.each(function(){if(a(this).closest(".kv-expand-icon-cell").hasClass(A))return void(f=!0)}),f)return;kvExpandRow(c),e=!0}return Q(function(){R(!0)}),void(d&&!e||(t.trigger("kvexprow.toggle",[P,O,q,!0]),B.focus()))}D(B)&&(S(),t.trigger("kvexprow.toggle",[P,O,q,!1]),B.focus())}};return x?(E(B)&&Q(function(){R(!0),kvRowNum++,kvRowNum>=z&&(J(u),v.focus())}),kvRowNum>=z&&(J(u),v.focus()),!0):w?(D(B)&&(S(),kvRowNum++,kvRowNum>=z&&(J(u),v.focus())),kvRowNum>=z&&(J(u),v.focus()),!0):(D(B)&&P&&(e?Q(function(){R(!1)}):R(!1)),L.off("click").on("click",function(){T(L)}),void K.off("click").on("click",function(b){var c=b.target,d=a(c).length&&a(c).hasClass("kv-disable-click")||a.inArray(c.nodeName,o)!==-1;n&&!d&&T(L)}))}),void(u.length&&u.off().on("click",function(){if(!u.hasClass(A)&&0!==y.length){var c=E(v),d=D(v),e=a.extend({},b,{expandAll:d,collapseAll:c});I(u),d?(kvRowNum=y.find(".kv-state-collapsed").length,G(v),v.html(h),u.attr("title",l),t.trigger("kvexprow.toggleAll",[q,!1])):c&&(kvRowNum=y.find(".kv-state-expanded").length,H(v),v.html(g),u.attr("title",k),t.trigger("kvexprow.toggleAll",[q,!0])),kvExpandRow(e)}})))}}(window.jQuery);