UNPKG

@syncfusion/ej2-kanban

Version:

The Kanban board is an efficient way to visualize the workflow at each stage along its path to completion. The most important features available are Swim lane, filtering, and editing.

10 lines 168 kB
/*! * filename: ej2-kanban.umd.min.js * version : 34.1.30 * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-data","@syncfusion/ej2-dropdowns","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-navigations"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Popups,e.ej2Data,e.ej2Dropdowns,e.ej2Inputs,e.ej2Buttons,e.ej2Navigations)}(this,function(e,f,L,s,P,I,N,B){"use strict";var U="actionBegin",z="actionComplete",V="actionFailure",_="cardClick",K="cardDoubleClick",W="cardRendered",Y="queryCellInfo",Q="dataBinding",X="dataBound",G="dragStart",J="drag",Z="dragStop",$="dialogOpen",ee="dialogClose",u="content-ready",i="data-ready",te="dataSourceChanged",ne="dataStateChange",re="columnDragStart",ae="columnDrag",ie="columnDrop",le=(t.prototype.initDataManager=function(e,t){this.dataManager=e instanceof s.DataManager?e:new s.DataManager(e),this.query=t instanceof s.Query?t:new s.Query,this.kanbanData=new s.DataManager(this.parent.kanbanData)},t.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},t.prototype.columnKeyFields=function(){for(var e=[],t=0,n=this.parent.columns;t<n.length;t++){var r=n[t];if(1<r.keyField.toString().split(",").length)for(var a=0,i=r.keyField.toString().split(",");a<i.length;a++){var l=i[a];e.push(l.trim())}else e.push(r.keyField.toString())}return e},t.prototype.parseViewportHeight=function(e){e=e.toString().trim().match(/^([\d.]+)(vh)?$/i);return window.innerHeight*parseFloat(e[1])/100},t.prototype.getQuery=function(e){var t=this.query.clone();if(this.isRemote()&&this.parent.enableVirtualization){for(var n="auto"===this.parent.cardHeight?100:parseInt(f.formatUnit(this.parent.cardHeight).split("px")[0],10),r=this.parent.height.toString(),a=void 0,i=(a="auto"===r?2*Math.ceil((window.innerHeight-50)/n):r.endsWith("px")?2*Math.ceil((parseInt(f.formatUnit(this.parent.height).split("px")[0],10)-50)/n):r.endsWith("%")?2*Math.ceil((parseInt(f.formatUnit(this.parent.element.clientHeight).split("px")[0],10)-50)/n):r.toLowerCase().endsWith("vh")?(r=this.parseViewportHeight(this.parent.height),2*Math.ceil((r-50)/n)):2*Math.ceil((this.parent.element.getBoundingClientRect().height-50)/n),this.columnKeyFields()),l=0;l<i.length;l++)t.where(this.parent.keyField,"equal",i[l]);t.take(a),f.isNullOrUndefined(e)&&(e="KanbanVirtualization"),t.addParams("KanbanVirtualization",e)}return t},t.prototype.getData=function(e){var t;return this.parent.dataSource&&"result"in this.parent.dataSource?(t=this.eventPromise({requestType:""},e),this.isObservable=!0,t.promise):this.dataManager.executeQuery(e)},t.prototype.setState=function(e){return this.dataState=e},t.prototype.getStateEventArgument=function(e){var t=new s.UrlAdaptor,n=new s.DataManager({url:"",adaptor:new s.UrlAdaptor}),t=t.processQuery(n,e),n=JSON.parse(t.data);return f.extend(n,t.pvtData)},t.prototype.eventPromise=function(e,t,n){var r,a=this,i=e,l=this.getStateEventArgument(t),o=new s.Deferred,t=new s.Deferred;return void 0!==e.requestType&&!1!==this.dataState.isDataChanged?"cardChanged"===(l.action=e).requestType||"cardRemoved"===e.requestType||"cardCreated"===e.requestType?((r=e).promise=t.promise,r.state=l,r.index=n,this.setState({isPending:!0,resolver:t.resolve}),i.endEdit=t.resolve,i.cancelEdit=t.reject,this.parent.trigger(te,r),t.promise.then(function(){a.setState({isPending:!0,resolver:o.resolve}),a.parent.trigger(ne,l),r.addedRecords.forEach(function(e){a.parent.kanbanData.push(e)}),r.changedRecords.forEach(function(t){var e=a.parent.kanbanData.filter(function(e){return e[a.parent.cardSettings.headerField]===t[a.parent.cardSettings.headerField]})[0];f.extend(e,t)}),r.deletedRecords.forEach(function(t){var e=a.parent.kanbanData.findIndex(function(e){return e[a.parent.cardSettings.headerField]===t[a.parent.cardSettings.headerField]});a.parent.kanbanData.splice(e,1)})}).catch(function(){a.parent.hideSpinner()})):(this.setState({isPending:!0,resolver:o.resolve}),this.parent.trigger(ne,l)):(this.setState({}),o.resolve(this.parent.dataSource)),o},t.prototype.getTable=function(){return this.parent.query?this.getQuery().fromTable:null},t.prototype.refreshDataManager=function(){var t=this;this.getData(this.getQuery()).then(function(e){return t.dataManagerSuccess(e)}).catch(function(e){return t.dataManagerFailure(e)})},t.prototype.dataManagerSuccess=function(e,t,n,r){var a=this;this.parent.isDestroyed||(t?(this.updateKanbanData(e),this.parent.enableVirtualization&&this.isRemote()&&this.parent.virtualLayoutModule.refresh()):this.parent.trigger(Q,e,function(e){a.updateKanbanData(e),a.parent.notify(i,{processedData:a.parent.kanbanData}),a.parent.trigger(X,null,function(){return a.parent.hideSpinner()})}),this.initload&&(this.parent.layoutModule.refresh(),this.parent.renderTemplates()),this.initload=!0)},t.prototype.updateKanbanData=function(e){var t=f.extend([],(f.isNullOrUndefined(e.result.result)?e:e.result).result,null,!0);if(this.isRemote()&&this.parent.enableVirtualization&&0<t.length&&!f.isNullOrUndefined(e.result.count))for(var n=this.columnKeyFields(),r=0;r<n.length;r++)e.result.count[r].Key===n[r]&&(this.parent.columnDataCount[n[r]]=e.result.count[r].Value);this.parent.kanbanData=t,this.kanbanData=new s.DataManager(this.parent.kanbanData)},t.prototype.dataManagerFailure=function(e){var t=this;this.parent.isDestroyed||this.parent.trigger(V,{error:e},function(){return t.parent.hideSpinner()})},t.prototype.updateDataManager=function(e,n,t,r,a,i,l,o,s,d){var c,p=this,t=(this.parent.showSpinner(),{requestType:t,cancel:!1,addedRecords:n.addedRecords,changedRecords:n.changedRecords,deletedRecords:n.deletedRecords});this.setState({isDataChanged:!0}),this.eventPromise(t,this.query,a),this.parent.trigger(z,t,function(t){t.cancel||(c=p.syncDataSource(p.dataManager,e,n,r,i,l),p.dataManager.dataSource.offline?p.isObservable||(p.syncDataSource(p.kanbanData,e,n,r,i,l),a=o===s&&d?a-1:a,p.refreshUI(t,a,i),p.parent.enableVirtualization&&p.parent.virtualLayoutModule.refreshColumnData(o,s,t.requestType,r[p.parent.keyField])):c.then(function(e){p.parent.isDestroyed||(p.getData(p.getQuery()).then(function(e){return p.dataManagerSuccess(e,"DataSourceChange",t,a)}).catch(function(e){return p.dataManagerFailure(e)}),"cardCreated"===t.requestType?Array.isArray(e)?p.modifyArrayData(t.addedRecords,e):t.addedRecords[0]=f.extend(t.addedRecords[0],e):"cardChanged"===t.requestType?Array.isArray(e)?p.modifyArrayData(t.changedRecords,e):t.changedRecords[0]=f.extend(t.changedRecords[0],e):"cardRemoved"===t.requestType&&(Array.isArray(e)?p.modifyArrayData(t.deletedRecords,e):t.deletedRecords[0]=f.extend(t.deletedRecords[0],e)),a=o===s&&d?a-1:a,p.refreshUI(t,a,i),p.parent.enableVirtualization&&p.parent.virtualLayoutModule.refreshColumnData(o,s,t.requestType,r[p.parent.keyField]))}).catch(function(e){p.dataManagerFailure(e)}))})},t.prototype.syncDataSource=function(e,t,n,r,a,i){var l,o=this;switch(t){case"insert":return e.insert(r,this.getTable(),this.getQuery());case"update":return this.parent.enableVirtualization&&!this.parent.dataModule.isRemote()&&a?(l=e.remove(this.keyField,r,this.getTable(),this.getQuery()),e.insert(r,this.getTable(),this.getQuery(),e.dataSource.json.findIndex(function(e){return e[o.parent.cardSettings.headerField]===i}))):e.update(this.keyField,r,this.getTable(),this.getQuery());case"delete":return e.remove(this.keyField,r,this.getTable(),this.getQuery());case"batch":if(!this.parent.dataModule.isRemote()&&a&&this.parent.enableVirtualization&&r){for(var s=0;s<r.length;s++)l=e.remove(this.keyField,r[s],this.getTable(),this.getQuery());for(var d=e.dataSource.json.findIndex(function(e){return e[o.parent.cardSettings.headerField]===i}),s=0;s<r.length;s++,d++)l=e.insert(r[s],this.getTable(),this.getQuery(),d);return l}return e.saveChanges(n,this.keyField,this.getTable(),this.getQuery());default:return l}},t.prototype.modifyArrayData=function(e,t){if(e.length===t.length)for(var n=0;n<t.length;n++)e[n]=f.extend(e[n],t[n]);return e},t.prototype.refreshUI=function(n,r,a){var i=this;(this.parent.enableVirtualization?(this.parent.virtualLayoutModule.columnData=this.parent.virtualLayoutModule.getColumnCards(),n.addedRecords.forEach(function(e,t){i.parent.virtualLayoutModule.renderCardBasedOnIndex(e,r+t,a,n.requestType)}),n.changedRecords.forEach(function(e){i.parent.virtualLayoutModule.removeCard(e),i.parent.virtualLayoutModule.renderCardBasedOnIndex(e,r,a,n.requestType),i.parent.virtualLayoutModule.isSelectedCard&&i.parent.actionModule.SingleCardSelection(e),i.parent.sortSettings.field&&"Index"===i.parent.sortSettings.sortBy&&"Descending"===i.parent.sortSettings.direction&&0<r?--r:r++}),n.deletedRecords.forEach(function(e){i.parent.virtualLayoutModule.removeCard(e)}),this.parent.virtualLayoutModule):(this.parent.layoutModule.columnData=this.parent.layoutModule.getColumnCards(),this.parent.swimlaneSettings.keyField&&(this.parent.layoutModule.kanbanRows=this.parent.layoutModule.getRows(),this.parent.layoutModule.swimlaneData=this.parent.layoutModule.getSwimlaneCards()),n.addedRecords.forEach(function(e,t){i.parent.swimlaneSettings.keyField&&!e[i.parent.swimlaneSettings.keyField]&&(e[i.parent.swimlaneSettings.keyField]=""),i.parent.layoutModule.renderCardBasedOnIndex(e,r+t)}),n.changedRecords.forEach(function(e){i.parent.swimlaneSettings.keyField&&!e[i.parent.swimlaneSettings.keyField]&&(e[i.parent.swimlaneSettings.keyField]=""),i.parent.layoutModule.removeCard(e),i.parent.layoutModule.renderCardBasedOnIndex(e,r),i.parent.layoutModule.isSelectedCard&&i.parent.actionModule.SingleCardSelection(e),i.parent.sortSettings.field&&"Index"===i.parent.sortSettings.sortBy&&"Descending"===i.parent.sortSettings.direction&&0<r?--r:r++}),n.deletedRecords.forEach(function(e){i.parent.layoutModule.removeCard(e)}),this.parent.layoutModule)).refresh(),this.parent.renderTemplates(),this.parent.notify(u,{}),this.parent.trigger(X,n,function(){return i.parent.hideSpinner()})},t);function t(e){this.initload=!1,this.dataState={isPending:!1,resolver:null,isDataChanged:!1},this.parent=e,this.keyField=this.parent.cardSettings.headerField,this.dataState={isDataChanged:!1},this.isObservable=!1,this.initDataManager(e.dataSource,e.query),this.refreshDataManager()}oe=function(e,t){return(oe=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var oe,se,de=function(e,t){function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},n=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},de=(se=f.ChildProperty,de(r,se),n([f.Property()],r.prototype,"keyField",void 0),n([f.Property()],r.prototype,"textField",void 0),n([f.Property(!1)],r.prototype,"showEmptyRow",void 0),n([f.Property(!0)],r.prototype,"showItemCount",void 0),n([f.Property(!1)],r.prototype,"allowDragAndDrop",void 0),n([f.Property()],r.prototype,"template",void 0),n([f.Property("Ascending")],r.prototype,"sortDirection",void 0),n([f.Property()],r.prototype,"sortComparer",void 0),n([f.Property(!0)],r.prototype,"showUnassignedRow",void 0),n([f.Property(!1)],r.prototype,"enableFrozenRows",void 0),r);function r(){return null!==se&&se.apply(this,arguments)||this}ce=function(e,t){return(ce=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var ce,pe,n=function(e,t){function n(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},a=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},n=(pe=f.ChildProperty,n(l,pe),a([f.Property(!0)],l.prototype,"showHeader",void 0),a([f.Property()],l.prototype,"headerField",void 0),a([f.Property()],l.prototype,"contentField",void 0),a([f.Property()],l.prototype,"tagsField",void 0),a([f.Property()],l.prototype,"grabberField",void 0),a([f.Property()],l.prototype,"footerCssField",void 0),a([f.Property()],l.prototype,"template",void 0),a([f.Property("Single")],l.prototype,"selectionType",void 0),l);function l(){return null!==pe&&pe.apply(this,arguments)||this}he=function(e,t){return(he=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var he,ue,a=function(e,t){function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},ge=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},a=(ue=f.ChildProperty,a(me,ue),ge([f.Property()],me.prototype,"template",void 0),ge([f.Property([])],me.prototype,"fields",void 0),ge([f.Property(null)],me.prototype,"model",void 0),me);function me(){return null!==ue&&ue.apply(this,arguments)||this}ye=function(e,t){return(ye=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var ye,fe,ge=function(e,t){function n(){this.constructor=e}ye(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},ve=(fe=f.ChildProperty,ge(d,fe),o([f.Property()],d.prototype,"keyField",void 0),o([f.Property()],d.prototype,"headerText",void 0),o([f.Property()],d.prototype,"template",void 0),o([f.Property(!1)],d.prototype,"allowToggle",void 0),o([f.Property(!0)],d.prototype,"isExpanded",void 0),o([f.Property()],d.prototype,"minCount",void 0),o([f.Property()],d.prototype,"maxCount",void 0),o([f.Property(!0)],d.prototype,"showItemCount",void 0),o([f.Property(!1)],d.prototype,"showAddButton",void 0),o([f.Property(!0)],d.prototype,"allowDrag",void 0),o([f.Property(!0)],d.prototype,"allowDrop",void 0),o([f.Property([])],d.prototype,"transitionColumns",void 0),d);function d(){return null!==fe&&fe.apply(this,arguments)||this}be=function(e,t){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var be,Ce,ge=function(e,t){function n(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},ge=(Ce=f.ChildProperty,ge(Se,Ce),o([f.Property()],Se.prototype,"text",void 0),o([f.Property()],Se.prototype,"keyFields",void 0),Se);function Se(){return null!==Ce&&Ce.apply(this,arguments)||this}we=function(e,t){return(we=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}))(e,t)};var we,ke,o=function(e,t){function n(){this.constructor=e}we(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},Ee=function(e,t,n,r){var a,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;0<=o;o--)(a=e[o])&&(l=(i<3?a(l):3<i?a(t,n,l):a(t,n))||l);return 3<i&&l&&Object.defineProperty(t,n,l),l},o=(ke=f.ChildProperty,o(De,ke),Ee([f.Property("Index")],De.prototype,"sortBy",void 0),Ee([f.Property()],De.prototype,"field",void 0),Ee([f.Property("Ascending")],De.prototype,"direction",void 0),De);function De(){return null!==ke&&ke.apply(this,arguments)||this}var Oe="e-kanban",xe="e-device",Ae="e-icons",Fe="e-template",Me="e-swimlane",Te="e-kanban-table",c="e-kanban-header",je="e-header-table",p="e-header-cells",qe="e-header-wrap",Re="e-header-title",He="e-header-text",Le="e-header-icon",Pe="e-stacked-header-row",Ie="e-stacked-header-cell",g="e-content-cells",h="e-kanban-content",Ne="e-content-table",Be="e-toggle-header",Ue="e-header-row",m="e-content-row",y="e-swimlane-row",ze="e-swimlane-row-expand",Ve="e-swimlane-row-collapse",_e="e-item-count",v="e-card-wrapper",Ke="e-card-virtual-wrapper",b="e-card",C="e-droppable",S="e-drag",We="e-drop",Ye="e-disabled",Qe="e-card-header",Xe="e-card-content",Ge="e-card-header-caption",Je="e-card-header-title",Ze="e-card-tags",$e="e-card-tag",et="e-card-color",tt="e-card-label",nt="e-card-footer",rt="e-empty-card",at="e-card-footer-css",it="e-column-expand",lt="e-column-collapse",ot="e-collapse-header-text",w="e-collapsed",st="e-kanban-dialog",dt="e-kanban-form",ct="e-kanban-error",pt="e-field",ht="e-target-dragged-clone",ut="e-cloned-card",gt="e-kanban-dragged-card",mt="e-target-dropped-clone",k="e-dropping",yt="e-kanban-border",ft="e-toggle-visible",vt="e-multi-card-wrapper",bt="e-target-multi-clone",Ct="e-column-key",E="e-selection",St="e-tooltip-text",D="e-swimlane-header",wt="e-swimlane-header-toolbar",kt="e-icon-menu",Et="e-toolbar-swimlane-name",Dt="e-swimlane-overlay",Ot="e-swimlane-content",xt="e-swimlane-resource",At="e-limits",Ft="e-max-count",Mt="e-min-count",Tt="e-max-color",jt="e-min-color",qt="e-close",Rt="e-popup-content",O="e-show-add-button",Ht="e-show-add-icon",Lt="e-show-add-focus",Pt="e-frozen-swimlane-row",It="e-frozen-row",Nt=(x.prototype.clickHandler=function(e){var t,n=f.closest(e.target,".e-card,.e-header-icon,.e-content-row.e-swimlane-row,.e-show-add-button,.e-frozen-swimlane-row,.e-content-row:not(.e-swimlane-row) .e-content-cells");n&&(n.classList.contains(b)?(this.parent.allowKeyboard&&this.parent.keyboardModule.cardTabIndexRemove(),this.cardClick(e)):n.classList.contains(Le)?this.columnExpandCollapse(e):n.classList.contains(m)&&n.classList.contains(y)?this.rowExpandCollapse(e):n.classList.contains(O)?this.addButtonClick(n):n.classList.contains(Pt)&&(n=[].slice.call(this.parent.element.querySelectorAll("."+y)),t=this.parent.layoutModule.frozenSwimlaneRow.querySelector("."+Ae),this.rowExpandCollapse(e,n[this.parent.layoutModule.frozenOrder]),!!t.classList.contains(Ve)?f.classList(t,[ze],[Ve]):f.classList(t,[Ve],[ze])))},x.prototype.addButtonClick=function(e){var t,n=this,r={};0===this.parent.kanbanData.length?r[this.parent.cardSettings.headerField]=1:"number"==typeof this.parent.kanbanData[0][this.parent.cardSettings.headerField]&&(t=this.parent.kanbanData.map(function(e){return parseInt(e[n.parent.cardSettings.headerField],10)}),r[this.parent.cardSettings.headerField]=Math.max.apply(Math,t)+1),r[this.parent.keyField]=f.closest(e,"."+g).getAttribute("data-key"),"Index"===this.parent.sortSettings.sortBy&&(r[this.parent.sortSettings.field]=1,f.closest(e,"."+g).querySelector("."+b))&&(t="Ascending"===this.parent.sortSettings.direction?(e.nextElementSibling.classList.contains(yt)?e.nextElementSibling:e).nextElementSibling.lastElementChild:(e.nextElementSibling.classList.contains(yt)?e.nextElementSibling:e).nextElementSibling.firstElementChild,t=this.parent.getCardDetails(t),r[this.parent.sortSettings.field]=t[this.parent.sortSettings.field]+1),0!==this.parent.kanbanData.length&&this.parent.swimlaneSettings.keyField&&f.closest(e,"."+m).previousElementSibling&&(r[this.parent.swimlaneSettings.keyField]=f.closest(e,"."+m).previousElementSibling.getAttribute("data-key")),this.parent.openDialog("Add",r)},x.prototype.doubleClickHandler=function(e){f.closest(e.target,"."+b)&&this.cardDoubleClick(e)},x.prototype.cardClick=function(t,e){var n=this,r=f.closest(e||t.target,"."+b),e=this.parent.getCardDetails(r);e&&(this.parent.activeCardData={data:e,element:r},this.parent.trigger(_,{data:e,element:r,cancel:!1,event:t},function(e){e.cancel||(r.classList.contains(E)&&"click"===t.type?(f.removeClass([r],E),(n.parent.enableVirtualization?n.parent.virtualLayoutModule:n.parent.layoutModule).disableAttributeSelection(r)):(e=t.ctrlKey,n.parent.isAdaptive&&n.parent.touchModule&&(e=n.parent.touchModule.mobilePopup&&n.parent.touchModule.tabHold||e),n.cardSelection(r,e,t.shiftKey)),n.parent.isAdaptive&&n.parent.touchModule&&n.parent.touchModule.updatePopupContent(),e=f.closest(r,"."+g),n.parent.allowKeyboard&&([].slice.call(e.querySelectorAll("."+b)).forEach(function(e){e.setAttribute("tabindex","0")}),n.parent.keyboardModule.addRemoveTabIndex("Remove")))}))},x.prototype.cardDoubleClick=function(e){var t=this,n=f.closest(e.target,"."+b),r=this.parent.getCardDetails(n),a=(this.parent.activeCardData={data:r,element:n},this.cardSelection(n,!1,!1),{data:r,element:n,cancel:!1,event:e});this.parent.trigger(K,a,function(e){e.cancel||t.parent.dialogModule.openDialog("Edit",a.data)})},x.prototype.rowExpandCollapse=function(e,t){var l=this,o=e instanceof HTMLElement?e:e.target,s=f.isNullOrUndefined(t)?o:t;this.parent.trigger(U,{cancel:!1,target:o,requestType:"rowExpandCollapse"},function(e){var t,n,r,a,i;e.cancel||(t=(e=f.closest(s,"."+y)).getAttribute("data-key"),n=l.parent.element.querySelector("."+m+":nth-child("+(e.rowIndex+2)+")"),r=e.querySelector("."+ze+",."+Ve),a=!!e.classList.contains(w),i=a?(f.removeClass([n,e],w),f.classList(r,[ze],[Ve]),l.parent.swimlaneToggleArray.splice(l.parent.swimlaneToggleArray.indexOf(t),1),"0"):(f.addClass([n,e],w),f.classList(r,[Ve],[ze]),l.parent.swimlaneToggleArray.push(t),"-1"),r.setAttribute("aria-label",a?t+" Expand":t+" Collapse"),e.setAttribute("aria-expanded",a.toString()),n.setAttribute("aria-expanded",a.toString()),[].slice.call(n.querySelectorAll("."+g)).forEach(function(e){e.setAttribute("tabindex",i)}),l.parent.notify(u,{}),l.parent.trigger(z,{target:o,requestType:"rowExpandCollapse"}))})},x.prototype.columnExpandCollapse=function(e){var n=this,r=e instanceof HTMLElement?e:e.target;this.parent.trigger(U,{cancel:!1,target:r,requestType:"columnExpandCollapse"},function(e){var t;e.cancel||(t=(e=f.closest(r,"."+p)).cellIndex,n.columnToggle(e),(e=n.parent.element.querySelectorAll("."+p+"."+w).length)===n.parent.columns.length-n.hideColumnKeys.length&&(e=n.parent.element.querySelector("."+p+":not(."+Ie+"):nth-child("+(t+1===e?1:t+2)+")"),f.addClass([e],w),n.columnToggle(e)),n.parent.notify(u,{}),n.parent.trigger(z,{target:r,requestType:"columnExpandCollapse"}))})},x.prototype.columnToggle=function(a){var t=this,n=a.cellIndex,e=[].slice.call(this.parent.element.querySelectorAll(".e-content-row:not(.e-swimlane-row)")),r="."+Te+" col:nth-child("+(n+1)+")",i=a.querySelector("."+it+",."+lt),r=[].slice.call(this.parent.element.querySelectorAll(r));if(a.classList.contains(w)){f.removeClass(r,w),this.parent.isAdaptive&&(this.parent.enableVirtualization?r.forEach(function(e){return e.style.width=f.formatUnit(t.parent.virtualLayoutModule.getWidth())}):r.forEach(function(e){return e.style.width=f.formatUnit(t.parent.layoutModule.getWidth())})),f.classList(i,[it],[lt]);for(var l=0,o=e;l<o.length;l++)!function(e){var t=e.querySelector("."+g+":nth-child("+(n+1)+")"),e=(f.removeClass([t,a],w),f.remove(t.querySelector("."+ot)),t.querySelector(".e-show-add-button"));e&&f.removeClass([e],w),a.setAttribute("aria-expanded","true"),t.setAttribute("aria-expanded","true"),[].slice.call(t.parentElement.querySelectorAll("."+w)).forEach(function(e){e=e.querySelector("."+ot);e.style.height="auto",e&&t.getBoundingClientRect().height<e.getBoundingClientRect().height+10&&(e.style.height=t.getBoundingClientRect().height-4+"px")})}(o[l]);0===this.parent.kanbanData.length&&0===e.length&&(f.removeClass([a],w),a.setAttribute("aria-expanded","true")),this.columnToggleArray.splice(this.columnToggleArray.indexOf(a.getAttribute("data-key")),1),this.parent.columns[n].setProperties({isExpanded:!0},!0),a.querySelector(".e-header-icon").setAttribute("aria-label",a.getAttribute("data-key")+" Expand")}else{f.addClass(r,w),this.parent.isAdaptive&&r.forEach(function(e){return e.style.width=f.formatUnit(50)}),f.classList(i,[lt],[it]);for(var s=a.getAttribute("data-key"),d=this,c=0,p=e;c<p.length;c++)!function(e){var t,n=e.querySelector("."+g+'[data-key="'+s+'"]'),e=n.cellIndex,r=n.querySelector(".e-show-add-button"),r=(r&&f.addClass([r],w),void 0);r=d.parent.enableVirtualization?(t=d.parent.dataModule.isRemote()?d.parent.columnDataCount[d.parent.columns[e].keyField]:d.parent.virtualLayoutModule.columnData[d.parent.columns[e].keyField].length,(d.parent.columns[e].showItemCount?"["+t+"] ":"")+d.parent.columns[e].headerText):(d.parent.columns[e].showItemCount?"["+n.querySelectorAll("."+b).length+"] ":"")+d.parent.columns[e].headerText,n.appendChild(f.createElement("div",{className:ot,innerHTML:r})),f.addClass([n,a],w),a.setAttribute("aria-expanded","false"),n.setAttribute("aria-expanded","false"),[].slice.call(n.parentElement.querySelectorAll("."+w)).forEach(function(e){e=e.querySelector("."+ot);e&&n.getBoundingClientRect().height<e.getBoundingClientRect().height+10&&(e.style.height=n.getBoundingClientRect().height-4+"px")})}(p[c]);0===this.parent.kanbanData.length&&0===e.length&&(f.addClass([a],w),a.setAttribute("aria-expanded","false")),this.columnToggleArray.push(a.getAttribute("data-key")),this.parent.columns[n].setProperties({isExpanded:!1},!0),a.querySelector(".e-header-icon").setAttribute("aria-label",s+" Collapse")}},x.prototype.cardSelection=function(e,t,n){var r=this;if(e){var a=this.parent.getSelectedCards();if("None"!==this.parent.cardSettings.selectionType){var i=f.closest(e,"."+m),l=(f.isNullOrUndefined(this.lastSelectionRow)?i:this.lastSelectionRow).rowIndex;if(l===i.rowIndex||!t&&!n||"Multiple"!==this.parent.cardSettings.selectionType)if(0===a.length||t&&"Single"!==this.parent.cardSettings.selectionType||(f.removeClass(a,E),(this.parent.enableVirtualization?this.parent.virtualLayoutModule:this.parent.layoutModule).disableAttributeSelection(a),a.forEach(function(e){r.selectionArray.splice(r.selectionArray.indexOf(e.getAttribute("data-id")),1),r.selectedCardsElement.splice(r.selectedCardsElement.indexOf(e),1),r.selectedCardsData.splice(r.selectedCardsData.indexOf(r.parent.getCardDetails(e),1))})),0<a.length&&n&&"Multiple"===this.parent.cardSettings.selectionType){var o=[],s=void 0,d=void 0,c=void 0,p=[].slice.call(i.querySelectorAll("."+b)),l=(p.forEach(function(e){return o.push(e.getAttribute("data-id"))}),e.getAttribute("data-id")),t=this.lastCard.getAttribute("data-id"),a=d=o.indexOf(l),n=s=o.indexOf(t),h=n<a?"next":"prev";for("prev"==h&&(s=a,d=n),c=s;c<=d;c++){var u=p[c];f.addClass([u],E),u.setAttribute("aria-selected","true"),u.setAttribute("tabindex","0"),this.selectionArray.push(u.getAttribute("data-id")),this.selectedCardsElement.push(u),this.selectedCardsData.push(this.parent.getCardDetails(u)),this.lastCardSelection=u,"prev"==h&&(this.lastCardSelection=p[s])}}else f.addClass([e],E),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),this.selectionArray.push(e.getAttribute("data-id")),this.selectedCardsElement.push(e),this.selectedCardsData.push(this.parent.getCardDetails(e)),this.lastCard=this.lastCardSelection=e,this.lastSelectionRow=f.closest(e,"."+m),this.lastSelectionRow.previousElementSibling&&(i=this.lastSelectionRow.previousElementSibling.querySelector(".e-swimlane-row-expand,.e-swimlane-row-collapse"))&&i.classList.contains(Ve)&&this.rowExpandCollapse(i)}}},x.prototype.addColumn=function(e,t){e=f.createInstance(ve,[this.parent,"columns",e,!0]);this.parent.columns.splice(t,0,e),this.parent.notify(i,{processedData:this.parent.kanbanData})},x.prototype.deleteColumn=function(e){var t=this.parent.element.querySelectorAll("."+p).item(e);t&&t.classList.contains(Be)&&this.columnToggleArray.splice(this.columnToggleArray.indexOf(t.getAttribute("data-key"),0)),this.parent.columns.splice(e,1),0===this.parent.columns.length?(f.detach(this.parent.element.querySelector("."+c)),f.detach(this.parent.element.querySelector("."+h))):this.parent.notify(i,{processedData:this.parent.kanbanData})},x.prototype.showColumn=function(e){e=this.hideColumnKeys.indexOf(e.toString());-1!==e&&(this.hideColumnKeys.splice(e,1),this.parent.notify(i,{processedData:this.parent.kanbanData}))},x.prototype.hideColumn=function(e){this.hideColumnKeys.push(e.toString()),this.parent.notify(i,{processedData:this.parent.kanbanData})},x.prototype.SingleCardSelection=function(e){"None"!==this.parent.cardSettings.selectionType&&e[this.parent.cardSettings.headerField]&&(e=this.parent.element.querySelector('.e-card[data-id="'+e[this.parent.cardSettings.headerField].toString()+'"]'))&&(f.addClass([e],E),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"))},x);function x(e){this.parent=e,this.columnToggleArray=[],this.selectionArray=[],this.lastCardSelection=null,this.lastSelectionRow=null,this.lastCard=null,this.selectedCardsElement=[],this.selectedCardsData=[],this.hideColumnKeys=[]}Ut.prototype.addCard=function(r,a){var i=this,e={cancel:!1,requestType:"cardCreate",addedRecords:r instanceof Array?r:[r],changedRecords:[],deletedRecords:[]};this.parent.trigger(U,e,function(e){var n,t;e.cancel||(n=[],i.parent.sortSettings.field&&"Index"===i.parent.sortSettings.sortBy&&(r instanceof Array?n=r:n.push(r),n.forEach(function(e,t){var n;e[i.parent.sortSettings.field]||(n=i.parent.getColumnData(e[i.parent.keyField]),"Ascending"===i.parent.sortSettings.direction&&0<n.length?e[i.parent.sortSettings.field]=n[n.length-1][i.parent.sortSettings.field]+t+1:"Descending"===i.parent.sortSettings.direction&&0<n.length&&(e[i.parent.sortSettings.field]=n[0][i.parent.sortSettings.field]+t+1),0===n.length&&(e[i.parent.sortSettings.field]=1))}),r instanceof Array||a||"Descending"!==i.parent.sortSettings.direction||i.parent.getColumnData(n[0][i.parent.keyField]).filter(function(e,t){e[i.parent.sortSettings.field]===n[0][i.parent.sortSettings.field]&&(a=t+1)}),0===a||a||"Descending"!==i.parent.sortSettings.direction||(a=0),n=i.priorityOrder(n,a)),i.parent.enableHtmlSanitizer&&(e=i.parent.cardSettings.contentField,i.parent.enableHtmlSanitizer)&&"string"==typeof e&&(r[e]=f.SanitizeHtmlHelper.sanitize(r[e])),e={addedRecords:r instanceof Array?r:[r],changedRecords:i.parent.sortSettings.field&&"Index"===i.parent.sortSettings.sortBy?n:[],deletedRecords:[]},t=r instanceof Array||0<n.length?"batch":"insert",i.parent.dataModule.updateDataManager(t,e,"cardCreated",r,a))})},Ut.prototype.getIndexFromData=function(e){var e=this.parent.element.querySelector('.e-card[data-id="'+e[this.parent.cardSettings.headerField]+'"]'),t=f.closest(e,"."+g);return[].slice.call(t.querySelectorAll("."+b)).indexOf(e)},Ut.prototype.updateCard=function(n,r,a,i,l,o,s){var d=this,e={requestType:"cardChange",cancel:!1,addedRecords:[],changedRecords:n instanceof Array?n:[n],deletedRecords:[]};r=f.isNullOrUndefined(r)?this.getIndexFromData(e.changedRecords[0]):r,this.parent.trigger(U,e,function(e){var t;e.cancel||(d.parent.sortSettings.field&&"Index"===d.parent.sortSettings.sortBy&&(e=[],n instanceof Array?e=n:e.push(n),n=d.priorityOrder(e,r)),e={addedRecords:[],changedRecords:n instanceof Array?n:[n],deletedRecords:[]},t=n instanceof Array?"batch":"update",d.parent.dataModule.updateDataManager(t,e,"cardChanged",n,r,a,i,l,o,s))})},Ut.prototype.deleteCard=function(t){var n=this,r={addedRecords:[],changedRecords:[],deletedRecords:[]},e=(r.deletedRecords="string"==typeof t||"number"==typeof t?this.parent.kanbanData.filter(function(e){return e[n.parent.cardSettings.headerField]===t}):t instanceof Array?t:[t],{requestType:"cardRemove",cancel:!1,addedRecords:[],changedRecords:[],deletedRecords:r.deletedRecords});this.parent.trigger(U,e,function(e){e.cancel||(e=1<r.deletedRecords.length?"batch":"delete",n.parent.dataModule.updateDataManager(e,r,"cardRemoved",r.deletedRecords[0]))})},Ut.prototype.priorityOrder=function(o,s){for(var d,c=this,p=o.map(function(e){return e[c.parent.cardSettings.headerField]}),h=o[o.length-1][this.parent.sortSettings.field],n=o.map(function(e){return e[c.parent.keyField]}),e=n.filter(function(e,t){return n.indexOf(e)===t}).sort(),u=[],g=[],t=function(t){var e=o.filter(function(e){return e[c.parent.keyField]===t});d=(m.parent.enableVirtualization?m.parent.virtualLayoutModule:m.parent.layoutModule).getColumnData(t);for(var n=0,r=e;n<r.length;n++){var a=r[n];m.parent.swimlaneSettings.keyField&&(a=m.parent.getSwimlaneData(a[m.parent.swimlaneSettings.keyField]),d=m.parent.getColumnData(t,a))}if(e.forEach(function(e){return u.push(e)}),!f.isNullOrUndefined(s)){for(var i=0;i<p.length;i++)!function(n){d.filter(function(e,t){e[c.parent.cardSettings.headerField]===p[n]&&t<=s&&g.push(t)})}(i);if(0<g.length&&(s+=g.length),"Ascending"===m.parent.sortSettings.direction)for(var l=s;l<d.length;l++)-1===p.indexOf(d[l][m.parent.cardSettings.headerField])&&(d[l][m.parent.sortSettings.field]=++h,u.push(d[l]));else for(l=s-1;0<=l;l--)-1===p.indexOf(d[l][m.parent.cardSettings.headerField])&&(d[l][m.parent.sortSettings.field]=++h,u.push(d[l]))}},m=this,r=0,a=e;r<a.length;r++)t(a[r]);return u};var Bt=Ut;function Ut(e){this.parent=e}A.prototype.wireDragEvents=function(e){var t;null!=!this.parent.element&&0===this.parent.externalDropId.length&&(t=this.parent.element.querySelector("."+h)),this.dragObj.instance=new f.Draggable(e,{clone:!0,enableTapHold:this.parent.isAdaptive,tapHoldThreshold:400,enableTailMode:!0,cursorAt:{top:-10,left:-10},dragArea:t,dragStart:this.dragStart.bind(this),drag:this.drag.bind(this),dragStop:this.dragStop.bind(this),enableAutoScroll:!1,helper:this.dragHelper.bind(this)})},A.prototype.dragHelper=function(e){if(this.parent.isAdaptive&&this.parent.touchModule.mobilePopup&&this.parent.touchModule.mobilePopup.element.classList.contains("e-popup-open")&&this.parent.touchModule.mobilePopup.hide(),this.dragObj.element=f.closest(e.sender.target,"."+b),f.isNullOrUndefined(this.dragObj.element))return null;this.dragObj.element.style.width=f.formatUnit(this.dragObj.element.offsetWidth);e=f.createElement("div",{innerHTML:this.dragObj.element.outerHTML});return this.dragObj.cloneElement=e.children.item(0),f.addClass([this.dragObj.cloneElement],ut),this.dragObj.element.parentElement.appendChild(this.dragObj.cloneElement),this.dragObj.targetCloneMulti=f.createElement("div",{className:bt}),this.dragObj.targetClone=f.createElement("div",{className:mt,styles:"width:100%;height:"+f.formatUnit(this.dragObj.element.offsetHeight)}),this.dragObj.modifiedData=[],this.dragObj.cloneElement},A.prototype.dragStart=function(t){var n=this,e=(this.dragObj.selectedCards=this.dragObj.element,this.borderElm=this.parent.element.querySelectorAll("."+yt),this.dragObj.element.classList.contains(E)?(e=f.closest(this.dragObj.element,"."+m),this.dragObj.selectedCards=[].slice.call(e.querySelectorAll(".e-card.e-selection:not(.e-cloned-card)")),this.dragObj.selectedCards.forEach(function(e){n.dragObj.cardDetails.push(n.parent.getCardDetails(e))})):this.dragObj.cardDetails=[this.parent.getCardDetails(this.dragObj.element)],!f.isNullOrUndefined(this.dragObj.selectedCards)&&!f.isNullOrUndefined(this.dragObj.selectedCards.length)&&1<=this.dragObj.selectedCards.length?this.dragObj.selectedCards[0].closest(".e-content-cells").classList.add("e-dragged-column"):f.isNullOrUndefined(this.dragObj.selectedCards)||f.isNullOrUndefined(this.dragObj.selectedCards.closest(".e-content-cells"))||this.dragObj.selectedCards.closest(".e-content-cells").classList.add("e-dragged-column"),{cancel:!1,data:this.dragObj.cardDetails,event:t,element:this.dragObj.selectedCards});this.parent.trigger(G,e,function(e){e.cancel?(n.removeElement(n.dragObj.cloneElement),n.dragObj.instance.intDestroy(t),n.dragObj.element=null,n.dragObj.targetClone=null,n.dragObj.draggedClone=null,n.dragObj.cloneElement=null,n.dragObj.targetCloneMulti=null):(n.dragObj.element.classList.contains(E)?(n.dragObj.selectedCards.forEach(function(e){n.draggedClone(e)}),1<n.dragObj.selectedCards.length&&(n.dragObj.cloneElement.innerHTML="",e=f.createElement("div",{className:"e-multi-card-text",innerHTML:n.dragObj.selectedCards.length+" "+n.parent.localeObj.getConstant("cards")}),n.dragObj.cloneElement.appendChild(e),f.classList(n.dragObj.cloneElement,["e-multi-card-clone"],[E]),(n.parent.enableVirtualization?n.parent.virtualLayoutModule:n.parent.layoutModule).disableAttributeSelection(n.dragObj.cloneElement),n.dragObj.cloneElement.style.width="90px")):n.draggedClone(n.dragObj.element),f.EventHandler.add(document.body,"keydown",n.keydownHandler,n),n.parent.notify(u,{}))})},A.prototype.draggedClone=function(e){this.dragObj.draggedClone=f.createElement("div",{className:ht,styles:"width:"+f.formatUnit(e.offsetWidth-1)+";height:"+f.formatUnit(e.offsetHeight)}),e.insertAdjacentElement("afterend",this.dragObj.draggedClone),f.addClass([e],gt)},A.prototype.drag=function(e){var t=this;if(e.target){var n,r,a=f.closest(e.target,"."+Oe+" ."+b),i=(f.isNullOrUndefined(a)||!this.parent.enableVirtualization||f.isNullOrUndefined(e.target.previousElementSibling)||f.isNullOrUndefined(e.target.previousElementSibling.querySelector(".e-target-dropped-clone"))||(a=e.target.previousElementSibling.querySelector(".e-target-dropped-clone").nextElementSibling),e.target),i=(f.isNullOrUndefined(e.target.parentElement)||("SPAN"===e.target.nodeName&&e.target.classList.contains("e-empty-card")||"DIV"===e.target.nodeName&&e.target.classList.contains("e-kanban-border")&&this.parent.element.querySelector(".e-target-dropped-clone")!==e.target.nextElementSibling.firstChild)&&(i=e.target.parentElement),a||i),l=f.closest(i,".e-content-row:not(.e-swimlane-row) .e-content-cells.e-droppable");if(i.nextElementSibling&&i.nextElementSibling.lastChild&&(h=i.nextElementSibling.lastChild.previousElementSibling),this.externalDrop(i),this.kanbanObj=this.parent.isExternalKanbanDrop?this.parent.externalDropObj:this.parent,this.calculateArgs(e),l&&"not-allowed"!==document.body.style.cursor){var o=this.getColumnKey(l),s=o.split(","),o=(this.multiCloneRemove(),o===this.getColumnKey(f.closest(this.dragObj.draggedClone,"."+g)));if(1===s.length||o)if(i.classList.contains(ht)&&this.removeElement(this.dragObj.targetClone,this.kanbanObj),i.classList.contains(b)||"beforebegin"===this.insertClone){o=i.classList.contains(ht)&&i.previousElementSibling.classList.contains(gt)?null:i.previousElementSibling;this.insertClone="afterend",f.isNullOrUndefined(o)&&(o=i.classList.contains(ht)?this.dragObj.pageY/2:this.dragObj.pageY,d=i.classList.contains(ht)?i.offsetHeight:i.offsetHeight/2,(o-=c=this.kanbanObj.element.getBoundingClientRect().top+window.scrollY)-(i.getBoundingClientRect().top+window.scrollY-c)<d)&&(this.insertClone="beforebegin"),i.classList.contains(b)&&(this.parent.enableVirtualization&&(this.insertClone=this.isTargetElementVisible(i)?this.insertClone:"beforebegin"),i.insertAdjacentElement(this.insertClone,this.dragObj.targetClone))}else if(i.classList.contains(g)&&!f.closest(i,"."+y)){if(0!==i.querySelectorAll("."+gt).length&&0===i.querySelectorAll(".e-card:not(.e-kanban-dragged-card):not(.e-cloned-card)").length)return;i.querySelector("."+v).appendChild(this.dragObj.targetClone)}else!i.classList.contains(v)&&!i.classList.contains(Ke)||f.closest(i,"."+y)||0!==l.querySelectorAll("."+b).length?!(i.classList.contains(yt)&&!f.closest(i,"."+y)&&i.nextElementSibling&&i.nextElementSibling.classList.contains(v)&&this.dragObj.targetClone)||h&&h.classList.contains(mt)||this.parent.enableVirtualization||this.isTargetElementVisible(i.nextElementSibling)||i.nextElementSibling.appendChild(this.dragObj.targetClone):i.appendChild(this.dragObj.targetClone);else 1<s.length&&(l.classList.contains(k)||l.firstChild&&l.firstChild.classList.contains(k))&&this.multiCloneCreate(s,l);this.kanbanObj.notify(u,{})}0===this.kanbanObj.element.querySelectorAll("."+k).length&&this.cellDropping();var d,o=!1,c=(l&&(o=l.classList.contains(w)&&l.classList.contains(k),"true"!==l.getAttribute("aria-expanded")&&l.parentElement.hasAttribute("aria-expanded")||(n=l.getBoundingClientRect(),this.updateDimension(n)),r=l.querySelector("."+yt)),i&&"TABLE"===i.tagName&&!f.isNullOrUndefined(i.querySelector("."+m))&&(n=i.querySelector("."+m).getBoundingClientRect(),this.updateDimension(n,i)),o&&(this.toggleVisible(i),f.addClass([l],ft)),[].slice.call(this.kanbanObj.element.querySelectorAll("."+ft))),p=(0<c.length&&!i.classList.contains(ft)&&!f.closest(i,"."+ft)&&(this.toggleVisible(i,c.slice(-1)[0]),f.removeClass(c,ft)),this.kanbanObj.notify(u,{}),f.closest(i,"."+Ct)),h=(p&&0<(d=[].slice.call(this.kanbanObj.element.querySelectorAll("."+Ct+":not(."+Ye+")")).filter(function(e){return t.getColumnKey(e)===t.getColumnKey(p)})).length&&(f.addClass(d,"e-multi-active"),d[0].previousElementSibling)&&f.addClass([d[0].previousElementSibling],"e-multi-bottom-border"),document.body.style.cursor=l&&l.classList.contains(k)||l&&r&&r.classList.contains(k)?"":"not-allowed",!a||f.closest(a,"."+g).classList.contains(k)||l&&r&&r.classList.contains(k)||(a.style.cursor="not-allowed",document.body.style.cursor="not-allowed"),this.isExternalDrop&&"not-allowed"===document.body.style.cursor&&(document.body.style.cursor=""),"not-allowed"===document.body.style.cursor&&(this.removeElement(this.dragObj.targetClone,this.kanbanObj),this.multiCloneRemove()),this.updateScrollPosition(),{data:this.dragObj.cardDetails,event:e,element:this.dragObj.selectedCards});this.kanbanObj.trigger(J,h),this.parent.isExternalKanbanDrop=!1,this.isExternalDrop=!1}},A.prototype.removeElement=function(e,t){0<(t=t||this.parent).element.getElementsByClassName(e.className).length&&f.remove(e)},A.prototype.isTargetElementVisible=function(e){var t=f.closest(e,"."+v);return!(!f.isNullOrUndefined(t)&&t.getBoundingClientRect().bottom<e.getBoundingClientRect().bottom)},A.prototype.externalDrop=function(n){var r=this;this.parent.externalDropId.forEach(function(e){var t=f.closest(n,e);t&&(t.classList.contains("e-kanban")?(r.parent.externalDropObj=document.querySelector(e).ej2_instances[0],r.parent.isExternalKanbanDrop=!0,t=[].slice.call(r.parent.externalDropObj.element.querySelectorAll(".e-content-row:not(.e-swimlane-row):not(.e-collapsed) .e-content-cells")),f.addClass(t,k)):r.isExternalDrop=!0)})},A.prototype.multiCloneCreate=function(e,t){var n=t.offsetHeight,r=t.querySelector("."+At);r&&(n-=r.offsetHeight),this.dragObj.targetCloneMulti.style.height=f.formatUnit(n),t.querySelector("."+O)&&f.addClass([t.querySelector("."+O)],vt),f.addClass([t.querySelector("."+v)],vt),t.querySelector("."+v).style.height="auto",t.style.borderStyle="none",this.removeElement(this.dragObj.targetClone);for(var a=0,i=e;a<i.length;a++){var l=i[a],o=f.closest(this.dragObj.draggedClone,"."+g),o=this.kanbanObj.columns[o.cellIndex].transitionColumns,o=this.allowedTransition(this.dragObj.element.getAttribute("data-key"),l,o),s=f.createElement("div",{className:Ct+(o?"":" "+Ye),attrs:{"data-key":l.trim()}}),l=f.createElement("div",{className:"e-text",innerHTML:l.trim()});t.appendChild(this.dragObj.targetCloneMulti).appendChild(s).appendChild(l),s.style.cursor=o?"":"not-allowed",s.style.lineHeight=s.style.height=f.formatUnit(n/e.length),l.style.top=f.formatUnit(n/2-l.offsetHeight/2)}},A.prototype.allowedTransition=function(e,t,n){for(var r=!0,a=t.split(","),i=0;i<a.length;i++){if(e===a[i].trim())return!0;if(n){if(1===n.length&&0===n[0].length)return!0;for(var l=0;l<n.length;l++){if(a[i].trim()===n[l].trim())return!0;r=!1}}}return r},A.prototype.cellDropping=function(){var e,t=this,n=f.closest(this.dragObj.draggedClone,"."+g),r=f.closest(this.dragObj.draggedClone,"."+m);n&&n.classList.contains(We)&&f.addClass([n],k),this.addDropping(r,n),this.kanbanObj.swimlaneSettings.keyField&&this.kanbanObj.swimlaneSettings.allowDragAndDrop&&(e=[].slice.call(this.kanbanObj.element.querySelectorAll(".e-content-row:not(.e-swimlane-row):not(.e-collapsed)")),[].slice.call(e).forEach(function(e){r!==e&&t.addDropping(e,n)}))},A.prototype.addDropping=function(e,n){var t,r=this;n&&this.borderElm&&0!==this.borderElm.length?(n.classList.contains(k)&&f.removeClass([n],k),t=n.getBoundingClientRect(),this.updateDimension(t)):n&&e&&[].slice.call(e.children).forEach(function(e){var t=r.kanbanObj.columns[n.cellIndex].transitionColumns;e!==n&&e.classList.contains(We)&&r.allowedTransition(n.getAttribute("data-key"),e.getAttribute("data-key"),t)&&f.addClass([e],k)})},A.prototype.updateDimension=function(n,r){[].slice.call(this.borderElm).forEach(function(e){!e.parentElement||"true"!==e.parentElement.getAttribute("aria-expanded")&&e.parentElement.hasAttribute("aria-expanded")||f.addClass([e],k);var t=e.previousElementSibling;e.style.height=parseInt(n.height.toString(),10)-(t&&t.classList.contains(O)?t.offsetHeight+t.offsetTop:0)+"px",r&&"TABLE"===r.tagName||(e.style.width=parseInt(n.width.toString(),10)+"px"),e.style.left=e.parentElement.getBoundingClientRect().left-f.closest(e,".e-kanban").getBoundingClientRect().left+"px"})},A.prototype.keydownHandler=function(e){"Escape"===e.code&&this.dragObj.cloneElement&&(f.EventHandler.remove(document.body,"keydown",this.keydownHandler),this.dragObj.element.removeAttribute("aria-grabbed"),this.dragStopClear(),this.dragStopPostClear())},A.prototype.dragStop=function(e){var a,i,l,t,n,o=this,s=f.closest(this.dragObj.targetClone,"."+g),e=(this.parent.enableVirtualization&&!f.isNullOrUndefined(s)&&s.classList.add("e-dropped-column"),f.EventHandler.remove(document.body,"keydown",this.keydownHandler),[].slice.call(this.borderElm).forEach(function(e){e.classList.remove(k)}),this.dragObj.targetClone.parentElement&&(t=(l=this.dragObj.selectedCards&&1<this.dragObj.selectedCards.length&&"Index"===this.parent.sortSettings.sortBy)?".e-card:not(."+ut+"),."+mt:".e-card:not(."+gt+", ."+ut+"),."+mt,t=[].slice.call(this.dragObj.targetClone.parentElement.querySelectorAll(t)).indexOf(this.dragObj.targetClone),this.parent.enableVirtualization)&&!f.isNullOrUndefined(this.dragObj.targetClone.nextElementSibling)&&(i=this.dragObj.targetClone.nextElementSibling.getAttribute("data-id")),!f.isNullOrUndefined(this.kanbanObj)&&this.kanbanObj.element.querySelector("."+bt)&&(a=f.closest(e.target,"."+Ct+":not(."+Ye+")")),(s||a)&&(s?n=this.getColumnKey(s):(n=this.getColumnKey(a),s=f.closest(a,"."+g)),this.dragObj.selectedCards instanceof HTMLElement?this.updateDroppedData(this.dragObj.selectedCards,n,s):this.dragObj.selectedCards.forEach(function(e){o.updateDroppedData(e,n,s)}),this.parent.sortSettings.field)&&"Index"===this.parent.sortSettings.sortBy&&this.changeOrder(this.dragObj.modifiedData,e.helper),0===this.dragObj.modifiedData.length&&(this.dragObj.modifiedData=this.dragObj.cardDetails),{cancel:!1,data:this.dragObj.modifiedData,event:e,element:this.dragObj.selectedCards,dropIndex:t});this.parent.trigger(Z,e,function(e){var t,n,r;o.dragStopClear(),e.cancel||(s||a)&&(t=e.data instanceof Array&&1<e.data.length?e.data:e.data[0],r=n=void 0,o.parent.enableVirtualization&&(n=s.closest(".e-kanban").querySelector(".e-dragged-column").getAttribute("data-key"),r=s.getAttribute("data-key")),o.parent.crudModule.updateCard(t,e.dropIndex,!0,i,n,r,l),o.parent.enableVirtualization)&&(o.parent.virtualLayoutModule.refreshColumnData(n,r),o.parent.virtualLayoutModule.ensureColumnNotEmpty(n)),o.removeEmptyTrElement(),o.dragStopPostClear()})},A.prototype.removeEmptyTrElement=function(){if(!this.parent.swimlaneSettings.showEmptyRow)for(var e=this.parent.element.querySelectorAll(".e-content-row.e-swimlane-row"),t=0;t<e.length;t++){var n=e[t].nextElementSibling.querySelectorAll(".e-card-wrapper .e-card");f.isNullOrUndefined(e[t].nextElementSibling)||0!==n.length||(f.detach(e[t].nextElementSibling),f.detach(e[t]))}},A.prototype.dragStopClear=function(){this.removeElement(this.dragObj.draggedClone),this.removeElement(this.dragObj.targetClone,this.kanbanObj),this.removeElement(this.dragObj.cloneElement),[].slice.call(this.parent.element.querySelectorAll("."+ht)).forEach(function(e){f.remove(e)}),this.dragObj.element.style.removeProperty("width"),this.multiCloneRemove(),this.dragObj.selectedCards instanceof HTMLElement?f.removeClass([this.dragObj.selectedCards],gt):f.removeClass(this.dragObj.selectedCards,gt),clearInterval(this.dragObj.navigationInterval),this.dragObj.navigationInterval=null,"not-allowed"===document.body.style.cursor&&(document.body.style.cursor="");[].slice.call(this.parent.element.querySelectorAll(".e-card[style]")).forEach(function(e){e.style.cursor=""});var e="."+m+":not(."+y+")";[].slice.call(this.parent.element.querySelectorAll(e+" ."+g)).forEach(function(e){ret