tabulator-tables
Version:
Interactive table generation JavaScript library
2 lines • 368 kB
JavaScript
/* Tabulator v4.9.3 (c) Oliver Folkerd */
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=e[n];if(t.call(i,s,n,e))return n;n++}return-1}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),o=e.length>>>0;if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var i=arguments[1],n=0;n<o;){var s=e[n];if(t.call(i,s,n,e))return s;n++}}}),String.prototype.includes||(String.prototype.includes=function(t,e){if(t instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===e&&(e=0),-1!==this.indexOf(t,e)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),i=o.length>>>0;if(0===i)return!1;var n,s,a=0|e,r=Math.max(a>=0?a:i-Math.abs(a),0);for(;r<i;){if((n=o[r])===(s=t)||"number"==typeof n&&"number"==typeof s&&isNaN(n)&&isNaN(s))return!0;r++}return!1}}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}return o},writable:!0,configurable:!0});var ColumnManager=function(t){this.table=t,this.blockHozScrollEvent=!1,this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.rowManager=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.element.insertBefore(this.headersElement,this.element.firstChild)};ColumnManager.prototype.createHeadersElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-headers"),t},ColumnManager.prototype.createHeaderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-header"),this.table.options.headerVisible||t.classList.add("tabulator-header-hidden"),t},ColumnManager.prototype.initialize=function(){},ColumnManager.prototype.setRowManager=function(t){this.rowManager=t},ColumnManager.prototype.getElement=function(){return this.element},ColumnManager.prototype.getHeadersElement=function(){return this.headersElement},ColumnManager.prototype.scrollHorizontal=function(t){var e=0,o=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=t,t>o?(e=t-o,this.element.style.marginLeft=-e+"px"):this.element.style.marginLeft=0,this.scrollLeft=t,this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.scrollHorizontal()},ColumnManager.prototype.generateColumnsFromRowData=function(t){var e,o,i=[],n=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var s in e=t[0]){var a={field:s,title:s},r=e[s];switch(void 0===r?"undefined":_typeof(r)){case"undefined":o="string";break;case"boolean":o="boolean";break;case"object":o=Array.isArray(r)?"array":"string";break;default:o=isNaN(r)||""===r?r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}a.sorter=o,i.push(a)}if(n)switch(void 0===n?"undefined":_typeof(n)){case"function":this.table.options.columns=n.call(this.table,i);break;case"object":Array.isArray(n)?i.forEach((function(t){var e=n.find((function(e){return e.field===t.field}));e&&Object.assign(t,e)})):i.forEach((function(t){n[t.field]&&Object.assign(t,n[t.field])})),this.table.options.columns=i}else this.table.options.columns=i;this.setColumns(this.table.options.columns)}},ColumnManager.prototype.setColumns=function(t,e){for(var o=this;o.headersElement.firstChild;)o.headersElement.removeChild(o.headersElement.firstChild);o.columns=[],o.columnsByIndex=[],o.columnsByField={},o.table.modExists("frozenColumns")&&o.table.modules.frozenColumns.reset(),t.forEach((function(t,e){o._addColumn(t)})),o._reIndexColumns(),o.table.options.responsiveLayout&&o.table.modExists("responsiveLayout",!0)&&o.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!1,!0),o.redraw(!0)},ColumnManager.prototype._addColumn=function(t,e,o){var i=new Column(t,this),n=i.getElement(),s=o?this.findColumnIndex(o):o;if(o&&s>-1){var a=this.columns.indexOf(o.getTopColumn()),r=o.getElement();e?(this.columns.splice(a,0,i),r.parentNode.insertBefore(n,r)):(this.columns.splice(a+1,0,i),r.parentNode.insertBefore(n,r.nextSibling))}else e?(this.columns.unshift(i),this.headersElement.insertBefore(i.getElement(),this.headersElement.firstChild)):(this.columns.push(i),this.headersElement.appendChild(i.getElement())),i.columnRendered();return i},ColumnManager.prototype.registerColumnField=function(t){t.definition.field&&(this.columnsByField[t.definition.field]=t)},ColumnManager.prototype.registerColumnPosition=function(t){this.columnsByIndex.push(t)},ColumnManager.prototype._reIndexColumns=function(){this.columnsByIndex=[],this.columns.forEach((function(t){t.reRegisterPosition()}))},ColumnManager.prototype._verticalAlignHeaders=function(){var t=this,e=0;t.columns.forEach((function(t){var o;t.clearVerticalAlign(),(o=t.getHeight())>e&&(e=o)})),t.columns.forEach((function(o){o.verticalAlign(t.table.options.columnHeaderVertAlign,e)})),t.rowManager.adjustTableSize()},ColumnManager.prototype.findColumn=function(t){return"object"!=(void 0===t?"undefined":_typeof(t))?this.columnsByField[t]||!1:t instanceof Column?t:t instanceof ColumnComponent?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.columns.find((function(e){return e.element===t}))||!1},ColumnManager.prototype.getColumnByField=function(t){return this.columnsByField[t]},ColumnManager.prototype.getColumnsByFieldRoot=function(t){var e=this,o=[];return Object.keys(this.columnsByField).forEach((function(i){i.split(".")[0]===t&&o.push(e.columnsByField[i])})),o},ColumnManager.prototype.getColumnByIndex=function(t){return this.columnsByIndex[t]},ColumnManager.prototype.getFirstVisibileColumn=function(t){return(t=this.columnsByIndex.findIndex((function(t){return t.visible})))>-1&&this.columnsByIndex[t]},ColumnManager.prototype.getColumns=function(){return this.columns},ColumnManager.prototype.findColumnIndex=function(t){return this.columnsByIndex.findIndex((function(e){return t===e}))},ColumnManager.prototype.getRealColumns=function(){return this.columnsByIndex},ColumnManager.prototype.traverse=function(t){this.columnsByIndex.forEach((function(e,o){t(e,o)}))},ColumnManager.prototype.getDefinitions=function(t){var e=[];return this.columnsByIndex.forEach((function(o){(!t||t&&o.visible)&&e.push(o.getDefinition())})),e},ColumnManager.prototype.getDefinitionTree=function(){var t=[];return this.columns.forEach((function(e){t.push(e.getDefinition(!0))})),t},ColumnManager.prototype.getComponents=function(t){var e=[];return(t?this.columns:this.columnsByIndex).forEach((function(t){e.push(t.getComponent())})),e},ColumnManager.prototype.getWidth=function(){var t=0;return this.columnsByIndex.forEach((function(e){e.visible&&(t+=e.getWidth())})),t},ColumnManager.prototype.moveColumn=function(t,e,o){this.moveColumnActual(t,e,o),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),e.element.parentNode.insertBefore(t.element,e.element),o&&e.element.parentNode.insertBefore(e.element,t.element),this._verticalAlignHeaders(),this.table.rowManager.reinitialize()},ColumnManager.prototype.moveColumnActual=function(t,e,o){t.parent.isGroup?this._moveColumnInArray(t.parent.columns,t,e,o):this._moveColumnInArray(this.columns,t,e,o),this._moveColumnInArray(this.columnsByIndex,t,e,o,!0),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize(!0),this.table.options.columnMoved&&this.table.options.columnMoved.call(this.table,t.getComponent(),this.table.columnManager.getComponents()),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns")},ColumnManager.prototype._moveColumnInArray=function(t,e,o,i,n){var s,a=this,r=t.indexOf(e),l=[];r>-1&&(t.splice(r,1),(s=t.indexOf(o))>-1?i&&(s+=1):s=r,t.splice(s,0,e),n&&(this.table.options.dataTree&&this.table.modExists("dataTree",!0)&&this.table.rowManager.rows.forEach((function(t){l=l.concat(a.table.modules.dataTree.getTreeChildren(t,!1,!0))})),(l=l.concat(this.table.rowManager.rows)).forEach((function(t){if(t.cells.length){var e=t.cells.splice(r,1)[0];t.cells.splice(s,0,e)}}))))},ColumnManager.prototype.scrollToColumn=function(t,e,o){var i=this,n=0,s=0,a=0,r=t.getElement();return new Promise((function(l,u){if(void 0===e&&(e=i.table.options.scrollToColumnPosition),void 0===o&&(o=i.table.options.scrollToColumnIfVisible),t.visible){switch(e){case"middle":case"center":a=-i.element.clientWidth/2;break;case"right":a=r.clientWidth-i.headersElement.clientWidth}if(!o&&(s=r.offsetLeft)>0&&s+r.offsetWidth<i.element.clientWidth)return!1;n=r.offsetLeft+a,n=Math.max(Math.min(n,i.table.rowManager.element.scrollWidth-i.table.rowManager.element.clientWidth),0),i.table.rowManager.scrollHorizontal(n),i.scrollHorizontal(n),l()}else console.warn("Scroll Error - Column not visible"),u("Scroll Error - Column not visible")}))},ColumnManager.prototype.generateCells=function(t){var e=[];return this.columnsByIndex.forEach((function(o){e.push(o.generateCell(t))})),e},ColumnManager.prototype.getFlexBaseWidth=function(){var t=this,e=t.table.element.clientWidth,o=0;return t.rowManager.element.scrollHeight>t.rowManager.element.clientHeight&&(e-=t.rowManager.element.offsetWidth-t.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,s,a;i.visible&&(n=i.definition.width||0,s=void 0===i.minWidth?t.table.options.columnMinWidth:parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,o+=a>s?a:s)})),o},ColumnManager.prototype.addColumn=function(t,e,o){var i=this;return new Promise((function(n,s){var a=i._addColumn(t,e,o);i._reIndexColumns(),i.table.options.responsiveLayout&&i.table.modExists("responsiveLayout",!0)&&i.table.modules.responsiveLayout.initialize(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.redraw(!0),"fitColumns"!=i.table.modules.layout.getMode()&&a.reinitializeWidth(),i._verticalAlignHeaders(),i.table.rowManager.reinitialize(),i.table.options.virtualDomHoz&&i.table.vdomHoz.reinitialize(),n(a)}))},ColumnManager.prototype.deregisterColumn=function(t){var e,o=t.getField();o&&delete this.columnsByField[o],(e=this.columnsByIndex.indexOf(t))>-1&&this.columnsByIndex.splice(e,1),(e=this.columns.indexOf(t))>-1&&this.columns.splice(e,1),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.initialize(),this._verticalAlignHeaders(),this.redraw()},ColumnManager.prototype.redraw=function(t){t&&(Tabulator.prototype.helpers.elVisible(this.element)&&this._verticalAlignHeaders(),this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),["fitColumns","fitDataStretch"].indexOf(this.table.modules.layout.getMode())>-1||t?this.table.modules.layout.layout():this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout(),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.recalc(this.table.rowManager.activeRows),t&&(this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),this.table.modExists("columnCalcs")&&this.table.modules.columnCalcs.redraw()),this.table.footerManager.redraw()};var ColumnComponent=function(t){this._column=t,this.type="ColumnComponent"};ColumnComponent.prototype.getElement=function(){return this._column.getElement()},ColumnComponent.prototype.getDefinition=function(){return this._column.getDefinition()},ColumnComponent.prototype.getField=function(){return this._column.getField()},ColumnComponent.prototype.getCells=function(){var t=[];return this._column.cells.forEach((function(e){t.push(e.getComponent())})),t},ColumnComponent.prototype.getVisibility=function(){return console.warn("getVisibility function is deprecated, you should now use the isVisible function"),this._column.visible},ColumnComponent.prototype.isVisible=function(){return this._column.visible},ColumnComponent.prototype.show=function(){this._column.isGroup?this._column.columns.forEach((function(t){t.show()})):this._column.show()},ColumnComponent.prototype.hide=function(){this._column.isGroup?this._column.columns.forEach((function(t){t.hide()})):this._column.hide()},ColumnComponent.prototype.toggle=function(){this._column.visible?this.hide():this.show()},ColumnComponent.prototype.delete=function(){return this._column.delete()},ColumnComponent.prototype.getSubColumns=function(){var t=[];return this._column.columns.length&&this._column.columns.forEach((function(e){t.push(e.getComponent())})),t},ColumnComponent.prototype.getParentColumn=function(){return this._column.parent instanceof Column&&this._column.parent.getComponent()},ColumnComponent.prototype._getSelf=function(){return this._column},ColumnComponent.prototype.scrollTo=function(){return this._column.table.columnManager.scrollToColumn(this._column)},ColumnComponent.prototype.getTable=function(){return this._column.table},ColumnComponent.prototype.headerFilterFocus=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterFocus(this._column)},ColumnComponent.prototype.reloadHeaderFilter=function(){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.reloadHeaderFilter(this._column)},ColumnComponent.prototype.getHeaderFilterValue=function(){if(this._column.table.modExists("filter",!0))return this._column.table.modules.filter.getHeaderFilterValue(this._column)},ColumnComponent.prototype.setHeaderFilterValue=function(t){this._column.table.modExists("filter",!0)&&this._column.table.modules.filter.setHeaderFilterValue(this._column,t)},ColumnComponent.prototype.move=function(t,e){var o=this._column.table.columnManager.findColumn(t);o?this._column.table.columnManager.moveColumn(this._column,o,e):console.warn("Move Error - No matching column found:",o)},ColumnComponent.prototype.getNextColumn=function(){var t=this._column.nextColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.getPrevColumn=function(){var t=this._column.prevColumn();return!!t&&t.getComponent()},ColumnComponent.prototype.updateDefinition=function(t){return this._column.updateDefinition(t)},ColumnComponent.prototype.getWidth=function(){return this._column.getWidth()},ColumnComponent.prototype.setWidth=function(t){var e;return e=!0===t?this._column.reinitializeWidth(!0):this._column.setWidth(t),this._column.table.options.virtualDomHoz&&this._column.table.vdomHoz.reinitialize(!0),e},ColumnComponent.prototype.validate=function(){return this._column.validate()};var Column=function t(e,o){var i=this;this.table=o.table,this.definition=e,this.parent=o,this.type="column",this.columns=[],this.cells=[],this.element=this.createElement(),this.contentElement=!1,this.titleHolderElement=!1,this.titleElement=!1,this.groupElement=this.createGroupElement(),this.isGroup=!1,this.tooltip=!1,this.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleFormatterRendered=!1,this.setField(this.definition.field),this.table.options.invalidOptionWarnings&&this.checkDefinition(),this.modules={},this.cellEvents={cellClick:!1,cellDblClick:!1,cellContext:!1,cellTap:!1,cellDblTap:!1,cellTapHold:!1,cellMouseEnter:!1,cellMouseLeave:!1,cellMouseOver:!1,cellMouseOut:!1,cellMouseMove:!1},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this._mapDepricatedFunctionality(),e.columns?(this.isGroup=!0,e.columns.forEach((function(e,o){var n=new t(e,i);i.attachColumn(n)})),i.checkColumnVisibility()):o.registerColumnField(this),e.rowHandle&&!1!==this.table.options.movableRows&&this.table.modExists("moveRow")&&this.table.modules.moveRow.setHandle(!0),this._buildHeader(),this.bindModuleColumns()};Column.prototype.createElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col"),t.setAttribute("role","columnheader"),t.setAttribute("aria-sort","none"),t},Column.prototype.createGroupElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-col-group-cols"),t},Column.prototype.checkDefinition=function(){var t=this;Object.keys(this.definition).forEach((function(e){-1===t.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(t.field||t.definition.title)+"' column:",e)}))},Column.prototype.setField=function(t){this.field=t,this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData},Column.prototype.registerColumnPosition=function(t){this.parent.registerColumnPosition(t)},Column.prototype.registerColumnField=function(t){this.parent.registerColumnField(t)},Column.prototype.reRegisterPosition=function(){this.isGroup?this.columns.forEach((function(t){t.reRegisterPosition()})):this.registerColumnPosition(this)},Column.prototype._mapDepricatedFunctionality=function(){void 0!==this.definition.hideInHtml&&(this.definition.htmlOutput=!this.definition.hideInHtml,console.warn("hideInHtml column definition property is deprecated, you should now use htmlOutput")),void 0!==this.definition.align&&(this.definition.hozAlign=this.definition.align,console.warn("align column definition property is deprecated, you should now use hozAlign")),void 0!==this.definition.downloadTitle&&(this.definition.titleDownload=this.definition.downloadTitle,console.warn("downloadTitle definition property is deprecated, you should now use titleDownload"))},Column.prototype.setTooltip=function(){var t=this,e=t.definition,o=e.headerTooltip||!1===e.tooltip?e.headerTooltip:t.table.options.tooltipsHeader;o?!0===o?e.field?t.table.modules.localize.bind("columns|"+e.field,(function(o){t.element.setAttribute("title",o||e.title)})):t.element.setAttribute("title",e.title):("function"==typeof o&&!1===(o=o(t.getComponent()))&&(o=""),t.element.setAttribute("title",o)):t.element.setAttribute("title","")},Column.prototype._buildHeader=function(){for(var t=this,e=t.definition;t.element.firstChild;)t.element.removeChild(t.element.firstChild);e.headerVertical&&(t.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&t.element.classList.add("tabulator-col-vertical-flip")),t.contentElement=t._bindEvents(),t.contentElement=t._buildColumnHeaderContent(),t.element.appendChild(t.contentElement),t.isGroup?t._buildGroupHeader():t._buildColumnHeader(),t.setTooltip(),t.table.options.resizableColumns&&t.table.modExists("resizeColumns")&&t.table.modules.resizeColumns.initializeColumn("header",t,t.element),e.headerFilter&&t.table.modExists("filter")&&t.table.modExists("edit")&&(void 0!==e.headerFilterPlaceholder&&e.field&&t.table.modules.localize.setHeaderFilterColumnPlaceholder(e.field,e.headerFilterPlaceholder),t.table.modules.filter.initializeColumn(t)),t.table.modExists("frozenColumns")&&t.table.modules.frozenColumns.initializeColumn(t),t.table.options.movableColumns&&!t.isGroup&&t.table.modExists("moveColumn")&&t.table.modules.moveColumn.initializeColumn(t),(e.topCalc||e.bottomCalc)&&t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.initializeColumn(t),t.table.modExists("persistence")&&t.table.modules.persistence.config.columns&&t.table.modules.persistence.initializeColumn(t),t.element.addEventListener("mouseenter",(function(e){t.setTooltip()}))},Column.prototype._bindEvents=function(){var t,e,o,i=this,n=i.definition;"function"==typeof n.headerClick&&i.element.addEventListener("click",(function(t){n.headerClick(t,i.getComponent())})),"function"==typeof n.headerDblClick&&i.element.addEventListener("dblclick",(function(t){n.headerDblClick(t,i.getComponent())})),"function"==typeof n.headerContext&&i.element.addEventListener("contextmenu",(function(t){n.headerContext(t,i.getComponent())})),"function"==typeof n.headerTap&&(o=!1,i.element.addEventListener("touchstart",(function(t){o=!0}),{passive:!0}),i.element.addEventListener("touchend",(function(t){o&&n.headerTap(t,i.getComponent()),o=!1}))),"function"==typeof n.headerDblTap&&(t=null,i.element.addEventListener("touchend",(function(e){t?(clearTimeout(t),t=null,n.headerDblTap(e,i.getComponent())):t=setTimeout((function(){clearTimeout(t),t=null}),300)}))),"function"==typeof n.headerTapHold&&(e=null,i.element.addEventListener("touchstart",(function(t){clearTimeout(e),e=setTimeout((function(){clearTimeout(e),e=null,o=!1,n.headerTapHold(t,i.getComponent())}),1e3)}),{passive:!0}),i.element.addEventListener("touchend",(function(t){clearTimeout(e),e=null}))),"function"==typeof n.cellClick&&(i.cellEvents.cellClick=n.cellClick),"function"==typeof n.cellDblClick&&(i.cellEvents.cellDblClick=n.cellDblClick),"function"==typeof n.cellContext&&(i.cellEvents.cellContext=n.cellContext),"function"==typeof n.cellMouseEnter&&(i.cellEvents.cellMouseEnter=n.cellMouseEnter),"function"==typeof n.cellMouseLeave&&(i.cellEvents.cellMouseLeave=n.cellMouseLeave),"function"==typeof n.cellMouseOver&&(i.cellEvents.cellMouseOver=n.cellMouseOver),"function"==typeof n.cellMouseOut&&(i.cellEvents.cellMouseOut=n.cellMouseOut),"function"==typeof n.cellMouseMove&&(i.cellEvents.cellMouseMove=n.cellMouseMove),"function"==typeof n.cellTap&&(i.cellEvents.cellTap=n.cellTap),"function"==typeof n.cellDblTap&&(i.cellEvents.cellDblTap=n.cellDblTap),"function"==typeof n.cellTapHold&&(i.cellEvents.cellTapHold=n.cellTapHold),"function"==typeof n.cellEdited&&(i.cellEvents.cellEdited=n.cellEdited),"function"==typeof n.cellEditing&&(i.cellEvents.cellEditing=n.cellEditing),"function"==typeof n.cellEditCancelled&&(i.cellEvents.cellEditCancelled=n.cellEditCancelled)},Column.prototype._buildColumnHeader=function(){var t=this,e=this.definition,o=this.table;(o.modExists("sort")&&o.modules.sort.initializeColumn(this,this.titleHolderElement),(e.headerContextMenu||e.headerClickMenu||e.headerMenu)&&o.modExists("menu")&&o.modules.menu.initializeColumnHeader(this),o.modExists("format")&&o.modules.format.initializeColumn(this),void 0!==e.editor&&o.modExists("edit")&&o.modules.edit.initializeColumn(this),void 0!==e.validator&&o.modExists("validate")&&o.modules.validate.initializeColumn(this),o.modExists("mutator")&&o.modules.mutator.initializeColumn(this),o.modExists("accessor")&&o.modules.accessor.initializeColumn(this),_typeof(o.options.responsiveLayout)&&o.modExists("responsiveLayout")&&o.modules.responsiveLayout.initializeColumn(this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((function(e){t.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(void 0===e.minWidth?this.table.options.columnMinWidth:parseInt(e.minWidth)),(e.maxWidth||this.table.options.columnMaxWidth)&&!1!==e.maxWidth&&this.setMaxWidth(void 0===e.maxWidth?this.table.options.columnMaxWidth:parseInt(e.maxWidth)),this.reinitializeWidth(),this.tooltip=this.definition.tooltip||!1===this.definition.tooltip?this.definition.tooltip:this.table.options.tooltips,this.hozAlign=void 0===this.definition.hozAlign?this.table.options.cellHozAlign:this.definition.hozAlign,this.vertAlign=void 0===this.definition.vertAlign?this.table.options.cellVertAlign:this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign},Column.prototype._buildColumnHeaderContent=function(){this.definition,this.table;var t=document.createElement("div");return t.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),t.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),t},Column.prototype._buildColumnHeaderTitle=function(){var t=this,e=t.definition,o=t.table,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),e.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(t){t.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){e.title=n.value,o.options.columnTitleChanged.call(t.table,t.getComponent())})),i.appendChild(n),e.field?o.modules.localize.bind("columns|"+e.field,(function(t){n.value=t||e.title||" "})):n.value=e.title||" "}else e.field?o.modules.localize.bind("columns|"+e.field,(function(o){t._formatColumnHeaderTitle(i,o||e.title||" ")})):t._formatColumnHeaderTitle(i,e.title||" ");return i},Column.prototype._formatColumnHeaderTitle=function(t,e){var o,i,n,s,a,r=this;if(this.definition.titleFormatter&&this.table.modExists("format"))switch(o=this.table.modules.format.getFormatter(this.definition.titleFormatter),a=function(t){r.titleFormatterRendered=t},s={getValue:function(){return e},getElement:function(){return t}},n="function"==typeof(n=this.definition.titleFormatterParams||{})?n():n,void 0===(i=o.call(this.table.modules.format,s,n,a))?"undefined":_typeof(i)){case"object":i instanceof Node?t.appendChild(i):(t.innerHTML="",console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",i));break;case"undefined":case"null":t.innerHTML="";break;default:t.innerHTML=i}else t.innerHTML=e},Column.prototype._buildGroupHeader=function(){var t=this;(this.element.classList.add("tabulator-col-group"),this.element.setAttribute("role","columngroup"),this.element.setAttribute("aria-title",this.definition.title),this.definition.cssClass)&&this.definition.cssClass.split(" ").forEach((function(e){t.element.classList.add(e)}));(this.definition.headerContextMenu||this.definition.headerMenu)&&this.table.modExists("menu")&&this.table.modules.menu.initializeColumnHeader(this),this.titleElement.style.textAlign=this.definition.headerHozAlign||this.table.options.headerHozAlign,this.element.appendChild(this.groupElement)},Column.prototype._getFlatData=function(t){return t[this.field]},Column.prototype._getNestedData=function(t){for(var e,o=t,i=this.fieldStructure,n=i.length,s=0;s<n&&(e=o=o[i[s]],o);s++);return e},Column.prototype._setFlatData=function(t,e){this.field&&(t[this.field]=e)},Column.prototype._setNestedData=function(t,e){for(var o=t,i=this.fieldStructure,n=i.length,s=0;s<n;s++)if(s==n-1)o[i[s]]=e;else{if(!o[i[s]]){if(void 0===e)break;o[i[s]]={}}o=o[i[s]]}},Column.prototype.attachColumn=function(t){this.groupElement?(this.columns.push(t),this.groupElement.appendChild(t.getElement())):console.warn("Column Warning - Column being attached to another column instead of column group")},Column.prototype.verticalAlign=function(t,e){var o=this.parent.isGroup?this.parent.getGroupElement().clientHeight:e||this.parent.getHeadersElement().clientHeight;this.element.style.height=o+"px",this.isGroup&&(this.groupElement.style.minHeight=o-this.contentElement.offsetHeight+"px"),this.isGroup||"top"===t||(this.element.style.paddingTop="bottom"===t?this.element.clientHeight-this.contentElement.offsetHeight+"px":(this.element.clientHeight-this.contentElement.offsetHeight)/2+"px"),this.columns.forEach((function(e){e.verticalAlign(t)}))},Column.prototype.clearVerticalAlign=function(){this.element.style.paddingTop="",this.element.style.height="",this.element.style.minHeight="",this.groupElement.style.minHeight="",this.columns.forEach((function(t){t.clearVerticalAlign()}))},Column.prototype.bindModuleColumns=function(){"rownum"==this.definition.formatter&&(this.table.rowManager.rowNumColumn=this)},Column.prototype.getElement=function(){return this.element},Column.prototype.getGroupElement=function(){return this.groupElement},Column.prototype.getField=function(){return this.field},Column.prototype.getFirstColumn=function(){return this.isGroup?!!this.columns.length&&this.columns[0].getFirstColumn():this},Column.prototype.getLastColumn=function(){return this.isGroup?!!this.columns.length&&this.columns[this.columns.length-1].getLastColumn():this},Column.prototype.getColumns=function(){return this.columns},Column.prototype.getCells=function(){return this.cells},Column.prototype.getTopColumn=function(){return this.parent.isGroup?this.parent.getTopColumn():this},Column.prototype.getDefinition=function(t){var e=[];return this.isGroup&&t&&(this.columns.forEach((function(t){e.push(t.getDefinition(!0))})),this.definition.columns=e),this.definition},Column.prototype.checkColumnVisibility=function(){var t=!1;this.columns.forEach((function(e){e.visible&&(t=!0)})),t?(this.show(),this.parent.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1)):this.hide()},Column.prototype.show=function(t,e){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(t){t.show()})),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager._verticalAlignHeaders(),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),!e&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),!this.silent&&this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize())},Column.prototype.hide=function(t,e){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager._verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(t){t.hide()})),this.table.options.persistence&&this.table.modExists("persistence",!0)&&this.table.modules.persistence.config.columns&&this.table.modules.persistence.save("columns"),!e&&this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.updateColumnVisibility(this,this.visible),t||this.table.options.columnVisibilityChanged.call(this.table,this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),!this.silent&&this.table.options.virtualDomHoz&&this.table.vdomHoz.reinitialize())},Column.prototype.matchChildWidths=function(){var t=0;this.contentElement&&this.columns.length&&(this.columns.forEach((function(e){e.visible&&(t+=e.getWidth())})),this.contentElement.style.maxWidth=t-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())},Column.prototype.removeChild=function(t){var e=this.columns.indexOf(t);e>-1&&this.columns.splice(e,1),this.columns.length||this.delete()},Column.prototype.setWidth=function(t){this.widthFixed=!0,this.setWidthActual(t)},Column.prototype.setWidthActual=function(t){isNaN(t)&&(t=Math.floor(this.table.element.clientWidth/100*parseInt(t))),t=Math.max(this.minWidth,t),this.maxWidth&&(t=Math.min(this.maxWidth,t)),this.width=t,this.widthStyled=t?t+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(t){t.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.table.modExists("frozenColumns")&&this.table.modules.frozenColumns.layout()},Column.prototype.checkCellHeights=function(){var t=[];this.cells.forEach((function(e){e.row.heightInitialized&&(null!==e.row.getElement().offsetParent?(t.push(e.row),e.row.clearCellHeight()):e.row.heightInitialized=!1)})),t.forEach((function(t){t.calcHeight()})),t.forEach((function(t){t.setCellHeight()}))},Column.prototype.getWidth=function(){var t=0;return this.isGroup?this.columns.forEach((function(e){e.visible&&(t+=e.getWidth())})):t=this.width,t},Column.prototype.getHeight=function(){return this.element.offsetHeight},Column.prototype.setMinWidth=function(t){this.minWidth=t,this.minWidthStyled=t?t+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(t){t.setMinWidth()}))},Column.prototype.setMaxWidth=function(t){this.maxWidth=t,this.maxWidthStyled=t?t+"px":"",this.element.style.maxWidth=this.maxWidthStyled,this.cells.forEach((function(t){t.setMaxWidth()}))},Column.prototype.delete=function(){var t=this;return new Promise((function(e,o){t.isGroup&&t.columns.forEach((function(t){t.delete()})),t.table.modExists("edit")&&t.table.modules.edit.currentCell.column===t&&t.table.modules.edit.cancelEdit();for(var i=t.cells.length,n=0;n<i;n++)t.cells[0].delete();t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.element=!1,t.contentElement=!1,t.titleElement=!1,t.groupElement=!1,t.parent.isGroup&&t.parent.removeChild(t),t.table.columnManager.deregisterColumn(t),t.table.options.virtualDomHoz&&t.table.vdomHoz.reinitialize(!0),e()}))},Column.prototype.columnRendered=function(){this.titleFormatterRendered&&this.titleFormatterRendered()},Column.prototype.validate=function(){var t=[];return this.cells.forEach((function(e){e.validate()||t.push(e.getComponent())})),!t.length||t},Column.prototype.generateCell=function(t){var e=new Cell(this,t);return this.cells.push(e),e},Column.prototype.nextColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._nextVisibleColumn(t+1)},Column.prototype._nextVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._nextVisibleColumn(t+1)},Column.prototype.prevColumn=function(){var t=this.table.columnManager.findColumnIndex(this);return t>-1&&this._prevVisibleColumn(t-1)},Column.prototype._prevVisibleColumn=function(t){var e=this.table.columnManager.getColumnByIndex(t);return!e||e.visible?e:this._prevVisibleColumn(t-1)},Column.prototype.reinitializeWidth=function(t){this.widthFixed=!1,void 0===this.definition.width||t||this.setWidth(this.definition.width),this.table.modExists("filter")&&this.table.modules.filter.hideHeaderFilterElements(),this.fitToData(),this.table.modExists("filter")&&this.table.modules.filter.showHeaderFilterElements()},Column.prototype.fitToData=function(){this.widthFixed||(this.element.style.width="",this.cells.forEach((function(t){t.clearWidth()})));var t=this.element.offsetWidth;this.width&&this.widthFixed||(this.cells.forEach((function(e){var o=e.getWidth();o>t&&(t=o)})),t&&this.setWidthActual(t+1))},Column.prototype.updateDefinition=function(t){var e=this;return new Promise((function(o,i){var n;e.isGroup||e.parent.isGroup?(console.warn("Column Update Error - The updateDefinition function is only available on ungrouped columns"),i("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(n=Object.assign({},e.getDefinition()),n=Object.assign(n,t),e.table.columnManager.addColumn(n,!1,e).then((function(t){n.field==e.field&&(e.field=!1),e.delete().then((function(){o(t.getComponent())})).catch((function(t){i(t)}))})).catch((function(t){i(t)})))}))},Column.prototype.deleteCell=function(t){var e=this.cells.indexOf(t);e>-1&&this.cells.splice(e,1)},Column.prototype.defaultOptionList=["title","field","columns","visible","align","hozAlign","vertAlign","width","minWidth","maxWidth","widthGrow","widthShrink","resizable","frozen","responsive","tooltip","cssClass","rowHandle","hideInHtml","print","htmlOutput","sorter","sorterParams","formatter","formatterParams","variableHeight","editable","editor","editorParams","validator","mutator","mutatorParams","mutatorData","mutatorDataParams","mutatorEdit","mutatorEditParams","mutatorClipboard","mutatorClipboardParams","accessor","accessorParams","accessorData","accessorDataParams","accessorDownload","accessorDownloadParams","accessorClipboard","accessorClipboardParams","accessorPrint","accessorPrintParams","accessorHtmlOutput","accessorHtmlOutputParams","clipboard","download","downloadTitle","topCalc","topCalcParams","topCalcFormatter","topCalcFormatterParams","bottomCalc","bottomCalcParams","bottomCalcFormatter","bottomCalcFormatterParams","cellClick","cellDblClick","cellContext","cellTap","cellDblTap","cellTapHold","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellEditing","cellEdited","cellEditCancelled","headerSort","headerSortStartingDir","headerSortTristate","headerClick","headerDblClick","headerContext","headerTap","headerDblTap","headerTapHold","headerTooltip","headerVertical","headerHozAlign","editableTitle","titleFormatter","titleFormatterParams","headerFilter","headerFilterPlaceholder","headerFilterParams","headerFilterEmptyCheck","headerFilterFunc","headerFilterFuncParams","headerFilterLiveFilter","print","headerContextMenu","headerMenu","contextMenu","clickMenu","formatterPrint","formatterPrintParams","formatterClipboard","formatterClipboardParams","formatterHtmlOutput","formatterHtmlOutputParams","titlePrint","titleClipboard","titleHtmlOutput","titleDownload"],Column.prototype.getComponent=function(){return this.component||(this.component=new ColumnComponent(this)),this.component};var RowManager=function(t){this.table=t,this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.columnManager=null,this.height=0,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.vDomRowHeight=20,this.vDomTop=0,this.vDomBottom=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomMaxRenderChain=90,this.vDomWindowBuffer=0,this.vDomWindowMinTotalRows=20,this.vDomWindowMinMarginRows=5,this.vDomTopNewRows=[],this.vDomBottomNewRows=[],this.rowNumColumn=!1,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRederInPosition=!1};RowManager.prototype.createHolderElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-tableHolder"),t.setAttribute("tabindex",0),t},RowManager.prototype.createTableElement=function(){var t=document.createElement("div");return t.classList.add("tabulator-table"),t},RowManager.prototype.getElement=function(){return this.element},RowManager.prototype.getTableElement=function(){return this.tableElement},RowManager.prototype.getRowPosition=function(t,e){return e?this.activeRows.indexOf(t):this.rows.indexOf(t)},RowManager.prototype.setColumnManager=function(t){this.columnManager=t},RowManager.prototype.initialize=function(){var t=this;t.setRenderMode(),t.element.appendChild(t.tableElement),t.firstRender=!0,t.element.addEventListener("scroll",(function(){var e=t.element.scrollLeft;t.scrollLeft!=e&&(t.columnManager.scrollHorizontal(e),t.table.options.groupBy&&t.table.modules.groupRows.scrollHeaders(e),t.table.modExists("columnCalcs")&&t.table.modules.columnCalcs.scrollHorizontal(e),t.table.options.scrollHorizontal(e)),t.scrollLeft=e})),"virtual"===this.renderMode&&t.element.addEventListener("scroll",(function(){var e=t.element.scrollTop,o=t.scrollTop>e;t.scrollTop!=e?(t.scrollTop=e,t.scrollVertical(o),"scroll"==t.table.options.ajaxProgressiveLoad&&t.table.modules.ajax.nextPage(t.element.scrollHeight-t.element.clientHeight-e),t.table.options.scrollVertical(e)):t.scrollTop=e}))},RowManager.prototype.findRow=function(t){var e=this;return"object"!=(void 0===t?"undefined":_typeof(t))?null!=t&&(e.rows.find((function(o){return o.data[e.table.options.index]==t}))||!1):t instanceof Row?t:t instanceof RowComponent?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&e.rows.find((function(e){return e.getElement()===t}))||!1},RowManager.prototype.getRowFromDataObject=function(t){return this.rows.find((function(e){return e.data===t}))||!1},RowManager.prototype.getRowFromPosition=function(t,e){return e?this.activeRows[t]:this.rows[t]},RowManager.prototype.scrollToRow=function(t,e,o){var i,n=this,s=this.getDisplayRows().indexOf(t),a=t.getElement(),r=0;return new Promise((function(t,l){if(s>-1){if(void 0===e&&(e=n.table.options.scrollToRowPosition),void 0===o&&(o=n.table.options.scrollToRowIfVisible),"nearest"===e)switch(n.renderMode){case"classic":i=Tabulator.prototype.helpers.elOffset(a).top,e=Math.abs(n.element.scrollTop-i)>Math.abs(n.element.scrollTop+n.element.clientHeight-i)?"bottom":"top";break;case"virtual":e=Math.abs(n.vDomTop-s)>Math.abs(n.vDomBottom-s)?"bottom":"top"}if(!o&&Tabulator.prototype.helpers.elVisible(a)&&(r=Tabulator.prototype.helpers.elOffset(a).top-Tabulator.prototype.helpers.elOffset(n.element).top)>0&&r<n.element.clientHeight-a.offsetHeight)return!1;switch(n.renderMode){case"classic":n.element.scrollTop=Tabulator.prototype.helpers.elOffset(a).top-Tabulator.prototype.helpers.elOffset(n.element).top+n.element.scrollTop;break;case"virtual":n._virtualRenderFill(s,!0)}switch(e){case"middle":case"center":n.element.scrollHeight-n.element.scrollTop==n.element.clientHeight?n.element.scrollTop=n.element.scrollTop+(a.offsetTop-n.element.scrollTop)-(n.element.scrollHeight-a.offsetTop)/2:n.element.scrollTop=n.element.scrollTop-n.element.clientHeight/2;break;case"bottom":n.element.scrollHeight-n.element.scrollTop==n.element.clientHeight?n.element.scrollTop=n.element.scrollTop-(n.element.scrollHeight-a.offsetTop)+a.offsetHeight:n.element.scrollTop=n.element.scrollTop-n.element.clientHeight+a.offsetHeight}t()}else console.warn("Scroll Error - Row not visible"),l("Scroll Error - Row not visible")}))},RowManager.prototype.setData=function(t,e,o){var i=this,n=this;return new Promise((function(s,a){e&&i.getDisplayRows().length?n.table.options.pagination?n._setDataActual(t,!0):i.reRenderInPosition((function(){n._setDataActual(t)})):(i.table.options.autoColumns&&o&&i.table.columnManager.generateColumnsFromRowData(t),i.resetScroll(),i._setDataActual(t)),s()}))},RowManager.prototype._setDataActual=function(t,e){var o=this;o.table.options.dataLoading.call(this.table,t),this._wipeElements(),this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.clear(),Array.isArray(t)?(this.table.modExists("selectRow")&&this.table.modules.selectRow.clearSelectionData(),this.table.options.reactiveData&&this.table.modExists("reactiveData",!0)&&this.table.modules.reactiveData.watchData(t),t.forEach((function(t,e){if(t&&"object"===(void 0===t?"undefined":_typeof(t))){var i=new Row(t,o);o.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)})),o.refreshActiveData(!1,!1,e),o.table.options.dataLoaded.call(this.table,t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",void 0===t?"undefined":_typeof(t),"\nData: ",t)},RowManager.prototype._wipeElements=function(){this.rows.forEach((function(t){t.wipe()})),this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.wipe(),this.rows=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()},RowManager.prototype.deleteRow=function(t,e){var o=this.rows.indexOf(t),i=this.activeRows.indexOf(t);i>-1&&this.activeRows.splice(i,1),o>-1&&this.rows.splice(o,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(e){var o=e.indexOf(t);o>-1&&e.splice(o,1)})),e||this.reRenderInPosition(),this.regenerateRowNumbers(),this.table.options.rowDeleted.call(this.table,t.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.updateGroupRows(!0):this.table.options.pagination&&this.table.modExists("page")?this.refreshActiveData(!1,!1,!0):this.table.options.pagination&&this.table.modExists("page")&&this.refreshActiveData("page")},RowManager.prototype.addRow=function(t,e,o,i){var n=this.addRowActual(t,e,o,i);return this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowAdd",n,{data:t,pos:e,index:o}),n},RowManager.prototype.addRows=function(t,e,o){var i=this,n=this,s=[];return new Promise((function(a,r){e=i.findAddRowPos(e),Array.isArray(t)||(t=[t]),t.length-1,(void 0===o&&e||void 0!==o&&!e)&&t.reverse(),t.forEach((function(t,i){var a=n.addRow(t,e,o,!0);s.push(a)})),i.table.options.groupBy&&i.table.modExists("groupRows")?i.table.modules.groupRows.updateGroupRows(!0):i.table.options.pagination&&i.table.modExists("page")?i.refreshActiveData(!1,!1,!0):i.reRenderInPosition(),i.table.modExists("columnCalcs")&&i.table.modules.columnCalcs.recalc(i.table.rowManager.activeRows),i.regenerateRowNumbers(),a(s)}))},RowManager.prototype.findAddRowPos=function(t){return void 0===t&&(t=this.table.options.addRowPos),"pos"===t&&(t=!0),"bottom"===t&&(t=!1),t},RowManager.prototype.addRowActual=function(t,e,o,i){var n,s,a=t instanceof Row?t:new Row(t||{},this),r=this.findAddRowPos(e),l=-1;if(!o&&this.table.options.pagination&&"page"==this.table.options.paginationAddRow&&(s=this.getDisplayRows(),r?s.length?o=s[0]:this.activeRows.length&&(o=this.activeRows[this.activeRows.length-1],r=!1):s.length&&(o=s[s.length-1],r=!(s.length<this.table.modules.page.getPageSize()))),void 0!==o&&(o=this.findRow(o)),this.table.options.groupBy&&this.table.modExists("groupRows")){this.table.modules.groupRows.assignRowToGroup(a);var u=a.getGroup().rows;u.length>1&&(!o||o&&-1==u.indexOf(o)?r?u[0]!==a&&(o=u[0],this._moveRowInArray(a.getGroup().rows,a,o,!r)):u[u.length-1]!==a&&(o=u[u.length-1],this._moveRowInArray(a.getGroup().rows,a,o,!r)):this._moveRowInArray(a.getGroup().rows,a,o,!r))}return o&&(l=this.rows.indexOf(o)),o&&l>-1?(n=this.activeRows.indexOf(o),this.displayRowIterator((function(t){var e=t.indexOf(o);e>-1&&t.splice(r?e:e+1,0,a)})),n>-1&&this.activeRows.splice(r?n:n+1,0,a),this.rows.splice(r?l:l+1,0,a)):r?(this.displayRowIterator((function(t){t.unshift(a)})),this.activeRows.unshift(a),this.rows.unshift(a)):(this.displayRowIterator((function(t){t.push(a)})),this.activeRows.push(a),this.rows.push(a)),this.setActiveRows(this.activeRows),this.table.options.rowAdded.call(this.table,a.getComponent()),this.table.options.dataChanged&&this.table.options.dataChanged.call(this.table,this.getData()),i||this.reRenderInPosition(),a},RowManager.prototype.moveRow=function(t,e,o){this.table.options.history&&this.table.modExists("history")&&this.table.modules.history.action("rowMove",t,{posFrom:this.getRowPosition(t),posTo:this.getRowPosition(e),to:e,after:o}),this.moveRowActual(t,e,o),this.regenerateRowNumbers(),this.table.options.rowMoved.call(this.table,t.getComponent())},RowManager.prototype.moveRowActual=function(t,e,o){var i=this;if(this._moveRowInArray(this.rows,t,e,o),this._moveRowInArray(this.activeRows,t,e,o),this.displayRowIterator((function(n){i._moveRowInArray(n,t,e,o)})),this.table.options.groupBy&&this.table.modExists("groupRows")){!o&&e instanceof Group&&(e=this.table.rowManager.prevDisplayRow(t)||e);var n=e.getGroup(),s=t.getGroup();n===s?this._moveRowInArray(n.rows,t,e,o):(s&&s.removeRow(t),n.insertRow(t,e,o))}},RowManager.prototype._moveRowInArray=function(t,e,o,i){var n,s,a;if(e!==o&&((n=t.indexOf(e))>-1&&(t.splice(n,1),(s=t.indexOf(o))>-1?i?t.splice(s+1,0,e):t.splice(s,0,e):t.splice(n,0,e)),t===this.getDisplayRows())){a=s>n?s:n+1;for(var r=n<s?n:s;r<=a;r++)t[r]&&this.styleRow(t[r],r)}},RowManager.prototype.clearData=function(){this.setData([])},RowManager.prototype.getRowIndex=function(t){return this.findRowIndex(t,this.rows)},RowManager.prototype.getDisplayRowIndex=function(t){var e=this.getDisplayRows().indexOf(t);return e>-1&&e},RowManager.prototype.nextDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return!1!==o&&o<this.displayRowsCount-1&&(i=this.getDisplayRows()[o+1]),!i||i instanceof Row&&"row"==i.type?i:this.nextDisplayRow(i,e)},RowManager.prototype.prevDisplayRow=function(t,e){var o=this.getDisplayRowIndex(t),i=!1;return o&&(i=this.getDisplayRows()[o-1]),!e||!i||i instanceof Row&&"row"==i.type?i:this.prevDisplayRow(i,e)},RowManager.prototype.findRowIndex=function(t,e){var o;return!!((t=this.findRow(t))&&(o=e.indexOf(t))>-1)&&o},RowManager.prototype.getData=function(t,e){var o=[];return this.getRows(t).forEach((function(t){"row"==t.type&&o.push(t.getData(e||"data"))})),o},RowManager.prototype.getComponents=function(t){var e=[];return this.getRows(t).forEach((function(t){e.push(t.getComponent())})),e},RowManager.prototype.getDataCount=function(t){return this.getRows(t).length},RowManager.prototype._genRemoteRequest=functio