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

27 lines
7.4 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.columnsorter.min",["kendo.core.min"],e)}(function(){return function(e,t){function n(n){var r=n.find("tr:not(.k-filter-row)"),o=i.attr("index"),a=r.find("th["+o+"]:visible");return a.sort(function(n,r){var i,a;return n=e(n),r=e(r),i=n.attr(o),a=r.attr(o),i===t&&(i=e(n).index()),a===t&&(a=e(r).index()),i=parseInt(i,10),a=parseInt(a,10),i>a?1:i<a?-1:0}),a}function r(e){var t=null;return e.is("th")&&(t=e.closest("table"),t.parent().hasClass("k-grid-header-wrap")?t=t.closest(".k-grid").find(".k-grid-content > table"):t.parent().hasClass("k-grid-header-locked")&&(t=t.closest(".k-grid").find(".k-grid-content-locked > table"))),t}var i=window.kendo,o=i.ui,a=o.Widget,s="dir",d="asc",l="single",c="field",f="desc",u=".kendoColumnSorter",p=".k-link",h="aria-sort",k=e.proxy,g=a.extend({init:function(e,t){var n,r=this;a.fn.init.call(r,e,t),r._refreshHandler=k(r.refresh,r),r.dataSource=r.options.dataSource.bind("change",r._refreshHandler),r.directions=r.options.initialDirection===d?[d,f]:[f,d],n=r.element.find(p),n[0]||(n=r.element.wrapInner('<a class="k-link" href="#"/>').find(p)),r.link=n,r.element.on("click"+u,k(r._click,r))},options:{name:"ColumnSorter",mode:l,allowUnsort:!0,compare:null,filter:"",initialDirection:d,showIndexes:!1},events:["change"],destroy:function(){var e=this;a.fn.destroy.call(e),e.element.off(u),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(o){if(!o||"itemchange"!==o.action&&"sync"!==o.action){var a,l,u,p,k,g=this,m=g.dataSource.sort()||[],S=g.element,v=S.attr(i.attr(c)),w=(g.dataSource._sortFields||{})[v];S.removeAttr(i.attr(s)),S.removeAttr(h),w&&(a=w.dir,S.attr(i.attr(s),a),k=w.index),S.is("th")&&w&&(l=r(S),l&&(S.attr(i.attr("index"))?(u=n(S.closest("table")),p=u.index(S)):p=S.parent().children(":visible").index(S),l.find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(p).toggleClass("k-sorted",a!==t))),S.toggleClass("k-sorted",a!==t),S.find(".k-i-sort-asc-sm,.k-i-sort-desc-sm,.k-sort-order").remove(),a===d?(e('<span class="k-icon k-i-sort-asc-sm" />').appendTo(g.link),S.attr(h,"ascending")):a===f&&(e('<span class="k-icon k-i-sort-desc-sm" />').appendTo(g.link),S.attr(h,"descending")),g.options.showIndexes&&m.length>1&&k&&e('<span class="k-sort-order" />').html(k).appendTo(g.link)}},_toggleSortDirection:function(e){var n=this.directions;return e===n[n.length-1]&&this.options.allowUnsort?t:n[0]===e?n[1]:n[0]},_click:function(e){var n,r,o=this,a=o.element,d=a.attr(i.attr(c)),f=a.attr(i.attr(s)),u=o.options,p=null===o.options.compare?t:o.options.compare,h=o.dataSource.sort()||[];if(e.preventDefault(),(!u.filter||a.is(u.filter))&&(f=this._toggleSortDirection(f),!this.trigger("change",{sort:{field:d,dir:f,compare:p}}))){if(u.mode===l)h=[{field:d,dir:f,compare:p}];else if("multiple"===u.mode){for(n=0,r=h.length;n<r;n++)if(h[n].field===d){h.splice(n,1);break}h.push({field:d,dir:f,compare:p})}this.dataSource.options.endless&&(this.dataSource.options.endless=null,a.closest(".k-grid").getKendoGrid()._endlessPageSize=o.dataSource.options.pageSize,this.dataSource.pageSize(o.dataSource.options.pageSize)),this.dataSource.sort(h)}}});o.plugin(g)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,n){(n||t)()});
//# sourceMappingURL=kendo.columnsorter.min.js.map