From 1d8e2d06e886bf97cfb8e45eb04f5223631fc897 Mon Sep 17 00:00:00 2001 From: Oli Folkerd Date: Wed, 7 Sep 2022 21:19:22 +0100 Subject: [PATCH] set version to 5.3.4 --- bower.json | 2 +- dist/js/tabulator.js | 17 +++++++++-------- dist/js/tabulator.js.map | 2 +- dist/js/tabulator.min.js | 4 ++-- dist/js/tabulator.min.js.map | 2 +- dist/js/tabulator_esm.js | 2 +- dist/js/tabulator_esm.min.js | 4 ++-- dist/js/tabulator_esm.min.js.map | 2 +- package-lock.json | 2 +- package.json | 2 +- 10 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bower.json b/bower.json index d7eb0f66c..375d28de1 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "tabulator", "main": "dist/js/tabulator.js", - "version": "5.3.3", + "version": "5.3.4", "description": "Interactive table generation JavaScript library", "keywords": [ "table", diff --git a/dist/js/tabulator.js b/dist/js/tabulator.js index ee4e56824..70b319a74 100644 --- a/dist/js/tabulator.js +++ b/dist/js/tabulator.js @@ -1,4 +1,4 @@ -/* Tabulator v5.3.3 (c) Oliver Folkerd 2022 */ +/* Tabulator v5.3.4 (c) Oliver Folkerd 2022 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -3325,7 +3325,7 @@ var minHeight = 0; if (!this.redrawBlock) { - this.element.style.height = ""; + this.headersElement.style.height = ""; this.columns.forEach(function (column) { column.clearVerticalAlign(); }); @@ -3336,7 +3336,7 @@ minHeight = height; } }); - this.element.style.height = minHeight + "px"; + this.headersElement.style.height = minHeight + "px"; this.columns.forEach(function (column) { column.verticalAlign(_this3.table.options.columnHeaderVertAlign, minHeight); }); @@ -5880,7 +5880,7 @@ value: function getRows(type) { var rows = []; - if (!type) { + if (!type || type === true) { rows = this.chain("rows-retrieve", type, null, this.rows) || this.rows; } else { switch (type) { @@ -6021,10 +6021,11 @@ key: "_clearPlaceholder", value: function _clearPlaceholder() { if (this.placeholder && this.placeholder.parentNode) { - this.placeholder.parentNode.removeChild(this.placeholder); // clear empty table placeholder min + this.placeholder.parentNode.removeChild(this.placeholder); + } // clear empty table placeholder min - this.tableElement.style.minWidth = ""; - } + + this.tableElement.style.minWidth = ""; } }, { key: "_positionPlaceholder", @@ -18190,9 +18191,9 @@ this.topElement.appendChild(row.getElement()); row.initialize(); row.normalizeHeight(); - this.table.rowManager.adjustTableSize(); this.rows.push(row); this.refreshData(false, "display"); + this.table.rowManager.adjustTableSize(); this.styleRows(); } else { console.warn("Freeze Error - Row is already frozen"); diff --git a/dist/js/tabulator.js.map b/dist/js/tabulator.js.map index f0c2ec4cf..c2c9310ed 100644 --- a/dist/js/tabulator.js.map +++ b/dist/js/tabulator.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator.js","sources":["../../src/js/core/defaults/options.js","../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.element.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.element.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t\t\r\n\t\t\t// clear empty table placeholder min\r\n\t\t\tthis.tableElement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {\r\n\tmethod: \"GET\",\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["debugEventsExternal","debugEventsInternal","debugInvalidOptions","debugInvalidComponentFuncs","debugInitialization","debugDeprecation","height","minHeight","maxHeight","columnHeaderVertAlign","popupContainer","columns","columnDefaults","data","autoColumns","autoColumnsDefinitions","nestedFieldSeparator","footerElement","index","textDirection","addRowPos","headerVisible","renderVertical","renderHorizontal","renderVerticalBuffer","scrollToRowPosition","scrollToRowIfVisible","scrollToColumnPosition","scrollToColumnIfVisible","rowFormatter","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","placeholder","dataLoader","dataLoaderLoading","dataLoaderError","dataLoaderErrorTimeout","dataSendParams","dataReceiveParams","CoreFeature","table","silent","columnsChanged","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","vertAligns","top","bottom","middle","hozAligns","left","right","center","style","textAlign","hozAlign","vertAlign","display","alignItems","justifyContent","definition","cssClass","classNames","split","classList","add","val","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","changed","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","el","defaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","traverse","concat","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","assign","addColumn","then","error","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","elVisible","elOffset","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","frozen","ok","find","col","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","generateCells","colEnd","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","working","getCell","fitDataColActualWidthCheck","prepend","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","redrawBlockUpdate","renderer","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","initialize","hozAdjust","scrollWidth","marginLeft","scrollColumns","definitions","sorter","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","fieldRoot","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","fromIndex","toIndex","adjust","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getPosition","watchPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","positionWatchers","created","setData","create","deleteCells","renderRowCells","rerenderRowCells","children","resizableRows","setHeight","clearHeight","updatedData","tempData","newRowData","JSON","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","detachModules","deleteRow","includes","isDisplayed","group","BasicVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","destroyed","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","viewable","RendererVirtualDomVertical","RendererBasicVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","abort","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","response","objectInvert","rowData","clearAlert","alertError","setTimeout","map","shouldLoad","alertManager","alert","langText","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","hideable","blurEvent","escEvent","_escapeCheck","destroyBinding","tableDestroyed","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","lookupIndex","append","menuEl","menuContainer","content","forced","reinitializeColumnWidths","responsiveLayout","modExists","colsWidth","gap","lastCol","responsive","flexWidth","flexGrowUnits","flexColWidth","flexColumns","fixedShrinkColumns","flexShrinkUnits","overflowWidth","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","fitData","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","fitColumns","Layout","mode","registerTableOption","registerColumnOption","modes","dataChanged","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","traverseLang","trans","prop","navigator","language","toLowerCase","prefix","_executeBindings","fillPath","pathArray","_getLangElement","level","rootPath","binding","defaultLangs","Comms","receive","selectors","connections","connection","con","action","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","stack","line","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","Accessor","allowedTypes","initializeColumn","transformRow","charAt","toUpperCase","accessor","lookupAccessor","accessors","rowComponent","colComponent","defaultAccessors","method","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","contentType","urlGenerator","ajaxContentType","contentTypeFormatters","headers","Accept","location","credentials","fetch","json","status","statusText","stringify","form","FormData","Ajax","loaderPromise","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","defaultContentTypeFormatters","updateOrAddData","insert","addData","clipboard","headerFindSuccess","columnMap","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","defaultPasteActions","defaultPasteParsers","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","marginRight","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","groups","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","formatter","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","subChildren","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","setFileContents","delimiter","fileContents","depth","bom","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","orientation","unit","parseRow","styles","colSpan","rowSpan","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","self","sheetName","workbook","XLSX","utils","book_new","tableFeatures","SheetNames","Sheets","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","sheetOnly","sheets","sheet","commsSend","intercept","s2ab","buf","ArrayBuffer","view","Uint8Array","charCodeAt","write","bookType","bookSST","csv","jsonLines","pdf","xlsx","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","buildLink","mime","triggerDownload","downloaders","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","msSaveOrOpenBlob","click","defaultDownloaders","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","onRendered","success","cancel","editorParams","cellValue","input","search","padding","boxSizing","elementAttributes","getAttribute","preventScroll","selectContents","onChange","vertNav","verticalNavigation","whiteSpace","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","stopImmediatePropagation","step","blurFunc","inputFormat","DT","DateTime","luxon","convertDate","newDatetime","isDateTime","fromISO","fromFormat","toFormat","Edit","editor","_initializeParams","displayItems","currentItems","focusedItem","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","clearable","autocomplete","cursor","caretColor","_bindInputEvents","valueKeys","valueCheck","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","blur","deprecationMsg","List","maxStars","getElementsByTagName","size","stars","starsHolder","star","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","percent","bar","mouseDrag","mouseDragWidth","updateValue","calcVal","round","backgroundColor","screenX","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","indeterminate","checked","trueValue","checkedValue","falseValue","textarea","number","date","time","datetime","progress","tickCross","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","rendered","cellEditor","validationMode","focusScrollAdjust","cellClick","cellEditing","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerPos","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","formatterParams","emptyToSpace","sanitizeHTML","floatVal","sign","integer","decimal","rgx","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","urlPrefix","labelTraverse","labelField","urlField","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","suffix","humanize","now","toHuman","starActive","starInactive","colors","color","percentValue","legendAlign","legend","legendColor","barEl","barContainer","legendEl","holderEl","innerText","toggleList","isOpen","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","plaintext","money","link","image","datetimediff","traffic","buttonTick","buttonCross","rownum","responsiveCollapse","rowSelection","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","otherRows","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","toggleElement","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","samePath","every","groupPath","groupId","cellEdit","rowAdd","_rebindRow","rowMove","posFrom","newValue","posTo","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","getGroup","getRowIndex","undoers","redoers","oldRow","defaultUndoers","defaultRedoers","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","csvImporter","inQuote","nextChar","arrayImporter","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","watchers","componentObj","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","bindingList","mapBinding","symbolsList","ctrl","meta","symbols","code","checkBinding","ctrlKey","metaKey","defaultBindings","defaultActions","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","icon","headerMenuIcon","headerMenuEl","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","startXMove","prevColWidth","nextColWidthLast","prevColWidthLast","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","columnHolder","xPos","scrollPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","startYMove","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","defaultMutators","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualRowPageSize","actualStartRow","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","persistenceMode","persistenceID","retrievedData","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupIcon","headerPopupEl","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","scrollX","scrollY","footerEl","tableEl","footerContent","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","startDiff","moveDiff","blockedBefore","blockedAfter","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","nodeHeight","contentRect","nodeWidth","redrawTable","observe","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","colCount","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","titleData","valueData","node_content","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","langLocale","localeCompare","el1","el2","calc","d","string","boolean","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","reg","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAe;EAEdA,EAAAA,mBAAmB,EAAC,KAFN;EAEa;EAC3BC,EAAAA,mBAAmB,EAAC,KAHN;EAGa;EAC3BC,EAAAA,mBAAmB,EAAC,IAJN;EAIY;EAC1BC,EAAAA,0BAA0B,EAAC,IALb;EAKmB;EACjCC,EAAAA,mBAAmB,EAAC,IANN;EAMY;EAC1BC,EAAAA,gBAAgB,EAAC,IAPH;EAOS;EAEvBC,EAAAA,MAAM,EAAC,KATO;EASA;EACdC,EAAAA,SAAS,EAAC,KAVI;EAUG;EACjBC,EAAAA,SAAS,EAAC,KAXI;EAWG;EAEjBC,EAAAA,qBAAqB,EAAC,KAbR;EAae;EAE7BC,EAAAA,cAAc,EAAC,KAfD;EAiBdC,EAAAA,OAAO,EAAC,EAjBM;EAiBH;EACXC,EAAAA,cAAc,EAAC,EAlBD;EAkBK;EAEnBC,EAAAA,IAAI,EAAC,KApBS;EAoBF;EAEZC,EAAAA,WAAW,EAAC,KAtBE;EAsBK;EACnBC,EAAAA,sBAAsB,EAAC,KAvBT;EAyBdC,EAAAA,oBAAoB,EAAC,GAzBP;EAyBY;EAE1BC,EAAAA,aAAa,EAAC,KA3BA;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C3sD,UAAT,GAAsB,UAAtB;;EAGA2sD,QAAQ,CAACoB,UAAT,GAAsBG,iBAAtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MCzSMC;;;;;;;;;;;;IAAsB5zD;;;EAG5B,IAAIiI,YAAJ,CAAiB2rD,aAAjB,EAAgC7gF,OAAhC;;;;"} \ No newline at end of file +{"version":3,"file":"tabulator.js","sources":["../../src/js/core/defaults/options.js","../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/History/History.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.headersElement.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.headersElement.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type || type === true){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {\r\n\tmethod: \"GET\",\r\n};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ? this.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","export default {};","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["debugEventsExternal","debugEventsInternal","debugInvalidOptions","debugInvalidComponentFuncs","debugInitialization","debugDeprecation","height","minHeight","maxHeight","columnHeaderVertAlign","popupContainer","columns","columnDefaults","data","autoColumns","autoColumnsDefinitions","nestedFieldSeparator","footerElement","index","textDirection","addRowPos","headerVisible","renderVertical","renderHorizontal","renderVerticalBuffer","scrollToRowPosition","scrollToRowIfVisible","scrollToColumnPosition","scrollToColumnIfVisible","rowFormatter","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","rowHeight","placeholder","dataLoader","dataLoaderLoading","dataLoaderError","dataLoaderErrorTimeout","dataSendParams","dataReceiveParams","CoreFeature","table","silent","columnsChanged","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","vertAligns","top","bottom","middle","hozAligns","left","right","center","style","textAlign","hozAlign","vertAlign","display","alignItems","justifyContent","definition","cssClass","classNames","split","classList","add","val","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","changed","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","el","defaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","traverse","concat","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","assign","addColumn","then","error","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","elVisible","elOffset","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","frozen","ok","find","col","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","generateCells","colEnd","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","working","getCell","fitDataColActualWidthCheck","prepend","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","redrawBlockUpdate","renderer","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","initialize","hozAdjust","scrollWidth","marginLeft","scrollColumns","definitions","sorter","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","fieldRoot","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","fromIndex","toIndex","adjust","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getPosition","watchPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","positionWatchers","created","setData","create","deleteCells","renderRowCells","rerenderRowCells","children","resizableRows","setHeight","clearHeight","updatedData","tempData","newRowData","JSON","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","detachModules","deleteRow","includes","isDisplayed","group","BasicVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","destroyed","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","viewable","RendererVirtualDomVertical","RendererBasicVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","abort","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","response","objectInvert","rowData","clearAlert","alertError","setTimeout","map","shouldLoad","alertManager","alert","langText","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","hideable","blurEvent","escEvent","_escapeCheck","destroyBinding","tableDestroyed","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","lookupIndex","append","menuEl","menuContainer","content","forced","reinitializeColumnWidths","responsiveLayout","modExists","colsWidth","gap","lastCol","responsive","flexWidth","flexGrowUnits","flexColWidth","flexColumns","fixedShrinkColumns","flexShrinkUnits","overflowWidth","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","fitData","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","fitColumns","Layout","mode","registerTableOption","registerColumnOption","modes","dataChanged","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","traverseLang","trans","prop","navigator","language","toLowerCase","prefix","_executeBindings","fillPath","pathArray","_getLangElement","level","rootPath","binding","defaultLangs","Comms","receive","selectors","connections","connection","con","action","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","stack","line","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","Accessor","allowedTypes","initializeColumn","transformRow","charAt","toUpperCase","accessor","lookupAccessor","accessors","rowComponent","colComponent","defaultAccessors","method","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","contentType","urlGenerator","ajaxContentType","contentTypeFormatters","headers","Accept","location","credentials","fetch","json","status","statusText","stringify","form","FormData","Ajax","loaderPromise","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","defaultContentTypeFormatters","updateOrAddData","insert","addData","clipboard","headerFindSuccess","columnMap","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","defaultPasteActions","defaultPasteParsers","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","marginRight","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","groups","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","formatter","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","subChildren","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","setFileContents","delimiter","fileContents","depth","bom","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","orientation","unit","parseRow","styles","colSpan","rowSpan","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","self","sheetName","workbook","XLSX","utils","book_new","tableFeatures","SheetNames","Sheets","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","sheetOnly","sheets","sheet","commsSend","intercept","s2ab","buf","ArrayBuffer","view","Uint8Array","charCodeAt","write","bookType","bookSST","csv","jsonLines","pdf","xlsx","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","buildLink","mime","triggerDownload","downloaders","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","msSaveOrOpenBlob","click","defaultDownloaders","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","onRendered","success","cancel","editorParams","cellValue","input","search","padding","boxSizing","elementAttributes","getAttribute","preventScroll","selectContents","onChange","vertNav","verticalNavigation","whiteSpace","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","stopImmediatePropagation","step","blurFunc","inputFormat","DT","DateTime","luxon","convertDate","newDatetime","isDateTime","fromISO","fromFormat","toFormat","Edit","editor","_initializeParams","displayItems","currentItems","focusedItem","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","clearable","autocomplete","cursor","caretColor","_bindInputEvents","valueKeys","valueCheck","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","blur","deprecationMsg","List","maxStars","getElementsByTagName","size","stars","starsHolder","star","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","percent","bar","mouseDrag","mouseDragWidth","updateValue","calcVal","round","backgroundColor","screenX","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","indeterminate","checked","trueValue","checkedValue","falseValue","textarea","number","date","time","datetime","progress","tickCross","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","rendered","cellEditor","validationMode","focusScrollAdjust","cellClick","cellEditing","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerPos","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","formatterParams","emptyToSpace","sanitizeHTML","floatVal","sign","integer","decimal","rgx","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","urlPrefix","labelTraverse","labelField","urlField","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","suffix","humanize","now","toHuman","starActive","starInactive","colors","color","percentValue","legendAlign","legend","legendColor","barEl","barContainer","legendEl","holderEl","innerText","toggleList","isOpen","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","plaintext","money","link","image","datetimediff","traffic","buttonTick","buttonCross","rownum","responsiveCollapse","rowSelection","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","otherRows","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","toggleElement","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","samePath","every","groupPath","groupId","cellEdit","rowAdd","_rebindRow","rowMove","posFrom","newValue","posTo","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","getGroup","getRowIndex","undoers","redoers","oldRow","defaultUndoers","defaultRedoers","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","csvImporter","inQuote","nextChar","arrayImporter","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","watchers","componentObj","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","bindingList","mapBinding","symbolsList","ctrl","meta","symbols","code","checkBinding","ctrlKey","metaKey","defaultBindings","defaultActions","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","icon","headerMenuIcon","headerMenuEl","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","startXMove","prevColWidth","nextColWidthLast","prevColWidthLast","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","columnHolder","xPos","scrollPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","startYMove","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","defaultMutators","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualRowPageSize","actualStartRow","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","persistenceMode","persistenceID","retrievedData","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupIcon","headerPopupEl","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","scrollX","scrollY","footerEl","tableEl","footerContent","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","startDiff","moveDiff","blockedBefore","blockedAfter","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","nodeHeight","contentRect","nodeWidth","redrawTable","observe","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","colCount","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","titleData","valueData","node_content","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","langLocale","localeCompare","el1","el2","calc","d","string","boolean","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","reg","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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} \ No newline at end of file diff --git a/dist/js/tabulator.min.js b/dist/js/tabulator.min.js index 3fb1ce602..cf706822d 100644 --- a/dist/js/tabulator.min.js +++ b/dist/js/tabulator.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.3.3 (c) Oliver Folkerd 2022 */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabulator=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,r=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return s=e.done,e},e:function(e){r=!0,a=e},f:function(){try{s||null==i.return||i.return()}finally{if(r)throw a}}}}var f=function(){function e(i){t(this,e),this.table=i}return n(e,[{key:"reloadData",value:function(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}},{key:"langText",value:function(){var e;return(e=this.table.modules.localize).getText.apply(e,arguments)}},{key:"langBind",value:function(){var e;return(e=this.table.modules.localize).bind.apply(e,arguments)}},{key:"langLocale",value:function(){var e;return(e=this.table.modules.localize).getLocale.apply(e,arguments)}},{key:"commsConnections",value:function(){var e;return(e=this.table.modules.comms).getConnections.apply(e,arguments)}},{key:"commsSend",value:function(){var e;return(e=this.table.modules.comms).send.apply(e,arguments)}},{key:"layoutMode",value:function(){return this.table.modules.layout.getMode()}},{key:"layoutRefresh",value:function(e){return this.table.modules.layout.layout(e)}},{key:"subscribe",value:function(){var e;return(e=this.table.eventBus).subscribe.apply(e,arguments)}},{key:"unsubscribe",value:function(){var e;return(e=this.table.eventBus).unsubscribe.apply(e,arguments)}},{key:"subscribed",value:function(e){return this.table.eventBus.subscribed(e)}},{key:"subscriptionChange",value:function(){var e;return(e=this.table.eventBus).subscriptionChange.apply(e,arguments)}},{key:"dispatch",value:function(){var e;return(e=this.table.eventBus).dispatch.apply(e,arguments)}},{key:"chain",value:function(){var e;return(e=this.table.eventBus).chain.apply(e,arguments)}},{key:"confirm",value:function(){var e;return(e=this.table.eventBus).confirm.apply(e,arguments)}},{key:"dispatchExternal",value:function(){var e;return(e=this.table.externalEvents).dispatch.apply(e,arguments)}},{key:"subscribedExternal",value:function(e){return this.table.externalEvents.subscribed(e)}},{key:"subscriptionChangeExternal",value:function(){var e;return(e=this.table.externalEvents).subscriptionChange.apply(e,arguments)}},{key:"options",value:function(e){return this.table.options[e]}},{key:"setOption",value:function(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}},{key:"deprecationCheck",value:function(e,t){return this.table.deprecationAdvisor.check(e,t)}},{key:"deprecationCheckMsg",value:function(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}},{key:"deprecationMsg",value:function(e){return this.table.deprecationAdvisor.msg(e)}},{key:"module",value:function(e){return this.table.module(e)}}]),e}(),g=function(){function e(i){return t(this,e),this._column=i,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}return n(e,[{key:"getElement",value:function(){return this._column.getElement()}},{key:"getDefinition",value:function(){return this._column.getDefinition()}},{key:"getField",value:function(){return this._column.getField()}},{key:"getTitleDownload",value:function(){return this._column.getTitleDownload()}},{key:"getCells",value:function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"isVisible",value:function(){return this._column.visible}},{key:"show",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}},{key:"hide",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}},{key:"toggle",value:function(){this._column.visible?this.hide():this.show()}},{key:"delete",value:function(){return this._column.delete()}},{key:"getSubColumns",value:function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}},{key:"getParentColumn",value:function(){return this._column.parent instanceof w&&this._column.parent.getComponent()}},{key:"_getSelf",value:function(){return this._column}},{key:"scrollTo",value:function(){return this._column.table.columnManager.scrollToColumn(this._column)}},{key:"getTable",value:function(){return this._column.table}},{key:"move",value:function(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}},{key:"getNextColumn",value:function(){var e=this._column.nextColumn();return!!e&&e.getComponent()}},{key:"getPrevColumn",value:function(){var e=this._column.prevColumn();return!!e&&e.getComponent()}},{key:"updateDefinition",value:function(e){return this._column.updateDefinition(e)}},{key:"getWidth",value:function(){return this._column.getWidth()}},{key:"setWidth",value:function(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}]),e}(),v={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0},b=function(){function e(i){return t(this,e),this._cell=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}return n(e,[{key:"getValue",value:function(){return this._cell.getValue()}},{key:"getOldValue",value:function(){return this._cell.getOldValue()}},{key:"getInitialValue",value:function(){return this._cell.initialValue}},{key:"getElement",value:function(){return this._cell.getElement()}},{key:"getRow",value:function(){return this._cell.row.getComponent()}},{key:"getData",value:function(){return this._cell.row.getData()}},{key:"getField",value:function(){return this._cell.column.getField()}},{key:"getColumn",value:function(){return this._cell.column.getComponent()}},{key:"setValue",value:function(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}},{key:"restoreOldValue",value:function(){this._cell.setValueActual(this._cell.getOldValue())}},{key:"restoreInitialValue",value:function(){this._cell.setValueActual(this._cell.initialValue)}},{key:"checkHeight",value:function(){this._cell.checkHeight()}},{key:"getTable",value:function(){return this._cell.table}},{key:"_getSelf",value:function(){return this._cell}}]),e}(),y=function(i){o(s,i);var a=u(s);function s(e,i){var n;return t(this,s),(n=a.call(this,e.table)).table=e.table,n.column=e,n.row=i,n.element=null,n.value=null,n.initialValue,n.oldValue=null,n.modules={},n.height=null,n.width=null,n.minWidth=null,n.component=null,n.loaded=!1,n.build(),n}return n(s,[{key:"build",value:function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}},{key:"generateElement",value:function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}},{key:"_configureCell",value:function(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((function(t){e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}},{key:"_generateContents",value:function(){var t,i=this;switch(e(t=this.chain("cell-format",this,null,(function(){return i.element.innerHTML=i.value})))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}},{key:"cellRendered",value:function(){this.dispatch("cell-rendered",this)}},{key:"getElement",value:function(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}},{key:"getValue",value:function(){return this.value}},{key:"getOldValue",value:function(){return this.oldValue}},{key:"setValue",value:function(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}},{key:"setValueProcessData",value:function(e,t,i){var n=!1;return(this.value!==e||i)&&(n=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),n&&this.dispatch("cell-value-changed",this),n}},{key:"setValueActual",value:function(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}},{key:"layoutElement",value:function(){this._generateContents(),this.dispatch("cell-layout",this)}},{key:"setWidth",value:function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}},{key:"clearWidth",value:function(){this.width="",this.element.style.width=""}},{key:"getWidth",value:function(){return this.width||this.element.offsetWidth}},{key:"setMinWidth",value:function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}},{key:"setMaxWidth",value:function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}},{key:"checkHeight",value:function(){this.row.reinitializeHeight()}},{key:"clearHeight",value:function(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}},{key:"setHeight",value:function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}},{key:"getHeight",value:function(){return this.height||this.element.offsetHeight}},{key:"show",value:function(){this.element.style.display=this.column.vertAlign?"inline-flex":""}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"delete",value:function(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}},{key:"getIndex",value:function(){return this.row.getCellIndex(this)}},{key:"getComponent",value:function(){return this.component||(this.component=new b(this)),this.component}}]),s}(f),w=function(i){o(s,i);var a=u(s);function s(e,i){var n;return t(this,s),(n=a.call(this,i.table)).definition=e,n.parent=i,n.type="column",n.columns=[],n.cells=[],n.element=n.createElement(),n.contentElement=!1,n.titleHolderElement=!1,n.titleElement=!1,n.groupElement=n.createGroupElement(),n.isGroup=!1,n.hozAlign="",n.vertAlign="",n.field="",n.fieldStructure="",n.getFieldValue="",n.setFieldValue="",n.titleDownload=null,n.titleFormatterRendered=!1,n.mapDefinitions(),n.setField(n.definition.field),n.modules={},n.width=null,n.widthStyled="",n.maxWidth=null,n.maxWidthStyled="",n.maxInitialWidth=null,n.minWidth=null,n.minWidthStyled="",n.widthFixed=!1,n.visible=!0,n.component=null,n.definition.columns?(n.isGroup=!0,n.definition.columns.forEach((function(e,t){var i=new s(e,r(n));n.attachColumn(i)})),n.checkColumnVisibility()):i.registerColumnField(r(n)),n._initialize(),n}return n(s,[{key:"createElement",value:function(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}},{key:"createGroupElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}},{key:"mapDefinitions",value:function(){var e=this.table.options.columnDefaults;if(e)for(var t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(s.defaultOptionList,this.definition)}},{key:"checkDefinition",value:function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===s.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))}},{key:"setField",value:function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}},{key:"registerColumnPosition",value:function(e){this.parent.registerColumnPosition(e)}},{key:"registerColumnField",value:function(e){this.parent.registerColumnField(e)}},{key:"reRegisterPosition",value:function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}},{key:"_initialize",value:function(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}},{key:"_buildColumnHeader",value:function(){var e=this,t=this.definition;(this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass)&&t.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}},{key:"_buildColumnHeaderContent",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}},{key:"_buildColumnHeaderTitle",value:function(){var e=this,t=this.definition,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,e.dispatchExternal("columnTitleChanged",e.getComponent())})),i.appendChild(n),t.field?this.langBind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,(function(n){e._formatColumnHeaderTitle(i,n||t.title||" ")})):this._formatColumnHeaderTitle(i,t.title||" ");return i}},{key:"_formatColumnHeaderTitle",value:function(t,i){var n=this.chain("column-format",[this,i,t],null,(function(){return i}));switch(e(n)){case"object":n instanceof Node?t.appendChild(n):(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:",n));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=n}}},{key:"_buildGroupHeader",value:function(){var e=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(t){e.element.classList.add(t)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}},{key:"_getFlatData",value:function(e){return e[this.field]}},{key:"_getNestedData",value:function(e){for(var t,i=e,n=this.fieldStructure,o=n.length,a=0;a-1&&this.columns.splice(t,1),this.columns.length||this.delete()}},{key:"setWidth",value:function(e){this.widthFixed=!0,this.setWidthActual(e)}},{key:"setWidthActual",value:function(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}},{key:"checkCellHeights",value:function(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}},{key:"getWidth",value:function(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}},{key:"getHeight",value:function(){return Math.ceil(this.element.getBoundingClientRect().height)}},{key:"setMinWidth",value:function(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}},{key:"setMaxWidth",value:function(e){this.minWidth&&e-1&&this._nextVisibleColumn(e+1)}},{key:"_nextVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}},{key:"prevColumn",value:function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}},{key:"_prevVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}},{key:"reinitializeWidth",value:function(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}},{key:"fitToData",value:function(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((function(e){var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}},{key:"updateDefinition",value:function(e){var t,i=this;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((function(e){return t.field==i.field&&(i.field=!1),i.delete().then((function(){return e.getComponent()}))})))}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"getComponent",value:function(){return this.component||(this.component=new g(this)),this.component}}]),s}(f);w.defaultOptionList=v;var C=function(){function i(){t(this,i)}return n(i,null,[{key:"elVisible",value:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}},{key:"elOffset",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}},{key:"deepClone",value:function(t,i){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={}.__proto__,s=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));var r=function(){var r=t[l],u=void 0,c=void 0;null==r||"object"!==e(r)||r.__proto__!==a&&r.__proto__!==s||((u=o.findIndex((function(e){return e.subject===r})))>-1?i[l]=o[u].copy:(c=Object.assign(Array.isArray(r)?[]:{},r),o.unshift({subject:r,copy:c}),i[l]=n.deepClone(r,c,o)))};for(var l in t)r();return i}}]),i}(),k=function(){function i(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this,i),this.table=e,this.msgType=n,this.registeredDefaults=Object.assign({},o)}return n(i,[{key:"register",value:function(e,t){this.registeredDefaults[e]=t}},{key:"generate",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.registeredDefaults);if(Object.assign(n,t),!1!==i.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var o in i)n.hasOwnProperty(o)||console.warn("Invalid "+this.msgType+" option:",o);for(var a in n)a in i?n[a]=i[a]:Array.isArray(n[a])?n[a]=Object.assign([],n[a]):"object"===e(n[a])&&null!==n[a]?n[a]=Object.assign({},n[a]):void 0===n[a]&&delete n[a];return n}}]),i}(),E=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).elementVertical=e.rowManager.element,n.elementHorizontal=e.columnManager.element,n.tableElement=e.rowManager.tableElement,n.verticalFillMode="fit",n}return n(a,[{key:"initialize",value:function(){}},{key:"clearRows",value:function(){}},{key:"clearColumns",value:function(){}},{key:"reinitializeColumnWidths",value:function(e){}},{key:"renderRows",value:function(){}},{key:"renderColumns",value:function(){}},{key:"rerenderRows",value:function(e){e&&e()}},{key:"rerenderColumns",value:function(e,t){}},{key:"renderRowCells",value:function(e){}},{key:"rerenderRowCells",value:function(e,t){}},{key:"scrollColumns",value:function(e,t){}},{key:"scrollRows",value:function(e,t){}},{key:"resize",value:function(){}},{key:"scrollToRow",value:function(e){}},{key:"scrollToRowNearestTop",value:function(e){}},{key:"visibleRows",value:function(e){return[]}},{key:"rows",value:function(){return this.table.rowManager.getDisplayRows()}},{key:"styleRow",value:function(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}},{key:"clear",value:function(){this.clearRows(),this.clearColumns()}},{key:"render",value:function(){this.renderRows(),this.renderColumns()}},{key:"rerender",value:function(e){this.rerenderRows(),this.rerenderColumns()}},{key:"scrollToRowPosition",value:function(e,t,i){var n=this,o=this.rows().indexOf(e),a=e.getElement(),s=0;return new Promise((function(r,l){if(o>-1){if(void 0===i&&(i=n.table.options.scrollToRowIfVisible),!i&&C.elVisible(a)&&(s=C.elOffset(a).top-C.elOffset(n.elementVertical).top)>0&&se&&(e=i)}})),this.windowBuffer=2*e}},{key:"rerenderColumns",value:function(e,t){var i=this,n={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},o=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((function(e){var t={};if(e.visible){var n=e.getWidth();t.leftPos=o,t.rightPos=o+n,t.width=n,i.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),o+n>i.vDomScrollPosLeft&&othis.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}},{key:"colPositionAdjust",value:function(e,t,i){for(var n=e;n=e.columns.length-1?e.vDomPadRight=0:e.vDomPadRight-=n.getWidth()):i=!1};i;)n();t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"addColLeft",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.leftCol-1];if(n)if(n.modules.vdomHoz.rightPos>=e.vDomScrollPosLeft){t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(n);e.getElement().prepend(t.getElement()),t.cellRendered()}})),e.leftCol--,e.leftCol<=0?e.vDomPadLeft=0:e.vDomPadLeft-=n.getWidth();var o=e.fitDataColActualWidthCheck(n);o&&(e.scrollLeft=e.elementVertical.scrollLeft=e.elementVertical.scrollLeft+o,e.vDomPadRight-=o)}else i=!1;else i=!1};i;)n();t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}},{key:"removeColRight",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.rightCol];n&&n.modules.vdomHoz.leftPos>e.vDomScrollPosRight?(t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(n);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),e.vDomPadRight+=n.getWidth(),e.rightCol--):i=!1};i;)n();t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"removeColLeft",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.leftCol];n&&n.modules.vdomHoz.rightPosi?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}},{key:"generateColumnsFromRowData",value:function(t){var i,n,o=[],a=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var s in i=t[0]){var r={field:s,title:s},l=i[s];switch(e(l)){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(l)?"array":"string";break;default:n=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}r.sorter=n,o.push(r)}if(a)switch(e(a)){case"function":this.table.options.columns=a.call(this.table,o);break;case"object":Array.isArray(a)?o.forEach((function(e){var t=a.find((function(t){return t.field===e.field}));t&&Object.assign(e,t)})):o.forEach((function(e){a[e.field]&&Object.assign(e,a[e.field])})),this.table.options.columns=o}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}}},{key:"setColumns",value:function(e,t){for(var i=this;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach((function(e,t){i._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}},{key:"_addColumn",value:function(e,t,i){var n=new w(e,this),o=n.getElement(),a=i?this.findColumnIndex(i):i;if(i&&a>-1){var s=i.getTopColumn(),r=this.columns.indexOf(s),l=s.getElement();t?(this.columns.splice(r,0,n),l.parentNode.insertBefore(o,l)):(this.columns.splice(r+1,0,n),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n.columnRendered(),n}},{key:"registerColumnField",value:function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}},{key:"registerColumnPosition",value:function(e){this.columnsByIndex.push(e)}},{key:"_reIndexColumns",value:function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}},{key:"verticalAlignHeaders",value:function(){var e=this,t=0;this.redrawBlock||(this.element.style.height="",this.columns.forEach((function(e){e.clearVerticalAlign()})),this.columns.forEach((function(e){var i=e.getHeight();i>t&&(t=i)})),this.element.style.height=t+"px",this.columns.forEach((function(i){i.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),this.table.rowManager.adjustTableSize())}},{key:"findColumn",value:function(t){var i;return"object"!=e(t)?this.columnsByField[t]||!1:t instanceof w?t:t instanceof g?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&(i=[],this.columns.forEach((function(e){i.push(e),i=i.concat(e.getColumns(!0))})),i.find((function(e){return e.element===t}))||!1)}},{key:"getColumnByField",value:function(e){return this.columnsByField[e]}},{key:"getColumnsByFieldRoot",value:function(e){var t=this,i=[];return Object.keys(this.columnsByField).forEach((function(n){n.split(".")[0]===e&&i.push(t.columnsByField[n])})),i}},{key:"getColumnByIndex",value:function(e){return this.columnsByIndex[e]}},{key:"getFirstVisibleColumn",value:function(){var e=this.columnsByIndex.findIndex((function(e){return e.visible}));return e>-1&&this.columnsByIndex[e]}},{key:"getColumns",value:function(){return this.columns}},{key:"findColumnIndex",value:function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))}},{key:"getRealColumns",value:function(){return this.columnsByIndex}},{key:"traverse",value:function(e){this.columnsByIndex.forEach((function(t,i){e(t,i)}))}},{key:"getDefinitions",value:function(e){var t=[];return this.columnsByIndex.forEach((function(i){(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}},{key:"getDefinitionTree",value:function(){var e=[];return this.columns.forEach((function(t){e.push(t.getDefinition(!0))})),e}},{key:"getComponents",value:function(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getWidth",value:function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e}},{key:"moveColumn",value:function(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}},{key:"moveColumnActual",value:function(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}},{key:"_moveColumnInArray",value:function(e,t,i,n,o){var a,s=e.indexOf(t);s>-1&&(e.splice(s,1),(a=e.indexOf(i))>-1?n&&(a+=1):a=s,e.splice(a,0,t),o&&(this.chain("column-moving-rows",[t,i,n],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(s,1)[0];e.cells.splice(a,0,t)}})))}},{key:"scrollToColumn",value:function(e,t,i){var n=this,o=0,a=0,s=0,r=e.getElement();return new Promise((function(l,u){if(void 0===t&&(t=n.table.options.scrollToColumnPosition),void 0===i&&(i=n.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":s=-n.element.clientWidth/2;break;case"right":s=r.clientWidth-n.headersElement.clientWidth}if(!i&&(a=r.offsetLeft)>0&&a+r.offsetWidththis.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,o,a;i.visible&&(n=i.definition.width||0,o=parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,t+=a>o?a:o)})),t}},{key:"addColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var s=n._addColumn(e,t,i);n._reIndexColumns(),n.dispatch("column-add",e,t,i),"fitColumns"!=n.layoutMode()&&s.reinitializeWidth(),n.redraw(!0),n.table.rowManager.reinitialize(),n.rerenderColumns(),o(s)}))}},{key:"deregisterColumn",value:function(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}},{key:"rerenderColumns",value:function(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}},{key:"blockRedraw",value:function(){this.redrawBlock=!0,this.redrawBlockUpdate=null}},{key:"restoreRedraw",value:function(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}},{key:"redraw",value:function(e){C.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}]),s}(f),M=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return n(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"getIndex",value:function(){return this._row.getData("data")[this._row.table.options.index]}},{key:"getPosition",value:function(){return this._row.getPosition()}},{key:"watchPosition",value:function(e){return this._row.watchPosition(e)}},{key:"delete",value:function(){return this._row.delete()}},{key:"scrollTo",value:function(){return this._row.table.rowManager.scrollToRow(this._row)}},{key:"move",value:function(e,t){this._row.moveToRow(e,t)}},{key:"update",value:function(e){return this._row.updateData(e)}},{key:"normalizeHeight",value:function(){this._row.normalizeHeight(!0)}},{key:"_getSelf",value:function(){return this._row}},{key:"reformat",value:function(){return this._row.reinitialize()}},{key:"getTable",value:function(){return this._row.table}},{key:"getNextRow",value:function(){var e=this._row.nextRow();return e?e.getComponent():e}},{key:"getPrevRow",value:function(){var e=this._row.prevRow();return e?e.getComponent():e}}]),e}(),L=function(e){o(a,e);var i=u(a);function a(e,n){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";return t(this,a),(o=i.call(this,n.table)).parent=n,o.data={},o.type=s,o.element=!1,o.modules={},o.cells=[],o.height=0,o.heightStyled="",o.manualHeight=!1,o.outerHeight=0,o.initialized=!1,o.heightInitialized=!1,o.position=0,o.positionWatchers=[],o.component=null,o.created=!1,o.setData(e),o}return n(a,[{key:"create",value:function(){this.created||(this.created=!0,this.generateElement())}},{key:"createElement",value:function(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}},{key:"getElement",value:function(){return this.create(),this.element}},{key:"detachElement",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}},{key:"generateElement",value:function(){this.createElement(),this.dispatch("row-init",this)}},{key:"generateCells",value:function(){this.cells=this.table.columnManager.generateCells(this)}},{key:"initialize",value:function(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}},{key:"reinitializeHeight",value:function(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}},{key:"deinitialize",value:function(){this.initialized=!1}},{key:"deinitializeHeight",value:function(){this.heightInitialized=!1}},{key:"reinitialize",value:function(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}},{key:"calcHeight",value:function(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}},{key:"setCellHeight",value:function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}},{key:"clearCellHeight",value:function(){this.cells.forEach((function(e){e.clearHeight()}))}},{key:"normalizeHeight",value:function(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}},{key:"setHeight",value:function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}},{key:"getHeight",value:function(){return this.outerHeight}},{key:"getWidth",value:function(){return this.element.offsetWidth}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"setData",value:function(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}},{key:"updateData",value:function(e){var t,i=this,n=this.element&&C.elVisible(this.element),o={};return new Promise((function(a,s){for(var r in"string"==typeof e&&(e=JSON.parse(e)),i.dispatch("row-data-save-before",i),i.subscribed("row-data-changing")&&(o=Object.assign(o,i.data),o=Object.assign(o,e)),t=i.chain("row-data-changing",[i,o,e],null,e))i.data[r]=t[r];for(var l in i.dispatch("row-data-save-after",i),e){i.table.columnManager.getColumnsByFieldRoot(l).forEach((function(e){var o=i.getCell(e.getField());if(o){var a=e.getFieldValue(t);o.getValue()!=a&&(o.setValueProcessData(a),n&&o.cellRendered())}}))}n?(i.normalizeHeight(!0),i.table.options.rowFormatter&&i.table.options.rowFormatter(i.getComponent())):(i.initialized=!1,i.height=0,i.heightStyled=""),i.dispatch("row-data-changed",i,n,e),i.dispatchExternal("rowUpdated",i.getComponent()),i.subscribedExternal("dataChanged")&&i.dispatchExternal("dataChanged",i.table.rowManager.getData()),a()}))}},{key:"getData",value:function(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}},{key:"getCell",value:function(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}},{key:"getCellIndex",value:function(e){return this.cells.findIndex((function(t){return t===e}))}},{key:"findCell",value:function(e){return this.cells.find((function(t){return t.element===e}))}},{key:"getCells",value:function(){return this.initialized||this.generateCells(),this.cells}},{key:"nextRow",value:function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}},{key:"prevRow",value:function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}},{key:"moveToRow",value:function(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}},{key:"delete",value:function(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}},{key:"deleteActual",value:function(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}},{key:"detachModules",value:function(){this.dispatch("row-deleting",this)}},{key:"deleteCells",value:function(){for(var e=this.cells.length,t=0;tMath.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}},{key:"scrollToRow",value:function(e){var t=e.getElement();this.elementVertical.scrollTop=C.elOffset(t).top-C.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}},{key:"visibleRows",value:function(e){return this.rows()}}]),a}(E),D=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).verticalFillMode="fill",n.scrollTop=0,n.scrollLeft=0,n.vDomRowHeight=20,n.vDomTop=0,n.vDomBottom=0,n.vDomScrollPosTop=0,n.vDomScrollPosBottom=0,n.vDomTopPad=0,n.vDomBottomPad=0,n.vDomMaxRenderChain=90,n.vDomWindowBuffer=0,n.vDomWindowMinTotalRows=20,n.vDomWindowMinMarginRows=5,n.vDomTopNewRows=[],n.vDomBottomNewRows=[],n}return n(a,[{key:"clearRows",value:function(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}},{key:"renderRows",value:function(){this._virtualRenderFill()}},{key:"rerenderRows",value:function(e){for(var t=this.elementVertical.scrollTop,i=!1,n=!1,o=this.table.rowManager.scrollLeft,a=this.rows(),s=this.vDomTop;s<=this.vDomBottom;s++)if(a[s]){var r=t-a[s].getElement().offsetTop;if(!(!1===n||Math.abs(r)o||n>o){var s=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*a.length)),this.scrollColumns(s)}else t?(i<0&&this._addTopRow(a,-i),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(a,-n):this.vDomScrollPosBottom=this.scrollTop)):(n>=0&&this._addBottomRow(a,n),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(a,i):this.vDomScrollPosTop=this.scrollTop))}},{key:"resize",value:function(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}},{key:"scrollToRowNearestTop",value:function(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}},{key:"scrollToRow",value:function(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}},{key:"visibleRows",value:function(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,n=!1,o=0,a=0,s=this.rows();if(e)o=this.vDomTop,a=this.vDomBottom;else for(var r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r])if(n){if(!(i-s[r].getElement().offsetTop>=0))break;a=r}else if(t-s[r].getElement().offsetTop>=0)o=r;else{if(n=!0,!(i-s[r].getElement().offsetTop>=0))break;a=r}return s.slice(o,a+1)}},{key:"_virtualRenderFill",value:function(e,t,i){var n=this.tableElement,o=this.elementVertical,a=0,s=0,r=0,l=0,u=0,c=this.rows(),h=c.length,d=this.elementVertical.clientHeight;if(i=i||0,e=e||0){for(;n.firstChild;)n.removeChild(n.firstChild);(r=(h-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*m),this.vDomBottom++,u++}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-l,this.vDomBottomPad=this.vDomBottom==h-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-s-l,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((s+l)/u),this.vDomBottomPad=this.vDomRowHeight*(h-this.vDomBottom-1),this.vDomScrollHeight=l+s+this.vDomBottomPad-d),n.style.paddingTop=this.vDomTopPad+"px",n.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+l+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-d:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-d),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-d),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}},{key:"_addTopRow",value:function(e,t){for(var i=this.tableElement,n=[],o=0,a=this.vDomTop-1,s=0,r=!0;r;)if(this.vDomTop){var l=e[a],u=void 0,c=void 0;l&&s=u?(this.styleRow(l,a),i.insertBefore(l.getElement(),i.firstChild),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),c||(u=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*u),t-=u,o+=u,this.vDomTop--,a--,s++):r=!1):r=!1}else r=!1;for(var h=0,d=n;h=(r=s.getHeight()||this.vDomRowHeight)?(this.vDomTop++,t-=r,n+=r,i.push(s),o++):a=!1}for(var l=0,u=i;l=u?(this.styleRow(l,a),i.appendChild(l.getElement()),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),c||(u=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*u),t-=u,o+=u,this.vDomBottom++,a++,s++):r=!1):r=!1}for(var h=0,d=n;h=(r=s.getHeight()||this.vDomRowHeight)?(this.vDomBottom--,t-=r,n+=r,i.push(s),o++):a=!1}for(var l=0,u=i;lt,n=e.element.scrollTop,o=e.scrollTop>n;e.scrollLeft!=t&&(e.scrollLeft=t,e.dispatch("scroll-horizontal",t,i),e.dispatchExternal("scrollHorizontal",t,i),e._positionPlaceholder()),e.scrollTop!=n&&(e.scrollTop=n,e.renderer.scrollRows(n,o),e.dispatch("scroll-vertical",n,o),e.dispatchExternal("scrollVertical",n,o))}))}},{key:"findRow",value:function(t){var i=this;return"object"!=e(t)?void 0!==t&&(this.rows.find((function(e){return e.data[i.table.options.index]==t}))||!1):t instanceof L?t:t instanceof M?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.rows.find((function(e){return e.getElement()===t}))||!1}},{key:"getRowFromDataObject",value:function(e){return this.rows.find((function(t){return t.data===e}))||!1}},{key:"getRowFromPosition",value:function(e){return this.getDisplayRows().find((function(t){return t.getPosition()===e&&t.isDisplayed()}))}},{key:"scrollToRow",value:function(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}},{key:"setData",value:function(e,t,i){var n=this;return new Promise((function(o,a){t&&n.getDisplayRows().length?n.table.options.pagination?n._setDataActual(e,!0):n.reRenderInPosition((function(){n._setDataActual(e)})):(n.table.options.autoColumns&&i&&n.table.initialized&&n.table.columnManager.generateColumnsFromRowData(e),n.resetScroll(),n._setDataActual(e)),o()}))}},{key:"_setDataActual",value:function(t,i){var n=this;this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((function(t,i){if(t&&"object"===e(t)){var o=new L(t,n);n.rows.push(o)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)})),this.refreshActiveData(!1,!1,i),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",e(t),"\nData: ",t)}},{key:"_wipeElements",value:function(){this.dispatch("rows-wipe"),this.rows.forEach((function(e){e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}},{key:"deleteRow",value:function(e,t){var i=this.rows.indexOf(e),n=this.activeRows.indexOf(e);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}},{key:"addRow",value:function(e,t,i,n){return this.addRowActual(e,t,i,n)}},{key:"addRows",value:function(e,t,i){var n=this,o=[];return new Promise((function(a,s){t=n.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach((function(a,s){var r=n.addRow(a,t,i,!0);o.push(r),n.dispatch("row-added",r,e,t,i)})),n.refreshActiveData(!1,!1,!0),n.regenerateRowPositions(),o.length&&n._clearPlaceholder(),a(o)}))}},{key:"findAddRowPos",value:function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}},{key:"addRowActual",value:function(e,t,i,n){var o,a,s=e instanceof L?e:new L(e||{},this),r=this.findAddRowPos(t),l=-1;return i||(a=this.chain("row-adding-position",[s,r],null,{index:i,top:r}),i=a.index,r=a.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[s,i,r],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(r?t:t+1,0,s)})),o>-1&&this.activeRows.splice(r?o:o+1,0,s),this.rows.splice(r?l:l+1,0,s)):r?(this.displayRowIterator((function(e){e.unshift(s)})),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator((function(e){e.push(s)})),this.activeRows.push(s),this.rows.push(s)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",s.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),s}},{key:"moveRow",value:function(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}},{key:"moveRowActual",value:function(e,t,i){var n=this;this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((function(o){n.moveRowInArray(o,e,t,i)})),this.dispatch("row-moving",e,t,i)}},{key:"moveRowInArray",value:function(e,t,i,n){var o,a,s;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(a=e.indexOf(i))>-1?n?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){s=a>o?a:o+1;for(var r=o-1&&t}},{key:"nextDisplayRow",value:function(e,t){var i=this.getDisplayRowIndex(e),n=!1;return!1!==i&&i-1)&&i}},{key:"getData",value:function(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}},{key:"getComponents",value:function(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getDataCount",value:function(e){return this.getRows(e).length}},{key:"scrollHorizontal",value:function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}},{key:"registerDataPipelineHandler",value:function(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Data pipeline handlers must have a priority in order to be registered")}},{key:"registerDisplayPipelineHandler",value:function(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Display pipeline handlers must have a priority in order to be registered")}},{key:"refreshActiveData",value:function(e,t,i){var n=this.table,o="",a=0,s=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((a=this.dataPipeline.findIndex((function(t){return t.handler===e})))>-1)o="dataPipeline",t&&(a==this.dataPipeline.length-1?o="display":a++);else{if(!((a=this.displayPipeline.findIndex((function(t){return t.handler===e})))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);o="displayPipeline",t&&(a==this.displayPipeline.length-1?o="end":a++)}else o=e||"all",a=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a-1&&(n.splice(o,1),a=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),a&&this.updateEventListeners()}},{key:"updateEventListeners",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}},{key:"track",value:function(e,t){var i=t.composedPath&&t.composedPath()||t.path,n=this.findTargets(i);n=this.bindComponents(e,n),this.triggerEvents(e,t,n),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(n).length||this.pseudoMouseLeave("none",t)}},{key:"findTargets",value:function(e){var t,i=this,n={},o=Object.keys(this.componentMap),a=p(e);try{for(a.s();!(t=a.n()).done;){var s=t.value,r=s.classList?h(s.classList):[];if(r.filter((function(e){return i.abortClasses.includes(e)})).length)break;var l,u=p(r.filter((function(e){return o.includes(e)})));try{for(u.s();!(l=u.n()).done;){var c=l.value;n[this.componentMap[c]]||(n[this.componentMap[c]]=s)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}return n.group&&n.group===n.row&&delete n.row,n}},{key:"bindComponents",value:function(e,t){var i,n=this,o=Object.keys(t).reverse(),a=this.listeners[e],s={},r={},l=p(o);try{var u=function(){var e=i.value,o=void 0,l=t[e],u=n.previousTargets[e];if(u&&u.target===l)o=u.component;else switch(e){case"row":case"group":if(a.components.includes("row")||a.components.includes("cell")||a.components.includes("group"))o=n.table.rowManager.getVisibleRows(!0).find((function(e){return e.getElement()===l})),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1);break;case"column":a.components.includes("column")&&(o=n.table.columnManager.findColumn(l));break;case"cell":a.components.includes("cell")&&(s.row instanceof L?o=s.row.findCell(l):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}o&&(s[e]=o,r[e]={target:l,component:o})};for(l.s();!(i=l.n()).done;)u()}catch(e){l.e(e)}finally{l.f()}return this.previousTargets=r,s}},{key:"triggerEvents",value:function(e,t,i){var n=this.listeners[e];for(var o in i)i[o]&&n.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}},{key:"clearWatchers",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}]),a}(f),H=function(){function e(i){t(this,e),this.table=i,this.bindings={}}return n(e,[{key:"bind",value:function(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}},{key:"handle",value:function(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}]),e}(),O=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).requestOrder=0,i.loading=!1,i}return n(s,[{key:"initialize",value:function(){}},{key:"load",value:function(t,i,n,o,a,s){var r=this,l=++this.requestOrder;return this.dispatchExternal("dataLoading",t),!t||0!=t.indexOf("{")&&0!=t.indexOf("[")||(t=JSON.parse(t)),this.confirm("data-loading",[t,i,n,a])?(this.loading=!0,a||this.alertLoader(),i=this.chain("data-params",[t,n,a],i||{},i||{}),i=this.mapParams(i,this.table.options.dataSendParams),this.chain("data-load",[t,i,n,a],!1,Promise.resolve([])).then((function(t){Array.isArray(t)||"object"!=e(t)||(t=r.mapParams(t,r.objectInvert(r.table.options.dataReceiveParams)));var i=r.chain("data-loaded",t,null,t);l==r.requestOrder?(r.clearAlert(),!1!==i&&(r.dispatchExternal("dataLoaded",i),r.table.rowManager.setData(i,o,void 0===s?!o:s))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((function(e){console.error("Data Load Error: ",e),r.dispatchExternal("dataLoadError",e),a||r.alertError(),setTimeout((function(){r.clearAlert()}),r.table.options.dataLoaderErrorTimeout)})).finally((function(){r.loading=!1}))):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,o,void 0===s?!o:s),Promise.resolve())}},{key:"mapParams",value:function(e,t){var i={};for(var n in e)i[t.hasOwnProperty(n)?t[n]:n]=e[n];return i}},{key:"objectInvert",value:function(e){var t={};for(var i in e)t[e[i]]=i;return t}},{key:"blockActiveLoad",value:function(){this.requestOrder++}},{key:"alertLoader",value:function(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}},{key:"alertError",value:function(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}},{key:"clearAlert",value:function(){this.table.alertManager.clear()}}]),s}(f),A=function(){function e(i,n,o){t(this,e),this.table=i,this.events={},this.optionsList=n||{},this.subscriptionNotifiers={},this.dispatch=o?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=o}return n(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_notifySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e,t=this,i=Array.from(arguments),n=i.shift();return this.events[n]&&this.events[n].forEach((function(n,o){var a=n.apply(t.table,i);o||(e=a)})),e}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="ExternalEvent:"+t[0],!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._dispatch.apply(this,arguments)}}]),e}(),_=function(){function e(i){t(this,e),this.events={},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=i?this._debugChain.bind(this):this._chain.bind(this),this.confirm=i?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=i}return n(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((function(e,t){return e.priority-t.priority})),this._notifySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e.callback===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_chain",value:function(e,t,i,n){var o=this,a=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((function(e,i){a=e.callback.apply(o,t.concat([a]))})),a):"function"==typeof n?n():n}},{key:"_confirm",value:function(e,t){var i=this,n=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((function(e,o){e.callback.apply(i,t)&&(n=!0)})),n}},{key:"_notifySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e=this,t=Array.from(arguments),i=t.shift();this.events[i]&&this.events[i].forEach((function(i){i.callback.apply(e,t)}))}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._dispatch.apply(this,arguments)}},{key:"_debugChain",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._chain.apply(this,arguments)}},{key:"_debugConfirm",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._confirm.apply(this,arguments)}}]),e}(),B=function(e){o(a,e);var i=u(a);function a(e){return t(this,a),i.call(this,e)}return n(a,[{key:"_warnUser",value:function(){var e;this.options("debugDeprecation")&&(e=console).warn.apply(e,arguments)}},{key:"check",value:function(e,t){var i="";return void 0===this.options(e)||(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1)}},{key:"checkMsg",value:function(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}},{key:"msg",value:function(e){this._warnUser(e)}}]),a}(f),I=function(){function e(){t(this,e)}return n(e,null,[{key:"register",value:function(t){e.tables.push(t)}},{key:"deregister",value:function(t){var i=e.tables.indexOf(t);i>-1&&e.tables.splice(i,1)}},{key:"lookupTable",value:function(t,i){var n,o,a=[];if("string"==typeof t){if((n=document.querySelectorAll(t)).length)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:this.table.element;return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}},{key:"renderCallback",value:function(e){this.renderedCallback=e}},{key:"containerEventCoords",value:function(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){var o=C.elOffset(this.container);i-=o.left,n-=o.top}return{x:i,y:n}}},{key:"elementPositionCoords",value:function(e){var t,i,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right",a=C.elOffset(e);switch(this.container!==document.body&&(t=C.elOffset(this.container),a.left-=t.left,a.top-=t.top),o){case"right":i=a.left+e.offsetWidth,n=a.top-1;break;case"bottom":i=a.left,n=a.top+e.offsetHeight}return{x:i,y:n,offset:a}}},{key:"show",value:function(e,t){var i,n,o,a,s;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,a=(s=this.elementPositionCoords(e,t)).offset,i=s.x,n=s.y):"number"==typeof e?(a={top:0,left:0},i=e,n=t):(i=(s=this.containerEventCoords(e)).x,n=s.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,n,o,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(function(e){e.stopPropagation()}))),this}},{key:"_fitToScreen",value:function(e,t,i,n,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-n.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}},{key:"isVisible",value:function(){return this.visible}},{key:"hideOnBlur",value:function(e){var t=this;return this.blurable=!0,this.visible&&(setTimeout((function(){t.table.rowManager.element.addEventListener("scroll",t.blurEvent),t.subscribe("cell-editing",t.blurEvent),document.body.addEventListener("click",t.blurEvent),document.body.addEventListener("contextmenu",t.blurEvent),document.body.addEventListener("mousedown",t.blurEvent),window.addEventListener("resize",t.blurEvent),document.body.addEventListener("keydown",t.escEvent)}),100),this.blurCallback=e),this}},{key:"_escapeCheck",value:function(e){27==e.keyCode&&this.hide()}},{key:"blockHide",value:function(){this.hideable=!1}},{key:"restoreHide",value:function(){this.hideable=!0}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.visible&&this.hideable&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}},{key:"child",value:function(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new a(this.table,e,this),this.childPopup}}]),a}(f),N=function(e){o(a,e);var i=u(a);function a(e,n){var o;return t(this,a),(o=i.call(this,e))._handler=null,o}return n(a,[{key:"initialize",value:function(){}},{key:"registerTableOption",value:function(e,t){this.table.optionsList.register(e,t)}},{key:"registerColumnOption",value:function(e,t){this.table.columnManager.optionsList.register(e,t)}},{key:"registerTableFunction",value:function(e,t){var i=this;void 0===this.table[e]?this.table[e]=function(){return i.table.initGuard(e),t.apply(void 0,arguments)}:console.warn("Unable to bind table function, name already in use",e)}},{key:"registerComponentFunction",value:function(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}},{key:"registerDataHandler",value:function(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}},{key:"registerDisplayHandler",value:function(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}},{key:"displayRows",value:function(e){var t,i=this,n=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((function(e){return e.handler===i._handler})))>-1&&(n=t),e&&(n+=e),this._handler)return n>-1?this.table.rowManager.getDisplayRows(n):this.activeRows()}},{key:"activeRows",value:function(){return this.table.rowManager.activeRows}},{key:"refreshData",value:function(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}},{key:"footerAppend",value:function(e){return this.table.footerManager.append(e)}},{key:"footerPrepend",value:function(e){return this.table.footerManager.prepend(e)}},{key:"footerRemove",value:function(e){return this.table.footerManager.remove(e)}},{key:"popup",value:function(e,t){return new V(this.table,e,t)}},{key:"alert",value:function(e,t){return this.table.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){return this.table.alertManager.clear()}}]),a}(f);function W(e,t){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var j={fitData:function(e,t){t&&this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:W,fitDataTable:W,fitDataStretch:function(e,t){var i=this,n=0,o=this.table.rowManager.element.clientWidth,a=0,s=!1;e.forEach((function(e,t){e.widthFixed||e.reinitializeWidth(),(i.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(s=e),e.visible&&(n+=e.getWidth())})),s?(a=o-n+s.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(s.setWidth(0),this.table.modules.responsiveLayout.update()),a>0?s.setWidth(a):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,n,o=this.table.rowManager.element.getBoundingClientRect().width,a=0,s=0,r=0,l=[],u=[],c=0,h=0;function d(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function m(e,t,i,n){var o=[],a=0,s=0,l=0,u=r,c=0,h=0,p=[];function f(e){return i*(e.column.definition.widthGrow||1)}function g(e){return d(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,a){var s=n?g(e):f(e);e.column.minWidth>=s?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,n;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(n=d(t),a+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),c+=e.definition.widthShrink)):(l.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),s=o-a,i=Math.floor(s/r),h=m(l,s,i,!1),l.length&&h>0&&(l[l.length-1].width+=h),l.forEach((function(e){s-=e.width})),(n=Math.abs(h)+s)>0&&c&&(h=m(u,n,Math.floor(n/c),!0)),h&&u.length&&(u[u.length-1].width-=h),l.forEach((function(e){e.column.setWidth(e.width)})),u.forEach((function(e){e.column.setWidth(e.width)}))}},G=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e,"layout")).mode=null,n.registerTableOption("layout","fitData"),n.registerTableOption("layoutColumnsOnNewData",!1),n.registerColumnOption("widthGrow"),n.registerColumnOption("widthShrink"),n}return n(a,[{key:"initialize",value:function(){var e=this.table.options.layout;a.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}},{key:"getMode",value:function(){return this.mode}},{key:"layout",value:function(e){this.dispatch("layout-refreshing"),a.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}]),a}(N);G.moduleName="layout",G.modes=j;var U=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).locale="default",i.lang=!1,i.bindings={},i.langList={},i.registerTableOption("locale",!1),i.registerTableOption("langs",{}),i}return n(s,[{key:"initialize",value:function(){for(var e in this.langList=C.deepClone(s.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder),this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}},{key:"setHeaderFilterPlaceholder",value:function(e){this.langList.default.headerFilters.default=e}},{key:"setHeaderFilterColumnPlaceholder",value:function(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}},{key:"installLang",value:function(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}},{key:"_setLangProp",value:function(t,i){for(var n in i)t[n]&&"object"==e(t[n])?this._setLangProp(t[n],i[n]):t[n]=i[n]}},{key:"setLocale",value:function(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){var i=t.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=C.deepClone(this.langList.default||{}),"default"!=t&&function t(i,n){for(var o in i)"object"==e(i[o])?(n[o]||(n[o]={}),t(i[o],n[o])):n[o]=i[o]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}},{key:"getLocale",value:function(e){return this.locale}},{key:"getLang",value:function(e){return e?this.langList[e]:this.lang}},{key:"getText",value:function(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}},{key:"_getLangElement",value:function(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}},{key:"bind",value:function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}},{key:"_executeBindings",value:function(){var e=this,t=function(t){e.bindings[t].forEach((function(i){i(e.getText(t),e.lang)}))};for(var i in this.bindings)t(i)}}]),s}(N);U.moduleName="localize",U.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};var X=function(e){o(a,e);var i=u(a);function a(e){return t(this,a),i.call(this,e)}return n(a,[{key:"initialize",value:function(){this.registerTableFunction("tableComms",this.receive.bind(this))}},{key:"getConnections",value:function(e){var t=this,i=[];return I.lookupTable(e).forEach((function(e){t.table!==e&&i.push(e)})),i}},{key:"send",value:function(e,t,i,n){var o=this,a=this.getConnections(e);a.forEach((function(e){e.tableComms(o.table.element,t,i,n)})),!a.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}},{key:"receive",value:function(e,t,i,n){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,n);console.warn("Inter-table Comms Error - no such module:",t)}}]),a}(N);X.moduleName="comms";var q=Object.freeze({__proto__:null,LayoutModule:G,LocalizeModule:U,CommsModule:X}),K=function(){function i(e,n){t(this,i),this.bindStaticFunctionality(e),this.bindModules(e,q,!0),n&&this.bindModules(e,n)}return n(i,[{key:"bindStaticFunctionality",value:function(t){t.moduleBindings={},t.extendModule=function(i,n,o){if(t.moduleBindings[i]){var a=t.moduleBindings[i][n];if(a)if("object"==e(o))for(var s in o)a[s]=o[s];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",n)}else console.warn("Module Error - module does not exist:",i)},t.registerModule=function(e){Array.isArray(e)||(e=[e]),e.forEach((function(e){t.registerModuleBinding(e)}))},t.registerModuleBinding=function(e){t.moduleBindings[e.moduleName]=e},t.findTable=function(e){var t=I.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},t.prototype.bindModules=function(){var e=[],i=[],n=[];for(var o in this.modules={},t.moduleBindings){var a=t.moduleBindings[o],s=new a(this);this.modules[o]=s,a.prototype.moduleCore?this.modulesCore.push(s):a.moduleInitOrder?a.moduleInitOrder<0?e.push(s):i.push(s):n.push(s)}e.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),i.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),this.modulesRegular=e.concat(n.concat(i))}}},{key:"bindModules",value:function(e,t,i){var n=Object.values(t);i&&n.forEach((function(e){e.prototype.moduleCore=!0})),e.registerModule(n)}}]),i}(),J=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).element=n._createAlertElement(),n.msgElement=n._createMsgElement(),n.type=null,n.element.appendChild(n.msgElement),n}return n(a,[{key:"_createAlertElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}},{key:"_createMsgElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}},{key:"_typeClass",value:function(){return"tabulator-alert-state-"+this.type}},{key:"alert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"msg";if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}},{key:"clear",value:function(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}]),a}(f),Y=function(){function i(e,n){var o=this;t(this,i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new H(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new B(this),this.optionsList=new k(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(n),setTimeout((function(){o._create()}))),I.register(this)}return n(i,[{key:"initializeElement",value:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}},{key:"initializeCoreSystems",value:function(e){this.columnManager=new T(this),this.rowManager=new P(this),this.footerManager=new z(this),this.dataLoader=new O(this),this.alertManager=new J(this),this.bindModules(),this.options=this.optionsList.generate(i.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new A(this,this.options,this.options.debugEventsExternal),this.eventBus=new _(this.options.debugEventsInternal),this.interactionMonitor=new F(this),this.dataLoader.initialize(),this.footerManager.initialize()}},{key:"_mapDeprecatedFunctionality",value:function(){}},{key:"_clearSelection",value:function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}},{key:"_create",value:function(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}},{key:"_rtlCheck",value:function(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}},{key:"_clearObjectPointers",value:function(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}},{key:"_buildElement",value:function(){var t,i=this.element,n=this.options;if("TABLE"===i.tagName){this.originalElement=this.element,t=document.createElement("div");var o=i.attributes;for(var a in o)"object"==e(o[a])&&t.setAttribute(o[a].name,o[a].value);i.parentNode.replaceChild(t,i),this.element=i=t}for(i.classList.add("tabulator"),i.setAttribute("role","grid");i.firstChild;)i.removeChild(i.firstChild);n.height&&(n.height=isNaN(n.height)?n.height:n.height+"px",i.style.height=n.height),!1!==n.minHeight&&(n.minHeight=isNaN(n.minHeight)?n.minHeight:n.minHeight+"px",i.style.minHeight=n.minHeight),!1!==n.maxHeight&&(n.maxHeight=isNaN(n.maxHeight)?n.maxHeight:n.maxHeight+"px",i.style.maxHeight=n.maxHeight)}},{key:"_initializeTable",value:function(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((function(e){e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((function(e){e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}},{key:"_loadInitialData",value:function(){this.dataLoader.load(this.options.data)}},{key:"destroy",value:function(){var e=this.element;for(this.destroyed=!0,I.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}},{key:"_detectBrowser",value:function(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}},{key:"initGuard",value:function(e,t){var i,n;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(n="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?n.trim().split(" ")[1].split(".")[1]:n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}},{key:"blockRedraw",value:function(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}},{key:"restoreRedraw",value:function(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}},{key:"setData",value:function(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}},{key:"clearData",value:function(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}},{key:"getData",value:function(e){return this.rowManager.getData(e)}},{key:"getDataCount",value:function(e){return this.rowManager.getDataCount(e)}},{key:"replaceData",value:function(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}},{key:"updateData",value:function(e){var t=this,i=0;return this.initGuard(),new Promise((function(n,o){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((function(e){var o=t.rowManager.findRow(e[t.options.index]);o&&(i++,o.updateData(e).then((function(){--i||n()})))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}},{key:"addData",value:function(e,t,i){var n=this;return this.initGuard(),new Promise((function(o,a){n.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?n.rowManager.addRows(e,t,i).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),o(t)})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"updateOrAddData",value:function(e){var t=this,i=[],n=0;return this.initGuard(),new Promise((function(o,a){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((function(e){var a=t.rowManager.findRow(e[t.options.index]);n++,a?a.updateData(e).then((function(){n--,i.push(a.getComponent()),n||o(i)})):t.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||o(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"getRow",value:function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"getRowFromPosition",value:function(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"deleteRow",value:function(e){var t=this,i=[];this.initGuard(),Array.isArray(e)||(e=[e]);var n,o=p(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.rowManager.findRow(a,!0);if(!s)return console.error("Delete Error - No matching row found:",a),Promise.reject("Delete Error - No matching row found");i.push(s)}}catch(e){o.e(e)}finally{o.f()}return i.sort((function(e,i){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(i)?1:-1})),i.forEach((function(e){e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}},{key:"addRow",value:function(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((function(e){return e[0].getComponent()}))}},{key:"updateOrAddRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return i.getComponent()})):this.rowManager.addRows(t).then((function(e){return e[0].getComponent()}))}},{key:"updateRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return Promise.resolve(i.getComponent())})):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}},{key:"scrollToRow",value:function(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}},{key:"moveRow",value:function(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}},{key:"getRows",value:function(e){return this.rowManager.getComponents(e)}},{key:"getRowPosition",value:function(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}},{key:"setColumns",value:function(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}},{key:"getColumns",value:function(e){return this.columnManager.getComponents(e)}},{key:"getColumn",value:function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}},{key:"getColumnDefinitions",value:function(){return this.columnManager.getDefinitionTree()}},{key:"showColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}},{key:"hideColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}},{key:"toggleColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}},{key:"addColumn",value:function(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then((function(e){return e.getComponent()}))}},{key:"deleteColumn",value:function(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}},{key:"updateColumnDefinition",value:function(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}},{key:"moveColumn",value:function(e,t,i){var n=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),n?o?this.columnManager.moveColumn(n,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}},{key:"scrollToColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var s=n.columnManager.findColumn(e);return s?n.columnManager.scrollToColumn(s,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}},{key:"redraw",value:function(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}},{key:"setHeight",value:function(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}},{key:"on",value:function(e,t){this.externalEvents.subscribe(e,t)}},{key:"off",value:function(e,t){this.externalEvents.unsubscribe(e,t)}},{key:"dispatchEvent",value:function(){var e,t=Array.from(arguments);t.shift(),(e=this.externalEvents).dispatch.apply(e,arguments)}},{key:"alert",value:function(e,t){this.initGuard(),this.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){this.initGuard(),this.alertManager.clear()}},{key:"modExists",value:function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}},{key:"module",value:function(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}]),i}();Y.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new K(Y);var $=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).allowedTypes=["","data","download","clipboard","print","htmlOutput"],i.registerColumnOption("accessor"),i.registerColumnOption("accessorParams"),i.registerColumnOption("accessorData"),i.registerColumnOption("accessorDataParams"),i.registerColumnOption("accessorDownload"),i.registerColumnOption("accessorDownloadParams"),i.registerColumnOption("accessorClipboard"),i.registerColumnOption("accessorClipboardParams"),i.registerColumnOption("accessorPrint"),i.registerColumnOption("accessorPrintParams"),i.registerColumnOption("accessorHtmlOutput"),i.registerColumnOption("accessorHtmlOutputParams"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,s="accessor"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[s]&&(a=t.lookupAccessor(e.definition[s]))&&(i=!0,n[s]={accessor:a,params:e.definition[s+"Params"]||{}})})),i&&(e.modules.accessor=n)}},{key:"lookupAccessor",value:function(t){var i=!1;switch(e(t)){case"string":s.accessors[t]?i=s.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),o=C.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var a,s,r,l;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(a=e.getFieldValue(o))&&(l=e.getComponent(),r="function"==typeof s.params?s.params(a,o,t,l,n):s.params,e.setFieldValue(o,s.accessor(a,o,t,r,l,n)))})),o}}]),s}(N);$.moduleName="accessor",$.accessors={};function Z(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(Z(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(Z(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}function Q(e){var t=Z(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function ee(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+Q(i))),e}function te(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(te(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(te(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}var ie={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var n=te(i),o=new FormData;return n.forEach((function(e){o.append(e.key,e.value)})),o}}},ne=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).config={},n.url="",n.urlGenerator=!1,n.params=!1,n.loaderPromise=!1,n.registerTableOption("ajaxURL",!1),n.registerTableOption("ajaxURLGenerator",!1),n.registerTableOption("ajaxParams",{}),n.registerTableOption("ajaxConfig","get"),n.registerTableOption("ajaxContentType","form"),n.registerTableOption("ajaxRequestFunc",!1),n.registerTableOption("ajaxRequesting",(function(){})),n.registerTableOption("ajaxResponse",!1),n.contentTypeFormatters=a.contentTypeFormatters,n}return n(a,[{key:"initialize",value:function(){this.loaderPromise=this.table.options.ajaxRequestFunc||a.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||a.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}},{key:"requestParams",value:function(e,t,i,n){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),n=Object.assign(n,o)),n}},{key:"requestDataCheck",value:function(e,t,i,n){return!((e||!this.url)&&"string"!=typeof e)}},{key:"requestData",value:function(e,t,i,n,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}},{key:"setDefaultConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=Object.assign({},a.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}},{key:"generateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}},{key:"setUrl",value:function(e){this.url=e}},{key:"getUrl",value:function(){return this.url}},{key:"sendRequest",value:function(e,t,i){var n=this;return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((function(i){return n.table.options.ajaxResponse&&(i=n.table.options.ajaxResponse.call(n.table,e,t,i)),i})):Promise.reject()}}]),a}(N);ne.moduleName="ajax",ne.defaultConfig={method:"GET"},ne.defaultURLGenerator=ee,ne.defaultLoaderPromise=function(t,i,n){var o,a=this;return new Promise((function(s,r){if(t=a.urlGenerator.call(a.table,t,i,n),"GET"!=i.method.toUpperCase())if(o="object"===e(a.table.options.ajaxContentType)?a.table.options.ajaxContentType:a.contentTypeFormatters[a.table.options.ajaxContentType]){for(var l in o.headers)i.headers||(i.headers={}),void 0===i.headers[l]&&(i.headers[l]=o.headers[l]);i.body=o.body.call(a,t,i,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",a.table.options.ajaxContentType);t?(void 0===i.headers&&(i.headers={}),void 0===i.headers.Accept&&(i.headers.Accept="application/json"),void 0===i.headers["X-Requested-With"]&&(i.headers["X-Requested-With"]="XMLHttpRequest"),void 0===i.mode&&(i.mode="cors"),"cors"==i.mode?(void 0===i.headers.Origin&&(i.headers.Origin=window.location.origin),void 0===i.credentials&&(i.credentials="same-origin")):void 0===i.credentials&&(i.credentials="include"),fetch(t,i).then((function(e){e.ok?e.json().then((function(e){s(e)})).catch((function(e){r(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),r(e))})).catch((function(e){console.error("Ajax Load Error - Connection Error: ",e),r(e)}))):(console.warn("Ajax Load Error - No URL Set"),s([]))}))},ne.contentTypeFormatters=ie;var oe=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).mode=!0,i.pasteParser=function(){},i.pasteAction=function(){},i.customSelection=!1,i.rowRange=!1,i.blocked=!0,i.registerTableOption("clipboard",!1),i.registerTableOption("clipboardCopyStyled",!0),i.registerTableOption("clipboardCopyConfig",!1),i.registerTableOption("clipboardCopyFormatter",!1),i.registerTableOption("clipboardCopyRowRange","active"),i.registerTableOption("clipboardPasteParser","table"),i.registerTableOption("clipboardPasteAction","insert"),i.registerColumnOption("clipboard"),i.registerColumnOption("titleClipboard"),i}return n(s,[{key:"initialize",value:function(){var e=this;this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(function(t){var i,n,o;e.blocked||(t.preventDefault(),e.customSelection?(i=e.customSelection,e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i))):(o=e.table.modules.export.generateExportList(e.table.options.clipboardCopyConfig,e.table.options.clipboardCopyStyled,e.rowRange,"clipboard"),i=(n=e.table.modules.export.generateHTMLTable(o))?e.generatePlainContent(o):"",e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i),n=e.table.options.clipboardCopyFormatter("html",n))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",i):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",i),n&&t.clipboardData.setData("text/html",n)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",i),n&&t.originalEvent.clipboardData.setData("text/html",n)),e.dispatchExternal("clipboardCopied",i,n),e.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(function(t){e.paste(t)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}},{key:"reset",value:function(){this.blocked=!0,this.customSelection=!1}},{key:"generatePlainContent",value:function(t){var i=[];return t.forEach((function(t){var n=[];t.columns.forEach((function(i){var o="";if(i)if("group"===t.type&&(i.value=i.component.getKey()),null===i.value)o="";else switch(e(i.value)){case"object":o=JSON.stringify(i.value);break;case"undefined":o="";break;default:o=i.value}n.push(o)})),i.push(n.join("\t"))})),i.join("\n")}},{key:"copy",value:function(e,t){var i,n;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((n=document.body.createTextRange()).moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}},{key:"setPasteAction",value:function(t){switch(e(t)){case"string":this.pasteAction=s.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}},{key:"setPasteParser",value:function(t){switch(e(t)){case"string":this.pasteParser=s.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}},{key:"paste",value:function(e){var t,i,n;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,n)):this.dispatchExternal("clipboardPasteError",t))}},{key:"mutateData",value:function(e){var t=this,i=[];return Array.isArray(e)?e.forEach((function(e){i.push(t.table.modules.mutator.transformRow(e,"clipboard"))})):i=e,i}},{key:"checkPaseOrigin",value:function(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}},{key:"getPasteData",value:function(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}]),s}(N);oe.moduleName="clipboard",oe.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},oe.pasteParsers={table:function(e){var t=[],i=!0,n=this.table.columnManager.columns,o=[],a=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=n.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=n.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),a.push(t)})),a)}};var ae=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return n(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getTable",value:function(){return this._row.table}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"_getSelf",value:function(){return this._row}}]),e}(),se={avg:function(e,t,i){var n=0,o=void 0!==i.precision?i.precision:2;return e.length&&(n=e.reduce((function(e,t){return Number(e)+Number(t)})),n/=e.length,n=!1!==o?n.toFixed(o):n),parseFloat(n).toString()},max:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>n||null===n)&&(n=e)})),null!==n?!1!==o?n.toFixed(o):n:""},min:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))"),i.dataTreeExpandElement?"string"==typeof i.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=i.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=i.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),e(i.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return i.dataTreeStartExpanded[t]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}},{key:"tableRedrawing",value:function(e){var t=this;e&&this.table.rowManager.getRows().forEach((function(e){t.reinitializeRowChildren(e)}))}},{key:"initializeElementField",value:function(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}},{key:"getRowChildren",value:function(e){return this.getTreeChildren(e,!0)}},{key:"columnMoving",value:function(){var e=this,t=[];return this.table.rowManager.rows.forEach((function(i){t=t.concat(e.getTreeChildren(i,!1,!0))})),t}},{key:"rowDataChanged",value:function(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}},{key:"cellValueChanged",value:function(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}},{key:"initializeRow",value:function(t){var i=t.getData()[this.field],n=Array.isArray(i),o=n||!n&&"object"===e(i)&&null!==i;!o&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!o&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!o&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:o}}},{key:"reinitializeRowChildren",value:function(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}},{key:"layoutRow",value:function(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}},{key:"generateControlElement",value:function(e,t){var i=this,n=e.modules.dataTree,o=n.controlEl;t=t||e.getCells()[0].getElement(),!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.collapseRow(e)}))):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.expandRow(e)}))),n.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),o&&o.parentNode===t?o.parentNode.replaceChild(n.controlEl,o):t.insertBefore(n.controlEl,t.firstChild))}},{key:"getRows",value:function(e){var t=this,i=[];return e.forEach((function(e,n){var o;i.push(e),e instanceof L&&(e.create(),(o=e.modules.dataTree.children).index||!1===o.children||t.getChildren(e).forEach((function(e){e.create(),i.push(e)})))})),i}},{key:"getChildren",value:function(e,t){var i=this,n=e.modules.dataTree,o=[],a=[];return!1!==n.children&&(n.open||t)&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),o=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(o),o.forEach((function(e){a.push(e),i.getChildren(e).forEach((function(e){a.push(e)}))}))),a}},{key:"generateChildren",value:function(e){var t=this,i=[],n=e.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach((function(n){var o=new L(n||{},t.table.rowManager);o.create(),o.modules.dataTree.index=e.modules.dataTree.index+1,o.modules.dataTree.parent=e,o.modules.dataTree.children&&(o.modules.dataTree.open=t.startOpen(o.getComponent(),o.modules.dataTree.index)),i.push(o)})),i}},{key:"expandRow",value:function(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}},{key:"collapseRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}},{key:"toggleRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}},{key:"isRowExpanded",value:function(e){return e.modules.dataTree.open}},{key:"getTreeParent",value:function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}},{key:"getTreeParentRoot",value:function(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}},{key:"getFilteredTreeChildren",value:function(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((function(e){e instanceof L&&i.push(e)}))),i}},{key:"rowDelete",value:function(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}},{key:"addTreeChildRow",value:function(e,t,i,n){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==n&&!1!==(o=this.findChildIndex(n,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}},{key:"findChildIndex",value:function(t,i){var n=this,o=!1;return"object"==e(t)?t instanceof L?o=t.data:t instanceof M?o=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?i.modules.dataTree&&(o=i.modules.dataTree.children.find((function(e){return e instanceof L&&e.element===t})))&&(o=o.data):null===t&&(o=!1):o=void 0!==t&&i.data[this.field].find((function(e){return e.data[n.table.options.index]==t})),o&&(Array.isArray(i.data[this.field])&&(o=i.data[this.field].indexOf(o)),-1==o&&(o=!1)),o}},{key:"getTreeChildren",value:function(e,t,i){var n=this,o=e.modules.dataTree,a=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),o.children.forEach((function(e){e instanceof L&&(a.push(t?e.getComponent():e),i&&(a=a.concat(n.getTreeChildren(e,t,i))))}))),a}},{key:"getChildField",value:function(){return this.field}},{key:"redrawNeeded",value:function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}]),s}(N);le.moduleName="dataTree";var ue={csv:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=i.delimiter?i.delimiter:",",a=[],s=[];t.forEach((function(t){var i=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((function(e,t){e&&1===e.depth&&(s[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":t.columns.forEach((function(t){if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}i.push('"'+String(t.value).split('"').join('""')+'"')}})),a.push(i.join(o))}})),s.length&&a.unshift(s.join(o)),a=a.join("\n"),i.bom&&(a="\ufeff"+a),n(a,"text/csv")},json:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(t)}})),i(n=JSON.stringify(n,null,"\t"),"application/json")},jsonLines:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(JSON.stringify(t))}})),i(n.join("\n"),"application/x-ndjson")},pdf:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=[],a=[],s={},r=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=i.jsPDF||{},c=i.title?i.title:"";function h(t,i){var n=[];return t.columns.forEach((function(t){var o;if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}o={content:t.value,colSpan:t.width,rowSpan:t.height},i&&(o.styles=i),n.push(o)}})),n}u.orientation||(u.orientation=i.orientation||"landscape"),u.unit||(u.unit="pt"),t.forEach((function(e){switch(e.type){case"header":o.push(h(e));break;case"group":a.push(h(e,r));break;case"calc":a.push(h(e,l));break;case"row":a.push(h(e))}}));var d=new jspdf.jsPDF(u);i.autoTable&&(s="function"==typeof i.autoTable?i.autoTable(d)||{}:i.autoTable),c&&(s.didDrawPage=function(e){d.text(c,40,30)}),s.head=o,s.body=a,d.autoTable(s),i.documentProcessing&&i.documentProcessing(d),n(d.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,n){var o=i.sheetName||"Sheet1",a=XLSX.utils.book_new(),s=new f(this);function r(){var i=[],n=[],o={},a={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:t.length}};return t.forEach((function(t,o){var a=[];t.columns.forEach((function(t,i){t?(a.push(t.value instanceof Date||"object"!==e(t.value)?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&n.push({s:{r:o,c:i},e:{r:o+t.height-1,c:i+t.width-1}})):a.push("")})),i.push(a)})),XLSX.utils.sheet_add_aoa(o,i),o["!ref"]=XLSX.utils.encode_range(a),n.length&&(o["!merges"]=n),o}if(a.SheetNames=[],a.Sheets={},i.sheetOnly)n(r());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=r()):(a.SheetNames.push(l),s.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(o),a.Sheets[o]=r();i.documentProcessing&&(a=i.documentProcessing(a)),n(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n!=e.length;++n)i[n]=255&e.charCodeAt(n);return t}(XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}},ce=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),n.registerTableOption("downloadReady",void 0),n.registerTableOption("downloadConfig",{}),n.registerTableOption("downloadRowRange","active"),n.registerColumnOption("download"),n.registerColumnOption("titleDownload"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheck("downloadReady","downloadEncoder")}},{key:"downloadToTab",value:function(e,t,i,n){this.download(e,t,i,n,!0)}},{key:"download",value:function(e,t,i,n,o){var s=!1;if("function"==typeof e?s=e:a.downloaders[e]?s=a.downloaders[e]:console.warn("Download Error - No such download type found: ",e),s){var r=this.generateExportList(n);s.call(this.table,r,i||{},function(i,n){o?!0===o?this.triggerDownload(i,n,e,t,!0):o(i):this.triggerDownload(i,n,e,t)}.bind(this))}}},{key:"generateExportList",value:function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}},{key:"triggerDownload",value:function(e,t,i,n,o){var a=document.createElement("a"),s=this.table.options.downloadEncoder(e,t);s&&(o?window.open(window.URL.createObjectURL(s)):(n=n||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(s,n):(a.setAttribute("href",window.URL.createObjectURL(s)),a.setAttribute("download",n),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a))),this.dispatchExternal("downloadComplete"))}},{key:"commsReceived",value:function(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}]),a}(N);function he(e,t){var i=t.mask,n=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",a=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function s(t){var r=i[t];void 0!==r&&r!==a&&r!==n&&r!==o&&(e.value=e.value+""+r,s(t+1))}e.addEventListener("keydown",(function(t){var s=e.value.length,r=t.key;if(t.keyCode>46){if(s>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[s]){case n:if(r.toUpperCase()==r.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(r))return t.preventDefault(),t.stopPropagation(),!1;break;case a:break;default:if(r!==i[s])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(function(i){i.keyCode>46&&t.maskAutoFill&&s(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&s(e.value.length)}ce.moduleName="download",ce.downloaders=ue;var de=function(){function i(e,n,o,a,s,r){t(this,i),this.edit=e,this.table=e.table,this.cell=n,this.params=this._initializeParams(r),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!n._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.blurable=!0,this.actions={success:a,cancel:s},this._deprecatedOptionsCheck(),this._initializeValue(),o(this._onRendered.bind(this))}return n(i,[{key:"_deprecatedOptionsCheck",value:function(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}},{key:"_initializeValue",value:function(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}},{key:"_onRendered",value:function(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((function(){e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}},{key:"_createListElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}},{key:"_setListWidth",value:function(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}},{key:"_createInputElement",value:function(){var t=this.params.elementAttributes,i=document.createElement("input");if(i.setAttribute("type",this.params.clearable?"search":"text"),i.style.padding="4px",i.style.width="100%",i.style.boxSizing="border-box",this.params.autocomplete||(i.style.cursor="default",i.style.caretColor="transparent"),t&&"object"==e(t))for(var n in t)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,i.getAttribute(n)+t["+"+n])):i.setAttribute(n,t[n]);return this.params.mask&&he(i,this.params),this._bindInputEvents(i),i}},{key:"_initializeParams",value:function(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((function(e){return i.includes(e)})).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}},{key:"_bindInputEvents",value:function(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}},{key:"_inputFocus",value:function(e){this.rebuildOptionsList()}},{key:"_filter",value:function(){var e=this;this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((function(){e.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}},{key:"_inputClick",value:function(e){e.stopPropagation()}},{key:"_inputBlur",value:function(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}},{key:"_inputSearch",value:function(){this._clearChoices()}},{key:"_inputKeyDown",value:function(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}},{key:"_inputKeyUp",value:function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}},{key:"_preventPopupBlur",value:function(){var e=this;this.popup&&this.popup.blockHide(),setTimeout((function(){e.popup&&e.popup.restoreHide()}),10)}},{key:"_preventBlur",value:function(){var e=this;this.blurable=!1,setTimeout((function(){e.blurable=!0}),10)}},{key:"_keyUp",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}},{key:"_keyDown",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}},{key:"_keyAutoCompLetter",value:function(e){this._filter(),this.lastAction="typing",this.typing=!0}},{key:"_scrollToValue",value:function(e){var t=this;clearTimeout(this.filterTimeout);var i=String.fromCharCode(e).toLowerCase();this.filterTerm+=i.toLowerCase();var n=this.displayItems.find((function(e){return void 0!==e.label&&e.label.toLowerCase().startsWith(t.filterTerm)}));n&&this._focusItem(n),this.filterTimeout=setTimeout((function(){t.filterTerm=""}),800)}},{key:"_focusItem",value:function(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}},{key:"headerFilterInitialListGen",value:function(){this._generateOptions(!0)}},{key:"rebuildOptionsList",value:function(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((function(e){Number.isInteger(e)||console.error("List generation error",e)}))}},{key:"_filterList",value:function(){this._buildList(this._filterOptions()),this._showList()}},{key:"_generateOptions",value:function(e){var t=this,i=[],n=++this.listIteration;return this.filtered=!1,this.params.values?i=this.params.values:this.params.valuesURL?i=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?i=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(i=this._uniqueColumnValues(this.params.valuesLookupField)),i instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),i.then().then((function(e){return t.listIteration===n?t._parseList(e):Promise.reject(n)}))):Promise.resolve(this._parseList(i))}},{key:"_addPlaceholder",value:function(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}},{key:"_ajaxRequest",value:function(e,t){return e=ee(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((function(e){return e.ok?e.json().catch((function(e){return console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)})):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e))})).catch((function(e){return console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e)}))}},{key:"_uniqueColumnValues",value:function(e){var t,i={},n=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?n.forEach((function(e){var n=t.getFieldValue(e);null!=n&&""!==n&&(i[n]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}},{key:"_parseList",value:function(t){var i=this,n=[];return Array.isArray(t)||(t=Object.entries(t).map((function(e){var t=c(e,2),i=t[0];return{label:t[1],value:i}}))),t.forEach((function(t){"object"!==e(t)&&(t={label:t,value:t}),i._parseListItem(t,n,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=n,n}},{key:"_parseListItem",value:function(e,t,i){var n={};e.options?n=this._parseListGroup(e,i+1):(n={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(n,!0)),t.push(n)}},{key:"_parseListGroup",value:function(e,t){var i=this,n={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((function(e){i._parseListItem(e,n.options,t)})),n}},{key:"_sortOptions",value:function(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}},{key:"_sortGroup",value:function(e,t){var i=this;t.sort((function(t,i){return e(t.label,i.label,t.value,i.value,t.original,i.original)})),t.forEach((function(t){t.group&&i._sortGroup(e,t.options)}))}},{key:"_defaultSortFunction",value:function(e,t){var i,n,o,a,s,r=0,l=/(\d+)|(\D+)/g,u=/\d/,c=0;if("desc"===this.params.sort){var h=[t,e];e=h[0],t=h[1]}if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(n=String(t).toLowerCase()))return 0;if(!u.test(i)||!u.test(n))return i>n?1:-1;for(i=i.match(l),n=n.match(l),s=i.length>n.length?n.length:i.length;ra?1:-1;return i.length>n.length}c=1}else c=t||0===t?-1:0;return c}},{key:"_filterOptions",value:function(){var e=this,t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;return i?(this.filtered=!0,this.data.forEach((function(n){e._filterItem(t,i,n)}))):this.filtered=!1,this.data}},{key:"_filterItem",value:function(e,t,i){var n=this,o=!1;return i.group?(i.options.forEach((function(i){n._filterItem(e,t,i)&&(o=!0)})),i.visible=o):i.visible=e(t,i.label,i.value,i.original),i.visible}},{key:"_defaultFilterFunc",value:function(e,t,i,n){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}},{key:"_clearList",value:function(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}},{key:"_buildList",value:function(e){var t=this;this._clearList(),e.forEach((function(e){t._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}},{key:"_buildItem",value:function(t){var i,n=this,o=t.element;if(!this.filtered||t.visible){if(!o){if((o=document.createElement("div")).tabIndex=0,(i=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,o):t.label)instanceof HTMLElement?o.appendChild(i):o.innerHTML=i,t.group?o.classList.add("tabulator-edit-list-group"):o.classList.add("tabulator-edit-list-item"),o.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==e(t.elementAttributes))for(var a in t.elementAttributes)"+"==a.charAt(0)?(a=a.slice(1),o.setAttribute(a,this.input.getAttribute(a)+t.elementAttributes["+"+a])):o.setAttribute(a,t.elementAttributes[a]);t.group?o.addEventListener("click",this._groupClick.bind(this,t)):o.addEventListener("click",this._itemClick.bind(this,t)),o.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=o}this._styleItem(t),this.listEl.appendChild(o),t.group?t.options.forEach((function(e){n._buildItem(e)})):this.displayItems.push(t)}}},{key:"_showList",value:function(){var e=this,t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),t||setTimeout((function(){e.popup.hideOnBlur(e._resolveValue.bind(e,!0))}),10)}}},{key:"_styleItem",value:function(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}},{key:"_itemClick",value:function(e,t){t.stopPropagation(),this._chooseItem(e)}},{key:"_groupClick",value:function(e,t){t.stopPropagation()}},{key:"_cancel",value:function(){this.popup.hide(!0),this.actions.cancel()}},{key:"_clearChoices",value:function(){var e=this;this.typing=!0,this.currentItems.forEach((function(t){t.selected=!1,e._styleItem(t)})),this.currentItems=[],this.focusedItem=null}},{key:"_chooseItem",value:function(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((function(e){return e.label})).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}},{key:"_resolveValue",value:function(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((function(e){return e.value}));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}}]),i}();var me={input:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input");if(r.setAttribute("type",a.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+a.elementAttributes["+"+l])):r.setAttribute(l,a.elementAttributes[l]);function u(e){null==s&&""!==r.value||r.value!==s?n(r.value)&&(s=r.value):o()}return r.value=void 0!==s?s:"",i((function(){r.focus({preventScroll:!0}),r.style.height="100%",a.selectContents&&r.select()})),r.addEventListener("change",u),r.addEventListener("blur",u),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(r,a),r},textarea:function(t,i,n,o,a){var s=t.getValue(),r=a.verticalNavigation||"hybrid",l=String(null!=s?s:""),u=document.createElement("textarea"),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){null==s&&""!==u.value||u.value!==s?(n(u.value)&&(s=u.value),setTimeout((function(){t.getRow().normalizeHeight()}),300)):o()}return u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",u.scrollHeight,u.style.height=u.scrollHeight+"px",t.getRow().normalizeHeight(),a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keyup",(function(){u.style.height="";var e=u.scrollHeight;u.style.height=e+"px",e!=c&&(c=e,t.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&a.shiftEnterSubmit&&d();break;case 27:o();break;case 38:("editor"==r||"hybrid"==r&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(u,a),u},number:function(t,i,n,o,a){var s=t.getValue(),r=a.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==a.max&&l.setAttribute("max",a.max),void 0!==a.min&&l.setAttribute("min",a.min),void 0!==a.step&&l.setAttribute("step",a.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var u in a.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),l.setAttribute(u,l.getAttribute(u)+a.elementAttributes["+"+u])):l.setAttribute(u,a.elementAttributes[u]);l.value=s;var c=function(e){h()};function h(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==s?n(e)&&(s=e):o()}return i((function(){l.removeEventListener("blur",c),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",c),a.selectContents&&l.select()})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:o();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(l,a),l},range:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==a.max&&r.setAttribute("max",a.max),void 0!==a.min&&r.setAttribute("min",a.min),void 0!==a.step&&r.setAttribute("step",a.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+a.elementAttributes["+"+l])):r.setAttribute(l,a.elementAttributes[l]);function u(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=s?n(e)&&(s=e):o()}return r.value=s,i((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){u()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o()}})),r},date:function(t,i,n,o,a){var s=a.format,r=s?window.DateTime||luxon.DateTime:null,l=t.getValue(),u=document.createElement("input");function c(e){return(r.isDateTime(e)?e:"iso"===s?r.fromISO(String(e)):r.fromFormat(String(e),s)).toFormat("yyyy-MM-dd")}if(u.type="date",u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",a.max&&u.setAttribute("max",s?c(a.max):a.max),a.min&&u.setAttribute("min",s?c(a.min):a.min),a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){var t=u.value;null==l&&""!==t||t!==l?(t&&s&&(t=r.fromFormat(String(t),"yyyy-MM-dd").toFormat(s)),n(t)&&(l=u.value)):o()}return l=void 0!==l?l:"",s&&(r?l=c(l):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),u},time:function(t,i,n,o,a){var s,r=a.format,l=r?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="time",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),c.setAttribute(h,c.getAttribute(h)+a.elementAttributes["+"+h])):c.setAttribute(h,a.elementAttributes[h]);function d(e){var t=c.value;null==u&&""!==t||t!==u?(t&&r&&(t=l.fromFormat(String(t),"hh:mm").toFormat(r)),n(t)&&(u=c.value)):o()}return u=void 0!==u?u:"",r&&(l?(s=l.isDateTime(u)?u:"iso"===r?l.fromISO(String(u)):l.fromFormat(String(u),r),u=s.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),c.value=u,i((function(){c.focus({preventScroll:!0}),c.style.height="100%",a.selectContents&&c.select()})),c.addEventListener("change",d),c.addEventListener("blur",d),c.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),c},datetime:function(t,i,n,o,a){var s,r=a.format,l=r?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),c.setAttribute(h,c.getAttribute(h)+a.elementAttributes["+"+h])):c.setAttribute(h,a.elementAttributes[h]);function d(e){var t=c.value;null==u&&""!==t||t!==u?(t&&r&&(t=l.fromISO(String(t)).toFormat(r)),n(t)&&(u=c.value)):o()}return u=void 0!==u?u:"",r&&(l?(s=l.isDateTime(u)?u:"iso"===r?l.fromISO(String(u)):l.fromFormat(String(u),r),u=s.toFormat("yyyy-MM-dd")+"T"+s.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),c.value=u,i((function(){c.focus({preventScroll:!0}),c.style.height="100%",a.selectContents&&c.select()})),c.addEventListener("change",d),c.addEventListener("blur",d),c.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),c},select:function(e,t,i,n,o){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new de(this,e,t,i,n,o).input},list:function(e,t,i,n,o){return new de(this,e,t,i,n,o).input},autocomplete:function(e,t,i,n,o){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new de(this,e,t,i,n,o).input},star:function(t,i,n,o,a){var s=this,r=t.getElement(),l=t.getValue(),u=r.getElementsByTagName("svg").length||5,c=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],d=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){h.forEach((function(t,i){i'):("ie"==s.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),n(e),r.blur()})),t.appendChild(i),d.appendChild(t)}function g(e){l=e,p(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",m.setAttribute("width",c),m.setAttribute("height",c),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",a.elementAttributes&&"object"==e(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),d.setAttribute(v,d.getAttribute(v)+a.elementAttributes["+"+v])):d.setAttribute(v,a.elementAttributes[v]);for(var b=1;b<=u;b++)f(b);return p(l=Math.min(parseInt(l),u)),d.addEventListener("mousemove",(function(e){p(0)})),d.addEventListener("click",(function(e){n(0)})),r.addEventListener("blur",(function(e){o()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(l+1);break;case 37:g(l-1);break;case 13:n(l);break;case 27:o()}})),d},progress:function(t,i,n,o,a){var s,r,l=t.getElement(),u=void 0===a.max?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("max")||100:a.max,c=void 0===a.min?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("min")||0:a.min,h=(u-c)/100,d=t.getValue()||0,m=document.createElement("div"),p=document.createElement("div");function f(){var e=window.getComputedStyle(l,null),t=h*Math.round(p.offsetWidth/((l.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+c;n(t),l.setAttribute("aria-valuenow",t),l.setAttribute("aria-label",d)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",a.elementAttributes&&"object"==e(a.elementAttributes))for(var g in a.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),p.setAttribute(g,p.getAttribute(g)+a.elementAttributes["+"+g])):p.setAttribute(g,a.elementAttributes[g]);return l.style.padding="4px 4px",d=Math.min(parseFloat(d),u),d=Math.max(parseFloat(d),c),d=Math.round((d-c)/h),p.style.width=d+"%",l.setAttribute("aria-valuemin",c),l.setAttribute("aria-valuemax",u),p.appendChild(m),m.addEventListener("mousedown",(function(e){s=e.screenX,r=p.offsetWidth})),m.addEventListener("mouseover",(function(){m.style.cursor="ew-resize"})),l.addEventListener("mousemove",(function(e){s&&(p.style.width=r+e.screenX-s+"px")})),l.addEventListener("mouseup",(function(e){s&&(e.stopPropagation(),e.stopImmediatePropagation(),s=!1,r=!1,f())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:o()}})),l.addEventListener("blur",(function(){o()})),p},tickCross:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input"),l=a.tristate,u=void 0===a.indeterminateValue?null:a.indeterminateValue,c=!1,h=Object.keys(a).includes("trueValue"),d=Object.keys(a).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var m in a.elementAttributes)"+"==m.charAt(0)?(m=m.slice(1),r.setAttribute(m,r.getAttribute(m)+a.elementAttributes["+"+m])):r.setAttribute(m,a.elementAttributes[m]);function p(e){var t=r.checked;return h&&t?t=a.trueValue:d&&!t&&(t=a.falseValue),l?e?c?u:t:r.checked&&!c?(r.checked=!1,r.indeterminate=!0,c=!0,u):(c=!1,t):t}return r.value=s,!l||void 0!==s&&s!==u&&""!==s||(c=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&i((function(){r.focus({preventScroll:!0})})),r.checked=h?s===a.trueValue:!0===s||"true"===s||"True"===s||1===s,i((function(){r.focus()})),r.addEventListener("change",(function(e){n(p())})),r.addEventListener("blur",(function(e){n(p(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&n(p()),27==e.keyCode&&o()})),r}},pe=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).currentCell=!1,i.mouseClick=!1,i.recursionBlock=!1,i.invalidEdit=!1,i.editedCells=[],i.editors=s.editors,i.registerColumnOption("editable"),i.registerColumnOption("editor"),i.registerColumnOption("editorParams"),i.registerColumnOption("cellEditing"),i.registerColumnOption("cellEdited"),i.registerColumnOption("cellEditCancelled"),i.registerTableFunction("getEditedCells",i.getEditedCells.bind(r(i))),i.registerTableFunction("clearCellEdited",i.clearCellEdited.bind(r(i))),i.registerTableFunction("navigatePrev",i.navigatePrev.bind(r(i))),i.registerTableFunction("navigateNext",i.navigateNext.bind(r(i))),i.registerTableFunction("navigateLeft",i.navigateLeft.bind(r(i))),i.registerTableFunction("navigateRight",i.navigateRight.bind(r(i))),i.registerTableFunction("navigateUp",i.navigateUp.bind(r(i))),i.registerTableFunction("navigateDown",i.navigateDown.bind(r(i))),i.registerComponentFunction("cell","isEdited",i.cellIsEdited.bind(r(i))),i.registerComponentFunction("cell","clearEdited",i.clearEdited.bind(r(i))),i.registerComponentFunction("cell","edit",i.editCell.bind(r(i))),i.registerComponentFunction("cell","cancelEdit",i.cellCancelEdit.bind(r(i))),i.registerComponentFunction("cell","navigatePrev",i.navigatePrev.bind(r(i))),i.registerComponentFunction("cell","navigateNext",i.navigateNext.bind(r(i))),i.registerComponentFunction("cell","navigateLeft",i.navigateLeft.bind(r(i))),i.registerComponentFunction("cell","navigateRight",i.navigateRight.bind(r(i))),i.registerComponentFunction("cell","navigateUp",i.navigateUp.bind(r(i))),i.registerComponentFunction("cell","navigateDown",i.navigateDown.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}},{key:"keybindingNavigateNext",value:function(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((function(){setTimeout((function(){t.getComponent().navigateNext()}))}))))}},{key:"cellIsEdited",value:function(e){return!!e.modules.edit&&e.modules.edit.edited}},{key:"cellCancelEdit",value:function(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}},{key:"updateCellClass",value:function(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}},{key:"clearCellEdited",value:function(e){var t=this;e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.table.modules.edit.clearEdited(e._getSelf())}))}},{key:"navigatePrev",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateLeft())return!0;if((t=this.table.rowManager.prevDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,t.cells.length)))return e.getComponent().edit(),!0}return!1}},{key:"navigateNext",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateRight())return!0;if((t=this.table.rowManager.nextDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,-1)))return e.getComponent().edit(),!0}return!1}},{key:"navigateLeft",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findPrevEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateRight",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findNextEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateUp",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.prevDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"navigateDown",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.nextDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"findNextEditableCell",value:function(e,t){var i=!1;if(t0)for(var n=t-1;n>=0;n--){var o=e.cells[n];if(o.column.modules.edit&&C.elVisible(o.getElement()))if(this.allowEdit(o)){i=o;break}}return i}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.editor&&this.initializeColumn(e)}},{key:"columnDeleteCheck",value:function(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}},{key:"rowDeleteCheck",value:function(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}},{key:"initializeColumn",value:function(t){var i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(e(t.definition.editor)){case"string":this.editors[t.definition.editor]?i.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":i.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?i.editor=this.editors[t.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}i.editor&&(t.modules.edit=i)}},{key:"getCurrentCell",value:function(){return!!this.currentCell&&this.currentCell.getComponent()}},{key:"clearEditor",value:function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}},{key:"cancelEdit",value:function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}},{key:"bindEditor",value:function(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}},{key:"focusCellNoEvent",value:function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}},{key:"editCell",value:function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}},{key:"focusScrollAdjust",value:function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,a=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,s=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),a-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),a-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),s.offsetLefta&&(this.table.rowManager.element.scrollLeft+=s.offsetLeft+s.offsetWidth-a)}}},{key:"allowEdit",value:function(t){var i=!!t.column.modules.edit;if(t.column.modules.edit)switch(e(t.column.modules.edit.check)){case"function":i=t.column.modules.edit.check(t.getComponent());break;case"string":i=!!t.row.data[t.column.modules.edit.check];break;case"boolean":i=t.column.modules.edit.check}return i}},{key:"edit",value:function(e,t,i){var n,o,a,s=this,r=function(){},l=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(s.cancelEdit(),s.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),a="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(n=e.column.modules.edit.editor.call(s,o,(function(e){r=e}),(function(t){if(s.currentCell===e){var i=s.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===s.table.options.validationMode?(s.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==s.editedCells.indexOf(e)&&s.editedCells.push(e),e.setValue(t,!0),!0===i):(s.invalidEdit=!0,s.focusCellNoEvent(e,!0),r(),!1)}}),(function(){s.currentCell===e&&s.cancelEdit()}),a)))return l.blur(),!1;if(!(n instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",n),l.blur(),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(n),r();for(var u=l.children,c=0;c-1&&this.editedCells.splice(t,1)}}]),s}(N);pe.moduleName="edit",pe.editors=me;var fe=function e(i,n,o,a){t(this,e),this.type=i,this.columns=n,this.component=o||!1,this.indent=a||0},ge=function e(i,n,o,a,s){t(this,e),this.value=i,this.component=n||!1,this.width=o,this.height=a,this.depth=s},ve=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).config={},i.cloneTableStyle=!0,i.colVisProp="",i.registerTableOption("htmlOutputConfig",!1),i.registerColumnOption("htmlOutput"),i.registerColumnOption("titleHtmlOutput"),i}return n(s,[{key:"initialize",value:function(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}},{key:"generateExportList",value:function(e,t,i,n){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=n;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],a=this.bodyToExportRows(this.rowLookup(i));return o.concat(a)}},{key:"generateTable",value:function(e,t,i,n){var o=this.generateExportList(e,t,i,n);return this.generateTableElement(o)}},{key:"rowLookup",value:function(e){var t=this,i=[];if("function"==typeof e)e.call(this.table).forEach((function(e){(e=t.table.rowManager.findRow(e))&&i.push(e)}));else switch(e){case!0:case"visible":i=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":i=this.table.rowManager.rows;break;case"selected":i=this.table.modules.selectRow.selectedRows;break;case"active":default:i=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],i)}},{key:"generateColumnGroupHeaders",value:function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((function(i){var n=e.processColumnGroup(i);n&&t.push(n)})),t}},{key:"processColumnGroup",value:function(e){var t=this,i=e.columns,n=0,o={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(i.length){if(o.subGroups=[],o.width=0,i.forEach((function(e){var i=t.processColumnGroup(e);i&&(o.width+=i.width,o.subGroups.push(i),i.depth>n&&(n=i.depth))})),o.depth+=n,!o.width)return!1}else{if(!this.columnVisCheck(e))return!1;o.width=1}return o}},{key:"columnVisCheck",value:function(e){var t=e.definition[this.colVisProp];return"function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1!==t&&(e.visible||!e.visible&&t)}},{key:"headersToExportRows",value:function(e){var t=[],i=0,n=[];function o(e,n){var a=i-n;if(void 0===t[n]&&(t[n]=[]),e.height=e.subGroups?1:a-e.depth+1,t[n].push(e),e.height>1)for(var s=1;s1)for(var r=1;ri&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){if(e){var i=void 0===e.title?"":e.title;t.push(new ge(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),n.push(new fe("header",t))})),n}},{key:"bodyToExportRows",value:function(e){var t=this,i=[],n=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&i.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach((function(e,o){var a=e.getData(t.colVisProp),s=[],r=0;switch(e.type){case"group":r=e.level,s.push(new ge(e.key,e.getComponent(),i.length,1));break;case"calc":case"row":i.forEach((function(e){s.push(new ge(e._column.getFieldValue(a),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(r=e.modules.dataTree.index)}n.push(new fe(e.type,s,e.getComponent(),r))})),n}},{key:"generateTableElement",value:function(e){var t=this,i=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody"),a=this.lookupTableStyles(),s=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==s?s:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),i.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,i){var s;switch(e.type){case"header":n.appendChild(t.generateHeaderElement(e,r,a));break;case"group":o.appendChild(t.generateGroupElement(e,r,a));break;case"calc":o.appendChild(t.generateCalcElement(e,r,a));break;case"row":s=t.generateRowElement(e,r,a),t.mapElementStyles(i%2&&a.evenRow?a.evenRow:a.oddRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),o.appendChild(s)}})),n.innerHTML&&i.appendChild(n),i.appendChild(o),this.mapElementStyles(this.table.element,i,["border-top","border-left","border-right","border-bottom"]),i}},{key:"lookupTableStyles",value:function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}},{key:"generateHeaderElement",value:function(e,t,i){var n=this,o=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,n.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),n.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),n.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?n.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&n.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),o.appendChild(t)}})),o}},{key:"generateGroupElement",value:function(e,t,i){var n=document.createElement("tr"),o=document.createElement("td"),a=e.columns[0];return n.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?a.value=t.groupHeader[e.indent](a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(a.value=e.component._group.generator(a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=a.width,o.innerHTML=a.value,n.classList.add("tabulator-print-table-group"),n.classList.add("tabulator-group-level-"+e.indent),a.component.isVisible()&&n.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),n.appendChild(o),n}},{key:"generateCalcElement",value:function(e,t,i){var n=this.generateRowElement(e,t,i);return n.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n}},{key:"generateRowElement",value:function(t,i,n){var o=this,a=document.createElement("tr");return a.classList.add("tabulator-print-table-row"),t.columns.forEach((function(s,r){if(s){var l,u=document.createElement("td"),c=s.component._column,h=o.table.columnManager.findColumnIndex(c),d=s.value,m={modules:{},getValue:function(){return d},getField:function(){return c.definition.field},getElement:function(){return u},getColumn:function(){return c.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return m},column:c};if((c.definition.cssClass?c.definition.cssClass.split(" "):[]).forEach((function(e){u.classList.add(e)})),o.table.modExists("format")&&!1!==o.config.formatCells)d=o.table.modules.format.formatExportValue(m,o.colVisProp);else switch(e(d)){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?u.appendChild(d):u.innerHTML=d,(l=n.styleCells&&n.styleCells[h]?n.styleCells[h]:n.firstCell)&&(o.mapElementStyles(l,u,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),c.definition.align&&(u.style.textAlign=c.definition.align)),o.table.options.dataTree&&!1!==o.config.dataTree&&(i.treeElementField&&i.treeElementField==c.field||!i.treeElementField&&0==r)&&(t.component._row.modules.dataTree.controlEl&&u.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),u.firstChild),t.component._row.modules.dataTree.branchEl&&u.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),u.firstChild)),a.appendChild(u),m.modules.format&&m.modules.format.renderedCallback&&m.modules.format.renderedCallback(),i.rowFormatter&&!1!==o.config.formatCells&&i.rowFormatter(t.component)}})),a}},{key:"generateHTMLTable",value:function(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}},{key:"getHtml",value:function(e,t,i,n){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,n||"htmlOutput");return this.generateHTMLTable(o)}},{key:"mapElementStyles",value:function(e,t,i){if(this.cloneTableStyle&&e&&t){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[n[e]]=o.getPropertyValue(e)}))}}}}]),s}(N);ve.moduleName="export";var be={"=":function(e,t,i,n){return t==e},"<":function(e,t,i,n){return t":function(e,t,i,n){return t>e},">=":function(e,t,i,n){return t>=e},"!=":function(e,t,i,n){return t!=e},regex:function(e,t,i,n){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,n){var o=e.toLowerCase().split(void 0===n.separator?" ":n.separator),a=String(null==t?"":t).toLowerCase(),s=[];return o.forEach((function(e){a.includes(e)&&s.push(!0)})),n.matchAll?s.length===o.length:!!s.length},starts:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,n){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},ye=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).filterList=[],i.headerFilters={},i.headerFilterColumns=[],i.prevHeaderFilterChangeCheck="",i.prevHeaderFilterChangeCheck="{}",i.changed=!1,i.tableInitialized=!1,i.registerTableOption("filterMode","local"),i.registerTableOption("initialFilter",!1),i.registerTableOption("initialHeaderFilter",!1),i.registerTableOption("headerFilterLiveFilterDelay",300),i.registerColumnOption("headerFilter"),i.registerColumnOption("headerFilterPlaceholder"),i.registerColumnOption("headerFilterParams"),i.registerColumnOption("headerFilterEmptyCheck"),i.registerColumnOption("headerFilterFunc"),i.registerColumnOption("headerFilterFuncParams"),i.registerColumnOption("headerFilterLiveFilter"),i.registerTableFunction("searchRows",i.searchRows.bind(r(i))),i.registerTableFunction("searchData",i.searchData.bind(r(i))),i.registerTableFunction("setFilter",i.userSetFilter.bind(r(i))),i.registerTableFunction("refreshFilter",i.userRefreshFilter.bind(r(i))),i.registerTableFunction("addFilter",i.userAddFilter.bind(r(i))),i.registerTableFunction("getFilters",i.getFilters.bind(r(i))),i.registerTableFunction("setHeaderFilterFocus",i.userSetHeaderFilterFocus.bind(r(i))),i.registerTableFunction("getHeaderFilterValue",i.userGetHeaderFilterValue.bind(r(i))),i.registerTableFunction("setHeaderFilterValue",i.userSetHeaderFilterValue.bind(r(i))),i.registerTableFunction("getHeaderFilters",i.getHeaderFilters.bind(r(i))),i.registerTableFunction("removeFilter",i.userRemoveFilter.bind(r(i))),i.registerTableFunction("clearFilter",i.userClearFilter.bind(r(i))),i.registerTableFunction("clearHeaderFilter",i.userClearHeaderFilter.bind(r(i))),i.registerComponentFunction("column","headerFilterFocus",i.setHeaderFilterFocus.bind(r(i))),i.registerComponentFunction("column","reloadHeaderFilter",i.reloadHeaderFilter.bind(r(i))),i.registerComponentFunction("column","getHeaderFilterValue",i.getHeaderFilterValue.bind(r(i))),i.registerComponentFunction("column","setHeaderFilterValue",i.setHeaderFilterValue.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}},{key:"tableBuilt",value:function(){var e=this;this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((function(t){var i=e.table.columnManager.findColumn(t.field);if(!i)return console.warn("Column Filter Error - No matching column found:",t.field),!1;e.setHeaderFilterValue(i,t.value)})),this.tableInitialized=!0}},{key:"remoteFilterParams",value:function(e,t,i,n){return n.filter=this.getFilters(!0,!0),n}},{key:"userSetFilter",value:function(e,t,i,n){this.setFilter(e,t,i,n),this.refreshFilter()}},{key:"userRefreshFilter",value:function(){this.refreshFilter()}},{key:"userAddFilter",value:function(e,t,i,n){this.addFilter(e,t,i,n),this.refreshFilter()}},{key:"userSetHeaderFilterFocus",value:function(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}},{key:"userGetHeaderFilterValue",value:function(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},{key:"userSetHeaderFilterValue",value:function(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}},{key:"userRemoveFilter",value:function(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}},{key:"userClearFilter",value:function(e){this.clearFilter(e),this.refreshFilter()}},{key:"userClearHeaderFilter",value:function(){this.clearHeaderFilter(),this.refreshFilter()}},{key:"searchRows",value:function(e,t,i){return this.search("rows",e,t,i)}},{key:"searchData",value:function(e,t,i){return this.search("data",e,t,i)}},{key:"initializeColumnHeaderFilter",value:function(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}},{key:"initializeColumn",value:function(t,i){var n=this,o=t.getField();t.modules.filter={success:function(i){var a,r="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",l="",u="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==i){if(t.modules.filter.prevSuccess=i,t.modules.filter.emptyFunc(i))delete n.headerFilters[o];else{switch(t.modules.filter.value=i,e(t.definition.headerFilterFunc)){case"string":s.filters[t.definition.headerFilterFunc]?(l=t.definition.headerFilterFunc,a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,s.filters[t.definition.headerFilterFunc](i,o,e,n)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":l=a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,t.definition.headerFilterFunc(i,o,e,n)}}if(!a)switch(r){case"partial":a=function(e){var n=t.getFieldValue(e);return null!=n&&String(n).toLowerCase().indexOf(String(i).toLowerCase())>-1},l="like";break;default:a=function(e){return t.getFieldValue(e)==i},l="="}n.headerFilters[o]={value:i,func:a,type:l}}t.modules.filter.value=i,u=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==u&&(n.prevHeaderFilterChangeCheck=u,n.trackChanges(),n.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}},{key:"generateHeaderFilterElement",value:function(t,i,n){var o,a,s,r,l,u,c,h=this,d=this,m=t.modules.filter.success,p=t.getField();if(t.modules.filter.value=i,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(o=document.createElement("div")).classList.add("tabulator-header-filter"),e(t.definition.headerFilter)){case"string":d.table.modules.edit.editors[t.definition.headerFilter]?(a=d.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":a=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?a=t.modules.edit.editor:t.definition.formatter&&d.table.modules.edit.editors[t.definition.formatter]?(a=d.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):a=d.table.modules.edit.editors.input}if(a){if(r={getValue:function(){return void 0!==i?i:""},getField:function(){return t.definition.field},getElement:function(){return o},getColumn:function(){return t.getComponent()},getTable:function(){return h.table},getRow:function(){return{normalizeHeight:function(){}}}},c="function"==typeof(c=t.definition.headerFilterParams||{})?c.call(d.table,r):c,!(s=a.call(this.table.modules.edit,r,(function(){}),m,(function(){}),c)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(s instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",s);d.langBind("headerFilters|columns|"+t.definition.field,(function(e){s.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})),s.addEventListener("click",(function(e){e.stopPropagation(),s.focus()})),s.addEventListener("focus",(function(e){var t=h.table.columnManager.element.scrollLeft;t!==h.table.rowManager.element.scrollLeft+parseInt(h.table.columnManager.element.style.marginLeft)&&(h.table.rowManager.scrollHorizontal(t),h.table.columnManager.scrollHorizontal(t))})),l=!1,u=function(e){l&&clearTimeout(l),l=setTimeout((function(){m(s.value)}),d.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=s,t.modules.filter.attrType=s.hasAttribute("type")?s.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=s.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(s.addEventListener("keyup",u),s.addEventListener("search",u),"number"==t.modules.filter.attrType&&s.addEventListener("change",(function(e){m(s.value)})),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&s.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||s.addEventListener("mousedown",(function(e){e.stopPropagation()}))),o.appendChild(s),t.contentElement.appendChild(o),n||d.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}},{key:"hideHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}},{key:"showHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}},{key:"setHeaderFilterFocus",value:function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}},{key:"getHeaderFilterValue",value:function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}},{key:"setHeaderFilterValue",value:function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"reloadHeaderFilter",value:function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"refreshFilter",value:function(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}},{key:"trackChanges",value:function(){this.changed=!0,this.dispatch("filter-changed")}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"setFilter",value:function(e,t,i,n){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),this.addFilter(e)}},{key:"addFilter",value:function(e,t,i,n){var o=this,a=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),e.forEach((function(e){(e=o.findFilter(e))&&(o.filterList.push(e),a=!0)})),a&&this.trackChanges()}},{key:"findFilter",value:function(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:s.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return s.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return s.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}},{key:"findSubFilters",value:function(e){var t=this,i=[];return e.forEach((function(e){(e=t.findFilter(e))&&i.push(e)})),!!i.length&&i}},{key:"getFilters",value:function(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}},{key:"filtersToArray",value:function(e,t){var i=this,n=[];return e.forEach((function(e){var o;Array.isArray(e)?n.push(i.filtersToArray(e,t)):(o={field:e.field,type:e.type,value:e.value},t&&"function"==typeof o.type&&(o.type="function"),n.push(o))})),n}},{key:"getHeaderFilters",value:function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}},{key:"removeFilter",value:function(t,i,n){var o=this;Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(t){var i=-1;(i="object"==e(t.field)?o.filterList.findIndex((function(e){return t===e})):o.filterList.findIndex((function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value})))>-1?o.filterList.splice(i,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)})),this.trackChanges()}},{key:"clearFilter",value:function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}},{key:"clearHeaderFilter",value:function(){var e=this;this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.trackChanges()}},{key:"search",value:function(e,t,i,n){var o=this,a=[],s=[];return Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(e){(e=o.findFilter(e))&&s.push(e)})),this.table.rowManager.rows.forEach((function(t){var i=!0;s.forEach((function(e){o.filterRecurse(e,t.getData())||(i=!1)})),i&&a.push("data"===e?t.getData("data"):t.getComponent())})),a}},{key:"filter",value:function(e,t){var i=this,n=[],o=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((function(e){i.filterRow(e)&&n.push(e)})):n=e.slice(0),this.subscribedExternal("dataFiltered")&&(n.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),o)),n}},{key:"filterRow",value:function(e,t){var i=this,n=!0,o=e.getData();for(var a in this.filterList.forEach((function(e){i.filterRecurse(e,o)||(n=!1)})),this.headerFilters)this.headerFilters[a].func(o)||(n=!1);return n}},{key:"filterRecurse",value:function(e,t){var i=this,n=!1;return Array.isArray(e)?e.forEach((function(e){i.filterRecurse(e,t)&&(n=!0)})):n=e.func(t),n}}]),s}(N);ye.moduleName="filter",ye.filters=be;var we={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var n,o,a,s,r=parseFloat(e.getValue()),l="",u=t.decimal||".",c=t.thousand||",",h=t.negativeSign||"-",d=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(r<0&&(r=Math.abs(r),l=h),n=!1!==p?r.toFixed(p):r,o=(n=String(n).split("."))[0],a=n.length>1?u+n[1]:"",!1!==t.thousand)for(s=/(\d+)(\d{3})/;s.test(o);)o=o.replace(s,"$1"+c+"$2");return m?l+o+a+d:l+d+o+a},link:function(t,i,n){var o,a=t.getValue(),s=i.urlPrefix||"",r=i.download,l=a,u=document.createElement("a");if(i.labelField&&(o=t.getData(),l=function t(i,n){var o=n[i.shift()];return i.length&&"object"===e(o)?t(i,o):o}(i.labelField.split(this.table.options.nestedFieldSeparator),o)),i.label)switch(e(i.label)){case"string":l=i.label;break;case"function":l=i.label(t)}if(l){if(i.urlField&&(a=(o=t.getData())[i.urlField]),i.url)switch(e(i.url)){case"string":a=i.url;break;case"function":a=i.url(t)}return u.setAttribute("href",s+a),i.target&&u.setAttribute("target",i.target),i.download&&(r="function"==typeof r?r(t):!0===r?"":r,u.setAttribute("download",r)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),u}return" "},image:function(t,i,n){var o=document.createElement("img"),a=t.getValue();switch(i.urlPrefix&&(a=i.urlPrefix+t.getValue()),i.urlSuffix&&(a+=i.urlSuffix),o.setAttribute("src",a),e(i.height)){case"number":o.style.height=i.height+"px";break;case"string":o.style.height=i.height}switch(e(i.width)){case"number":o.style.width=i.width+"px";break;case"string":o.style.width=i.width}return o.addEventListener("load",(function(){t.getRow().normalizeHeight()})),o},tickCross:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t.allowEmpty,s=t.allowTruthy,r=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',u=void 0!==t.crossElement?t.crossElement:'';return r&&n===t.trueValue||!r&&(s&&n||!0===n||"true"===n||"True"===n||1===n||"1"===n)?(o.setAttribute("aria-checked",!0),l||""):!a||"null"!==n&&""!==n&&null!=n?(o.setAttribute("aria-checked",!1),u||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",s=t.outputFormat||"dd/MM/yyyy HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(n=o.isDateTime(l)?l:"iso"===a?o.fromISO(String(l)):o.fromFormat(String(l),a)).isValid?(t.timezone&&(n=n.setZone(t.timezone)),n.toFormat(s)):!0!==r&&l?"function"==typeof r?r(l):r:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",u=void 0!==t.humanize&&t.humanize,c=void 0!==t.date?t.date:o.now(),h=e.getValue();if(void 0!==o)return(n=o.isDateTime(h)?h:"iso"===a?o.fromISO(String(h)):o.fromFormat(String(h),a)).isValid?u?n.diff(c,l).toHuman()+(r?" "+r:""):parseInt(n.diff(c,l)[l])+(r?" "+r:""):!0===s?h:"function"==typeof s?s(h):s;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var n=e.getValue();return void 0===t[n]?(console.warn("Missing display value for "+n),n):t[n]},star:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t&&t.stars?t.stars:5,s=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",n=n&&!isNaN(n)?parseInt(n):0,n=Math.max(0,Math.min(n,a));for(var l=1;l<=a;l++){var u=r.cloneNode(!0);u.innerHTML=l<=n?'':'',s.appendChild(u)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",n),s},traffic:function(t,i,n){var o,a,s=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),l=i&&i.max?i.max:100,u=i&&i.min?i.min:0,c=i&&void 0!==i.color?i.color:["red","orange","green"],h="#666666";if(!isNaN(s)&&void 0!==t.getValue()){switch(r.classList.add("tabulator-traffic-light"),a=parseFloat(s)<=l?parseFloat(s):l,a=parseFloat(a)>=u?parseFloat(a):u,o=(l-u)/100,a=Math.round((a-u)/o),e(c)){case"string":h=c;break;case"function":h=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),h=c[m=Math.max(m,0)];break}}return r.style.backgroundColor=h,r}},progress:function(t){var i,n,o,a,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0,u=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),h=r.max?r.max:100,d=r.min?r.min:0,m=r.legendAlign?r.legendAlign:"center";switch(n=parseFloat(u)<=h?parseFloat(u):h,n=parseFloat(n)>=d?parseFloat(n):d,i=(h-d)/100,n=Math.round((n-d)/i),e(r.color)){case"string":o=r.color;break;case"function":o=r.color(u);break;case"object":if(Array.isArray(r.color)){var p=100/r.color.length,f=Math.floor(n/p);f=Math.min(f,r.color.length-1),f=Math.max(f,0),o=r.color[f];break}default:o="#2DC214"}switch(e(r.legend)){case"string":a=r.legend;break;case"function":a=r.legend(u);break;case"boolean":a=u;break;default:a=!1}switch(e(r.legendColor)){case"string":s=r.legendColor;break;case"function":s=r.legendColor(u);break;case"object":if(Array.isArray(r.legendColor)){var g=100/r.legendColor.length,v=Math.floor(n/g);v=Math.min(v,r.legendColor.length-1),v=Math.max(v,0),s=r.legendColor[v]}break;default:s="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",n);var y=document.createElement("div");y.style.display="inline-block",y.style.width=n+"%",y.style.backgroundColor=o,y.style.height="100%",y.setAttribute("data-max",h),y.setAttribute("data-min",d);var w=document.createElement("div");if(w.style.position="relative",w.style.width="100%",w.style.height="100%",a){var C=document.createElement("div");C.style.position="absolute",C.style.top=0,C.style.left=0,C.style.textAlign=m,C.style.width="100%",C.style.color=s,C.innerHTML=a}return l((function(){if(!(t instanceof b)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",c.appendChild(e),c=e}c.appendChild(w),w.appendChild(y),a&&w.appendChild(C)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){var n=document.createElement("span");return e.getRow().watchPosition((function(e){n.innerText=e})),n},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var n=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function a(e){var t=o.element;o.open=e,t&&(o.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",(function(t){t.stopImmediatePropagation(),a(!o.open),e.getTable().rowManager.adjustTableSize()})),a(o.open),n},rowSelection:function(e,t,i){var n=this,o=document.createElement("input"),a=!1;if(o.type="checkbox",o.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var s=e.getRow();s instanceof M?(o.addEventListener("change",(function(e){"click"===n.table.options.selectableRangeMode&&a?a=!1:s.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&o.addEventListener("click",(function(e){a=!0,n.table.modules.selectRow.handleComplexRowClick(s._row,e)})),o.checked=s.isSelected&&s.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(s,o)):o=""}else o.addEventListener("change",(function(e){n.table.modules.selectRow.selectedRows.length?n.table.deselectRow():n.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Ce=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).registerColumnOption("formatter"),i.registerColumnOption("formatterParams"),i.registerColumnOption("formatterPrint"),i.registerColumnOption("formatterPrintParams"),i.registerColumnOption("formatterClipboard"),i.registerColumnOption("formatterClipboardParams"),i.registerColumnOption("formatterHtmlOutput"),i.registerColumnOption("formatterHtmlOutputParams"),i.registerColumnOption("titleFormatter"),i.registerColumnOption("titleFormatterParams"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}},{key:"initializeColumn",value:function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}},{key:"lookupFormatter",value:function(t,i){var n={params:t.definition["formatter"+i+"Params"]||{}},o=t.definition["formatter"+i];switch(e(o)){case"string":s.formatters[o]?n.formatter=s.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),n.formatter=s.formatters.plaintext);break;case"function":n.formatter=o;break;default:n.formatter=s.formatters.plaintext}return n}},{key:"cellRendered",value:function(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}},{key:"formatHeader",value:function(e,t,i){var n,o,a,s;return e.definition.titleFormatter?(n=this.getFormatter(e.definition.titleFormatter),a=function(t){e.titleFormatterRendered=t},s={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,n.call(this,s,o,a)):t}},{key:"formatValue",value:function(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}},{key:"formatExportValue",value:function(e,t){var i,n=e.column.modules.format[t];if(n){return i="function"==typeof n.params?n.params(e.getComponent()):n.params,n.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}},{key:"sanitizeHTML",value:function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}},{key:"emptyToSpace",value:function(e){return null==e||""===e?" ":e}},{key:"getFormatter",value:function(t){switch(e(t)){case"string":s.formatters[t]?t=s.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=s.formatters.plaintext);break;case"function":break;default:t=s.formatters.plaintext}return t}}]),s}(N);Ce.moduleName="format",Ce.formatters=we;var ke=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).leftColumns=[],n.rightColumns=[],n.leftMargin=0,n.rightMargin=0,n.rightPadding=0,n.initializationMode="left",n.active=!1,n.blocked=!0,n.registerColumnOption("frozen"),n}return n(a,[{key:"reset",value:function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}},{key:"initialize",value:function(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}},{key:"blockLayout",value:function(){this.blocked=!0}},{key:"unblockLayout",value:function(){this.blocked=!1}},{key:"layoutCell",value:function(e){this.layoutElement(e.element,e.column)}},{key:"reinitializeColumns",value:function(){var e=this;this.reset(),this.table.columnManager.columnsByIndex.forEach((function(t){e.initializeColumn(t)}))}},{key:"initializeColumn",value:function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}},{key:"frozenCheck",value:function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}},{key:"scrollHorizontal",value:function(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}},{key:"calcMargins",value:function(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}},{key:"layoutCalcRows",value:function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}},{key:"layoutGroupCalcs",value:function(e){var t=this;e.forEach((function(e){e.calcs.top&&t.layoutRow(e.calcs.top),e.calcs.bottom&&t.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&t.layoutGroupCalcs(e.groupList)}))}},{key:"layoutColumnPosition",value:function(e){var t=this,i=[],n=0,o=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach((function(o,a){if(o.modules.frozen.marginValue=n+t.table.columnManager.scrollLeft,o.modules.frozen.margin=o.modules.frozen.marginValue+"px",o.visible&&(n+=o.getWidth()),a==t.leftColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup){var s=t.getColGroupParentElement(o);i.includes(s)||(t.layoutElement(s,o),i.push(s)),o.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+o.modules.frozen.position)}else t.layoutElement(o.getElement(),o);e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(!0),o)}))})),this.rightColumns.forEach((function(i,n){i.visible&&(o+=i.getWidth()),i.modules.frozen.marginValue=t.rightPadding-o,i.modules.frozen.margin=i.modules.frozen.marginValue+"px",n==t.rightColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup?t.layoutElement(t.getColGroupParentElement(i),i):t.layoutElement(i.getElement(),i),e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(!0),i)}))}))}},{key:"getColGroupParentElement",value:function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}},{key:"layout",value:function(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}},{key:"reinitializeRows",value:function(){var e=this,t=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((function(e){return!t.includes(e)})).forEach((function(e){e.deinitialize()})),t.forEach((function(t){"row"===t.type&&e.layoutRow(t)}))}},{key:"layoutRow",value:function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)})),this.rightColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)}))}},{key:"layoutElement",value:function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}},{key:"_calcSpace",value:function(e,t){for(var i=0,n=0;n-1}},{key:"isFrozen",value:function(){return!!this.rows.length}},{key:"visibleRows",value:function(e,t){return this.rows.forEach((function(e){t.push(e)})),t}},{key:"getRows",value:function(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}},{key:"freezeRow",value:function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}},{key:"unfreezeRow",value:function(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}},{key:"detachRow",value:function(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}},{key:"styleRows",value:function(e){var t=this;this.rows.forEach((function(e,i){t.table.rowManager.styleRow(e,i)}))}}]),s}(N);Ee.moduleName="frozenRows";var Re=function(){function e(i){return t(this,e),this._group=i,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}return n(e,[{key:"getKey",value:function(){return this._group.key}},{key:"getField",value:function(){return this._group.field}},{key:"getElement",value:function(){return this._group.element}},{key:"getRows",value:function(){return this._group.getRows(!0)}},{key:"getSubGroups",value:function(){return this._group.getSubGroups(!0)}},{key:"getParentGroup",value:function(){return!!this._group.parent&&this._group.parent.getComponent()}},{key:"isVisible",value:function(){return this._group._visible}},{key:"show",value:function(){this._group.show()}},{key:"hide",value:function(){this._group.hide()}},{key:"toggle",value:function(){this._group.toggleVisibility()}},{key:"_getSelf",value:function(){return this._group}},{key:"getTable",value:function(){return this._group.groupManager.table}}]),e}(),xe=function(){function e(i,n,o,a,s,r,l){t(this,e),this.groupManager=i,this.parent=n,this.key=a,this.level=o,this.field=s,this.hasSubGroups=o-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}},{key:"scrollHeader",value:function(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"getRowIndex",value:function(e){}},{key:"conformRowData",value:function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}},{key:"removeRow",value:function(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}},{key:"getHeadersAndRows",value:function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}},{key:"getData",value:function(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){i.push(e.getData(t||"data"))})),i}},{key:"getRowCount",value:function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e}},{key:"toggleVisibility",value:function(){this.visible?this.hide():this.show()}},{key:"hide",value:function(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){e.getHeadersAndRows().forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}},{key:"show",value:function(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((function(t){t.getHeadersAndRows().forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}},{key:"_visSet",value:function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}},{key:"getRowGroup",value:function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})):this.rows.find((function(t){return t===e}))&&(t=this),t}},{key:"getSubGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getRows",value:function(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"generateGroupHeaderContents",value:function(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}},{key:"getPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}},{key:"getElement",value:function(){return this.elementContents?this.element:this.generateElement()}},{key:"generateElement",value:function(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;en.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(function(t,i){e.headerGenerator[0]=function(e,n,o){return(void 0===e?"":e)+"("+n+" "+(1===n?t:i.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t))this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(t)||(t=[t]),t.forEach((function(t,i){var n,o;n="function"==typeof t?t:(o=e.table.columnManager.getColumnByField(t))?function(e){return o.getFieldValue(e)}:function(e){return e[t]},e.groupIDLookups.push({field:"function"!=typeof t&&t,func:n,values:!!e.allowedValues&&e.allowedValues[i]})})),i&&(Array.isArray(i)||(i=[i]),i.forEach((function(e){})),this.startOpen=i),n&&(this.headerGenerator=Array.isArray(n)?n:[n])}else this.groupList=[],this.groups={}}},{key:"rowSample",value:function(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((function(e){return"group"!==e.type})),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}},{key:"rowAddingIndex",value:function(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var n=e.modules.group.rows;return n.length>1&&(!t||t&&-1==n.indexOf(t)?i?n[0]!==e&&(t=n[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):n[n.length-1]!==e&&(t=n[n.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}},{key:"trackChanges",value:function(){this.dispatch("group-changed")}},{key:"setGroupBy",value:function(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupValues",value:function(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupStartOpen",value:function(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"setGroupHeader",value:function(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"userGetGroups",value:function(e){return this.getGroups(!0)}},{key:"userGetGroupedData",value:function(){return this.table.options.groupBy?this.getGroupedData():this.getData()}},{key:"rowGetGroup",value:function(e){return!!e.modules.group&&e.modules.group.getComponent()}},{key:"rowMoving",value:function(e,t,i){if(this.table.options.groupBy){!i&&t instanceof xe&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t instanceof xe?t:t.modules.group,o=e instanceof xe?e:e.modules.group;n===o?this.table.rowManager.moveRowInArray(n.rows,e,t,i):(o&&o.removeRow(e),n.insertRow(e,t,i))}}},{key:"rowDeleting",value:function(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.table.options.groupBy&&this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}},{key:"getRows",value:function(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}},{key:"getGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getChildGroups",value:function(e){var t=this,i=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?i=i.concat(t.getChildGroups(e)):i.push(e)})),i}},{key:"wipe",value:function(){this.table.options.groupBy&&this.groupList.forEach((function(e){e.wipe()}))}},{key:"pullGroupListData",value:function(e){var t=this,i=[];return e.forEach((function(e){var n={level:0,rowCount:0,headerContent:""},o=[];e.hasSubGroups?(o=t.pullGroupListData(e.groupList),n.level=e.level,n.rowCount=o.length-e.groupList.length,n.headerContent=e.generator(e.key,n.rowCount,e.rows,e),i.push(n),i=i.concat(o)):(n.level=e.level,n.headerContent=e.generator(e.key,e.rows.length,e.rows,e),n.rowCount=e.getRows().length,i.push(n),e.getRows().forEach((function(e){i.push(e.getData("data"))})))})),i}},{key:"getGroupedData",value:function(){return this.pullGroupListData(this.groupList)}},{key:"getRowGroup",value:function(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})),t}},{key:"countGroups",value:function(){return this.groupList.length}},{key:"generateGroups",value:function(e){var t=this,i=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,i)})),e.forEach((function(e){t.assignRowToExistingGroup(e,i)}))):e.forEach((function(e){t.assignRowToGroup(e,i)}))}},{key:"createGroup",value:function(e,t,i){var n,o=t+"_"+e;i=i||[],n=new xe(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=n,this.groupList.push(n)}},{key:"assignRowToExistingGroup",value:function(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}},{key:"assignRowToGroup",value:function(e,t){var i=this.groupIDLookups[0].func(e.getData()),n=!this.groups["0_"+i];return n&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!n}},{key:"reassignRowToGroup",value:function(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),n=this.getExpectedPath(e);i.length==n.length&&i.every((function(e,t){return e===n[t]}))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}},{key:"getExpectedPath",value:function(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((function(e){t.push(e.func(i))})),t}},{key:"updateGroupRows",value:function(e){var t=[];return this.groupList.forEach((function(e){t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}},{key:"scrollHeaders",value:function(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}},{key:"checkBasicModeGroupHeaderWidth",value:function(){var e=this,t=this.table.rowManager.tableElement,i=!0;this.table.rowManager.getDisplayRows().forEach((function(n,o){e.table.rowManager.styleRow(n,o),t.appendChild(n.getElement()),n.initialize(!0),"group"!==n.type&&(i=!1)})),t.style.minWidth=i?this.table.columnManager.getWidth()+"px":""}}]),a}(N);Te.moduleName="groupRows";var Me=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).history=[],n.index=-1,n.registerTableOption("history",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}},{key:"rowMoved",value:function(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}},{key:"rowAdded",value:function(e,t,i,n){this.action("rowAdd",e,{data:t,pos:i,index:n})}},{key:"rowDeleted",value:function(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}},{key:"cellUpdated",value:function(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}},{key:"clear",value:function(){this.history=[],this.index=-1}},{key:"action",value:function(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}},{key:"getHistoryUndoSize",value:function(){return this.index+1}},{key:"getHistoryRedoSize",value:function(){return this.history.length-(this.index+1)}},{key:"clearComponentHistory",value:function(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}},{key:"undo",value:function(){if(this.index>-1){var e=this.history[this.index];return a.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}},{key:"redo",value:function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return a.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}},{key:"_rebindRow",value:function(e,t){this.history.forEach((function(i){if(i.component instanceof L)i.component===e&&(i.component=t);else if(i.component instanceof y&&i.component.row===e){var n=i.component.column.getField();n&&(i.component=t.getCell(n))}}))}}]),a}(N);Me.moduleName="history",Me.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},Me.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};var Le=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).fieldIndex=[],i.hasIndex=!1,i}return n(s,[{key:"initialize",value:function(){this.tableElementCheck()}},{key:"tableElementCheck",value:function(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}},{key:"parseTable",value:function(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),n=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),n=n?n.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,n):this._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}},{key:"clearBindings",value:function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}},{key:"checkBinding",value:function(e,t){var i=this,n=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){-1==i.pressedKeys.indexOf(e)&&(n=!1)})),n&&t.action.call(this,e),!0)}}]),s}(N);ze.moduleName="keybindings",ze.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},ze.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,n=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=n?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};var Fe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).menuContainer=null,n.nestedMenuBlock=!1,n.currentComponent=null,n.rootPopup=null,n.columnSubscribers={},n.registerTableOption("menuContainer",void 0),n.registerTableOption("rowContextMenu",!1),n.registerTableOption("rowClickMenu",!1),n.registerTableOption("groupContextMenu",!1),n.registerTableOption("groupClickMenu",!1),n.registerColumnOption("headerContextMenu"),n.registerColumnOption("headerClickMenu"),n.registerColumnOption("headerMenu"),n.registerColumnOption("headerMenuIcon"),n.registerColumnOption("contextMenu"),n.registerColumnOption("clickMenu"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}},{key:"initializeColumnHeaderMenu",value:function(e){var t,i=this,n=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadMenuTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}},{key:"loadMenuTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}},{key:"loadMenuEvent",value:function(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}},{key:"loadMenu",value:function(e,t,i,n,o){var a,s=this,r=!(e instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(n)a=o.child(l);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((function(){s.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(l)}i.forEach((function(e){var i=document.createElement("div"),n=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n.call(s.table,t.getComponent())),n instanceof Node?i.appendChild(n):i.innerHTML=n,"function"==typeof o&&(o=o.call(s.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(function(e){e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(function(n){n.stopPropagation(),s.loadMenu(n,t,e.menu,i,a)})):e.action&&i.addEventListener("click",(function(i){e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),l.appendChild(i)})),l.addEventListener("click",(function(e){s.rootPopup.hide()})),a.show(n||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur((function(){s.rootPopup=null,s.currentComponent&&(s.dispatchExternal("menuClosed",s.currentComponent.getComponent()),s.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}]),a}(N);Fe.moduleName="menu";var He=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).placeholderElement=n.createPlaceholderElement(),n.hoverElement=!1,n.checkTimeout=!1,n.checkPeriod=250,n.moving=!1,n.toCol=!1,n.toColAfter=!1,n.startX=0,n.autoScrollMargin=40,n.autoScrollStep=5,n.autoScrollTimeout=!1,n.touchMove=!1,n.moveHover=n.moveHover.bind(r(n)),n.endMove=n.endMove.bind(r(n)),n.registerTableOption("movableColumns",!1),n}return n(a,[{key:"createPlaceholderElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}},{key:"initialize",value:function(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeColumn",value:function(e){var t,i=this,n={};e.modules.frozen||e.isGroup||(t=e.getElement(),n.mousemove=function(n){e.parent===i.moving.parent&&((i.touchMove?n.touches[0].pageX:n.pageX)-C.elOffset(t).left+i.table.columnManager.element.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",(function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),i.bindTouchEvents(e)),e.modules.moveColumn=n}},{key:"bindTouchEvents",value:function(e){var t,i,n,o,a,s,r=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){r.checkTimeout=setTimeout((function(){r.touchMove=!0,t=e.nextColumn(),n=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,a=0,s=0,u=!1,r.startMove(l,e)}),r.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,h;r.moving&&(r.moveHover(l),u||(u=l.touches[0].pageX),(c=l.touches[0].pageX-u)>0?t&&c-a>n&&(h=t)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(r.placeholderElement,h.getElement().nextSibling),r.moveColumn(h,!0)):i&&-c-s>o&&(h=i)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(r.placeholderElement,h.getElement()),r.moveColumn(h,!1)),h&&(t=h.nextColumn(),a=n,n=t?t.getWidth()/2:0,i=h.prevColumn(),s=o,o=i?i.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)}))}},{key:"startMove",value:function(e,t){var i=t.getElement(),n=this.table.columnManager.getElement(),o=this.table.columnManager.getHeadersElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-C.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=n.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}},{key:"_bindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"moveColumn",value:function(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n.nextSibling)})):e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n)}))}},{key:"endMove",value:function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}},{key:"moveHover",value:function(e){var t,i=this,n=this.table.columnManager.getElement(),o=n.scrollLeft,a=(this.touchMove?e.touches[0].pageX:e.pageX)-C.elOffset(n).left+o;this.hoverElement.style.left=a-this.startX+"px",a-oe.getHeight()/2?t.toRow===e&&t.toRowAfter||((n=e.getElement()).parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement()).previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}},{key:"initializeRow",value:function(e){var t,i=this,n={};n.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),n.mousemove=function(t){var n=e.getElement();t.pageY-C.elOffset(n).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(n.parentNode.insertBefore(i.placeholderElement,n.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(n.parentNode.insertBefore(i.placeholderElement,n),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n}},{key:"initializeColumn",value:function(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}},{key:"initializeCell",value:function(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}},{key:"bindTouchEvents",value:function(e,t){var i,n,o,a,s,r,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,n=e.prevRow(),a=n?n.getHeight()/2:0,s=0,r=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,h;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),(c=t.touches[0].pageY-u)>0?i&&c-s>o&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveRow(h,!0)):n&&-c-r>a&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveRow(h,!1)),h&&(i=h.nextRow(),s=o,o=i?i.getHeight()/2:0,n=h.prevRow(),r=a,a=n?n.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))}},{key:"_bindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"startMove",value:function(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}},{key:"setStartPosition",value:function(e,t){var i,n,o=this.touchMove?e.touches[0].pageX:e.pageX,a=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(n=i.getBoundingClientRect(),this.startX=n.left-o+window.pageXOffset,this.startY=n.top-a+window.pageYOffset):this.startY=a-i.getBoundingClientRect().top}},{key:"endMove",value:function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}},{key:"moveRow",value:function(e,t){this.toRow=e,this.toRowAfter=t}},{key:"moveHover",value:function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}},{key:"moveHoverTable",value:function(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(n-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}},{key:"moveHoverConnections",value:function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}},{key:"elementRowDrop",value:function(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}},{key:"connectToTables",value:function(e){var t,i=this;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"==typeof e?i.connectionElements=i.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):i.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){i.elementRowDrop(t,e,i.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}},{key:"disconnectFromTables",value:function(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}},{key:"connect",value:function(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}},{key:"disconnect",value:function(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}},{key:"dropComplete",value:function(t,i,n){var o=!1;if(n){switch(e(this.table.options.movableRowsSender)){case"string":o=this.senders[this.table.options.movableRowsSender];break;case"function":o=this.table.options.movableRowsSender}o?o.call(this,this.moving?this.moving.getComponent():void 0,i?i.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),i?i.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),i?i.getComponent():void 0,t);this.endMove()}},{key:"tableRowDrop",value:function(t,i){var n=!1,o=!1;switch(t.stopImmediatePropagation(),e(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?o=n.call(this,this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),o?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:i,success:o})}},{key:"commsReceived",value:function(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}]),s}(N);Oe.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},Oe.prototype.senders={delete:function(e,t,i){e.delete()}},Oe.moduleName="moveRow";var Ae=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).allowedTypes=["","data","edit","clipboard"],i.enabled=!0,i.registerColumnOption("mutator"),i.registerColumnOption("mutatorParams"),i.registerColumnOption("mutatorData"),i.registerColumnOption("mutatorDataParams"),i.registerColumnOption("mutatorEdit"),i.registerColumnOption("mutatorEditParams"),i.registerColumnOption("mutatorClipboard"),i.registerColumnOption("mutatorClipboardParams"),i.registerColumnOption("mutateLink"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}},{key:"rowDataChanged",value:function(e,t,i){return this.transformRow(t,"data",i)}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,s="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[s]&&(a=t.lookupMutator(e.definition[s]))&&(i=!0,n[s]={mutator:a,params:e.definition[s+"Params"]||{}})})),i&&(e.modules.mutate=n)}},{key:"lookupMutator",value:function(t){var i=!1;switch(e(t)){case"string":s.mutators[t]?i=s.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t,i){var n,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((function(a){var s,r,l;a.modules.mutate&&(s=a.modules.mutate[o]||a.modules.mutate.mutator||!1)&&(n=a.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===n||(l=a.getComponent(),r="function"==typeof s.params?s.params(n,e,t,l):s.params,a.setFieldValue(e,s.mutator(n,e,t,r,l))))})),e}},{key:"transformCell",value:function(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,n={};if(i)return n=Object.assign(n,e.row.getData()),e.column.setFieldValue(n,t),i.mutator(t,n,"edit",i.params,e.getComponent())}return t}},{key:"mutateLink",value:function(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((function(t){var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}}]),s}(N);Ae.moduleName="mutator",Ae.mutators={};var _e={rows:function(e,t,i,n,o){var a=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){s.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(function(e){c.innerHTML=e})),n?(r.innerHTML=" "+t+"-"+Math.min(t+e-1,n)+" ",u.innerHTML=" "+n+" ",a.appendChild(s),a.appendChild(r),a.appendChild(l),a.appendChild(u),a.appendChild(c)):(r.innerHTML=" 0 ",a.appendChild(s),a.appendChild(r),a.appendChild(c)),a},pages:function(e,t,i,n,o){var a=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){s.innerHTML=e})),r.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),u.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(function(e){c.innerHTML=e})),a.appendChild(s),a.appendChild(r),a.appendChild(l),a.appendChild(u),a.appendChild(c),a}},Be=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).mode="local",i.progressiveLoad=!1,i.element=null,i.pageCounterElement=null,i.pageCounter=null,i.size=0,i.page=1,i.count=5,i.max=1,i.remoteRowCountEstimate=null,i.initialLoad=!0,i.dataChanging=!1,i.pageSizes=[],i.registerTableOption("pagination",!1),i.registerTableOption("paginationMode","local"),i.registerTableOption("paginationSize",!1),i.registerTableOption("paginationInitialPage",1),i.registerTableOption("paginationCounter",!1),i.registerTableOption("paginationCounterElement",!1),i.registerTableOption("paginationButtonCount",5),i.registerTableOption("paginationSizeSelector",!1),i.registerTableOption("paginationElement",!1),i.registerTableOption("paginationAddRow","page"),i.registerTableOption("progressiveLoad",!1),i.registerTableOption("progressiveLoadDelay",0),i.registerTableOption("progressiveLoadScrollMargin",0),i.registerTableFunction("setMaxPage",i.setMaxPage.bind(r(i))),i.registerTableFunction("setPage",i.setPage.bind(r(i))),i.registerTableFunction("setPageToRow",i.userSetPageToRow.bind(r(i))),i.registerTableFunction("setPageSize",i.userSetPageSize.bind(r(i))),i.registerTableFunction("getPageSize",i.getPageSize.bind(r(i))),i.registerTableFunction("previousPage",i.previousPage.bind(r(i))),i.registerTableFunction("nextPage",i.nextPage.bind(r(i))),i.registerTableFunction("getPage",i.getPage.bind(r(i))),i.registerTableFunction("getPageMax",i.getPageMax.bind(r(i))),i.registerComponentFunction("row","pageTo",i.setPageToRow.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}},{key:"rowAddingPosition",value:function(e,t){var i,n=this.table.rowManager,o=n.getDisplayRows();return t?o.length?i=o[0]:n.activeRows.length&&(i=n.activeRows[n.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.lengththis.max&&(this.page=this.max)}},{key:"reset",value:function(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}},{key:"setMaxPage",value:function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}},{key:"setPage",value:function(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}},{key:"setPageToRow",value:function(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}},{key:"setPageSize",value:function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}},{key:"_setPageCounter",value:function(t,i,n){var o;if(this.pageCounter)switch("remote"===this.mode&&(i=this.size,n=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),e(o=this.pageCounter.call(this,i,n,this.page,t,this.max))){case"object":if(o instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(o)}else this.pageCounterElement.innerHTML="",null!=o&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",o);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=o}}},{key:"_setPageButtons",value:function(){for(var e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&o<=this.max&&this.pagesElement.appendChild(this._generatePageButton(o));this.footerRedraw()}},{key:"_generatePageButton",value:function(e){var t=this,i=document.createElement("button");return i.classList.add("tabulator-page"),e==this.page&&i.classList.add("active"),i.setAttribute("type","button"),i.setAttribute("role","button"),this.langBind("pagination|page_title",(function(t){i.setAttribute("aria-label",t+" "+e),i.setAttribute("title",t+" "+e)})),i.setAttribute("data-page",e),i.textContent=e,i.addEventListener("click",(function(i){t.setPage(e)})),i}},{key:"previousPage",value:function(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}},{key:"nextPage",value:function(){return this.page-1&&(o=o.slice(s),(i=o.indexOf(";"))>-1&&(o=o.slice(0,i)),n=o.replace(a+"=","")),!!n&&JSON.parse(n)}},Ve={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+n.toUTCString()}},Ne=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).mode="",n.id="",n.defWatcherBlock=!1,n.config={},n.readFunc=!1,n.writeFunc=!1,n.registerTableOption("persistence",!1),n.registerTableOption("persistenceID",""),n.registerTableOption("persistenceMode",!0),n.registerTableOption("persistenceReaderFunc",!1),n.registerTableOption("persistenceWriterFunc",!1),n}return n(a,[{key:"localStorageTest",value:function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"initialize",value:function(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:a.readers[this.table.options.persistenceReaderFunc]?this.readFunc=a.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):a.readers[this.mode]?this.readFunc=a.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:a.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=a.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):a.writers[this.mode]?this.writeFunc=a.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}},{key:"eventSave",value:function(e){this.config[e]&&this.save(e)}},{key:"tableBuilt",value:function(){var e,t;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}},{key:"tableRedraw",value:function(e){e&&this.config.columns&&this.save("columns")}},{key:"getColumnLayout",value:function(){return this.parseColumns(this.table.columnManager.getColumns())}},{key:"setColumnLayout",value:function(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}},{key:"initializeColumn",value:function(e){var t,i=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e),o=t[e];n&&Object.defineProperty(t,e,{set:function(e){o=e,i.defWatcherBlock||i.save("columns"),n.set&&n.set(e)},get:function(){return n.get&&n.get(),o}})})),this.defWatcherBlock=!1)}},{key:"load",value:function(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}},{key:"retrieveData",value:function(e){return!!this.readFunc&&this.readFunc(this.id,e)}},{key:"mergeDefinition",value:function(e,t){var i=this,n=[];return(t=t||[]).forEach((function(t,o){var a,s=i._findColumn(e,t);s&&(!0===i.config.columns||null==i.config.columns?(a=Object.keys(s)).push("width"):a=i.config.columns,a.forEach((function(e){"columns"!==e&&void 0!==t[e]&&(s[e]=t[e])})),s.columns&&(s.columns=i.mergeDefinition(s.columns,t.columns)),n.push(s))})),e.forEach((function(e,o){i._findColumn(t,e)||(n.length>o?n.splice(o,0,e):n.push(e))})),n}},{key:"_findColumn",value:function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}},{key:"save",value:function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}},{key:"validateSorters",value:function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}},{key:"getGroupConfig",value:function(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}},{key:"getPageConfig",value:function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}},{key:"parseColumns",value:function(e){var t=this,i=[],n=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((function(e){var o,a={},s=e.getDefinition();e.isGroup?(a.title=s.title,a.columns=t.parseColumns(e.getColumns())):(a.field=e.getField(),!0===t.config.columns||null==t.config.columns?((o=Object.keys(s)).push("width"),o.push("visible")):o=t.config.columns,o.forEach((function(t){switch(t){case"width":a.width=e.getWidth();break;case"visible":a.visible=e.visible;break;default:"function"!=typeof s[t]&&-1===n.indexOf(t)&&(a[t]=s[t])}}))),i.push(a)})),i}}]),a}(N);Ne.moduleName="persistence",Ne.moduleInitOrder=-10,Ne.readers=Ie,Ne.writers=Ve;var We=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).columnSubscribers={},n.registerTableOption("rowContextPopup",!1),n.registerTableOption("rowClickPopup",!1),n.registerTableOption("groupContextPopup",!1),n.registerTableOption("groupClickPopup",!1),n.registerColumnOption("headerContextPopup"),n.registerColumnOption("headerClickPopup"),n.registerColumnOption("headerPopup"),n.registerColumnOption("headerPopupIcon"),n.registerColumnOption("contextPopup"),n.registerColumnOption("clickPopup"),n}return n(a,[{key:"initialize",value:function(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}},{key:"initializeColumnHeaderPopup",value:function(e){var t,i=this,n=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadPopupTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}},{key:"loadPopupTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}},{key:"loadPopupEvent",value:function(e,t,i){var n;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){n=e})):e,this.loadPopup(t,i,e,n)}},{key:"loadPopup",value:function(e,t,i,n){var o,a,s=this,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(function(e){e.stopPropagation()})),r||e.preventDefault(),a=this.popup(o),"function"==typeof n&&a.renderCallback(n),a.show(e).hideOnBlur((function(){s.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}]),a}(N);We.moduleName="popup";var je=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).element=!1,n.manualBlock=!1,n.registerTableOption("printAsHtml",!1),n.registerTableOption("printFormatter",!1),n.registerTableOption("printHeader",!1),n.registerTableOption("printFooter",!1),n.registerTableOption("printStyled",!0),n.registerTableOption("printRowRange","visible"),n.registerTableOption("printConfig",{}),n.registerColumnOption("print"),n.registerColumnOption("titlePrint"),n}return n(a,[{key:"initialize",value:function(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}},{key:"replaceTable",value:function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}},{key:"cleanup",value:function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}},{key:"printFullscreen",value:function(e,t,i){var n,o,a=window.scrollX,s=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),"string"==typeof(n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?r.innerHTML=n:r.appendChild(n),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(a,s),this.manualBlock=!1}}]),a}(N);je.moduleName="print";var Ge=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).data=!1,n.blocked=!1,n.origFuncs={},n.currentVersion=0,n.registerTableOption("reactiveData",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}},{key:"watchData",value:function(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((function(e){i.table.rowManager.addRowActual(e,!1)})),n=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),n}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((function(e){i.table.rowManager.addRowActual(e,!0)})),n=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),n}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var n,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[0]))&&n.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var n,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&n.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var n,o,a=Array.from(arguments),s=a[0]<0?e.length+a[0]:a[0],r=a[1],l=!!a[2]&&a.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((n=!!e[s]&&i.table.rowManager.getRowFromDataObject(e[s]))?l.forEach((function(e){i.table.rowManager.addRowActual(e,!0,n,!0)})):(l=l.slice().reverse()).forEach((function(e){i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var u=e.slice(s,void 0===a[1]?a[1]:s+r);u.forEach((function(e,t){var n=i.table.rowManager.getRowFromDataObject(e);n&&n.deleteActual(t!==u.length-1)}))}(l||0!==r)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}},{key:"unwatchData",value:function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}},{key:"watchRow",value:function(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}},{key:"watchTreeChildren",value:function(e){var t=arguments,i=this,n=this,o=e.getData()[this.table.options.dataTreeChildField],a={};o&&(a.push=o.push,Object.defineProperty(o,"push",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-push");var s=a.push.apply(o,t);i.rebuildTree(e),n.unblock("tree-push")}return s}}),a.unshift=o.unshift,Object.defineProperty(o,"unshift",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-unshift");var s=a.unshift.apply(o,t);i.rebuildTree(e),n.unblock("tree-unshift")}return s}}),a.shift=o.shift,Object.defineProperty(o,"shift",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-shift");var t=a.shift.call(o);i.rebuildTree(e),n.unblock("tree-shift")}return t}}),a.pop=o.pop,Object.defineProperty(o,"pop",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-pop");var t=a.pop.call(o);i.rebuildTree(e),n.unblock("tree-pop")}return t}}),a.splice=o.splice,Object.defineProperty(o,"splice",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-splice");var s=a.splice.apply(o,t);i.rebuildTree(e),n.unblock("tree-splice")}return s}}))}},{key:"rebuildTree",value:function(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}},{key:"watchKey",value:function(e,t,i){var n=this,o=Object.getOwnPropertyDescriptor(t,i),a=t[i],s=this.currentVersion;Object.defineProperty(t,i,{set:function(t){if(a=t,!n.blocked&&s===n.currentVersion){n.block("key");var r={};r[i]=t,e.updateData(r),n.unblock("key")}o.set&&o.set(t)},get:function(){return o.get&&o.get(),a}})}},{key:"unwatchRow",value:function(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}},{key:"block",value:function(e){this.blocked||(this.blocked=e)}},{key:"unblock",value:function(e){this.blocked===e&&(this.blocked=!1)}}]),a}(N);Ge.moduleName="reactiveData";var Ue=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).startColumn=!1,n.startX=!1,n.startWidth=!1,n.latestX=!1,n.handle=null,n.initialNextColumn=null,n.nextColumn=null,n.initialized=!1,n.registerColumnOption("resizable",!0),n.registerTableOption("resizableColumnFit",!1),n}return n(a,[{key:"initialize",value:function(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}},{key:"initializeEventWatchers",value:function(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}},{key:"layoutCellHandles",value:function(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}},{key:"layoutColumnHeader",value:function(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}},{key:"columnLayoutUpdated",value:function(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}},{key:"columnWidthUpdated",value:function(e){var t=this;e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((function(e){t.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((function(e){t.reinitializeColumn(e)})))}},{key:"reinitializeColumn",value:function(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((function(e){e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}},{key:"initializeColumn",value:function(e,t,i,n){var o=this,a=i.definition.resizable,s={},r=i.getLastColumn();if("header"===e&&(s={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===a||a==e)&&this._checkResizability(r)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=r.nextColumn(),o._mouseDown(e,r,l)};l.addEventListener("mousedown",u),l.addEventListener("touchstart",u,{passive:!0}),l.addEventListener("dblclick",(function(e){var t=r.getWidth();e.stopPropagation(),r.reinitializeWidth(!0),t!==r.getWidth()&&(o.dispatch("column-resized",r),o.table.externalEvents.dispatch("columnResized",r.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),s.handleEl=l,n.parentNode&&i.visible&&n.after(l)}t.modules.resize=s}},{key:"deInitializeColumn",value:function(e){var t=this;this.deInitializeComponent(e),e.cells.forEach((function(e){t.deInitializeComponent(e)}))}},{key:"deInitializeComponent",value:function(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}},{key:"resizeHandle",value:function(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}},{key:"_checkResizability",value:function(e){return e.definition.resizable}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){var i,o,a=void 0===e.screenX?e.touches[0].screenX:e.screenX,s=a-n.startX,r=a-n.latestX;if(n.latestX=a,n.table.rtl&&(s=-s,r=-r),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(n.startWidth+s),o=t.width==t.minWidth||t.width==t.maxWidth,r<0&&(n.nextColumn=n.initialNextColumn),n.table.options.resizableColumnFit&&n.nextColumn&&(!i||!o)){var l=n.nextColumn.getWidth();r>0&&l<=n.nextColumn.minWidth&&(n.nextColumn=n.nextColumn.nextColumn()),n.nextColumn&&n.nextColumn.setWidth(n.nextColumn.getWidth()-r)}n.table.columnManager.rerenderColumns(!0),!n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function a(e){n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==t.getWidth()&&(n.dispatch("column-resized",t),n.table.externalEvents.dispatch("columnResized",t.getComponent()))}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,n.latestX=n.startX,n.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),a}(N);Ue.moduleName="resizeColumns";var Xe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).startColumn=!1,n.startY=!1,n.startHeight=!1,n.handle=null,n.prevHandle=null,n.registerTableOption("resizableRows",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(i){t.startRow=e,t._mouseDown(i,e,n)};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var s=function(i){var n=t.table.rowManager.prevDisplayRow(e);n&&(t.startRow=n,t._mouseDown(i,n,o))};o.addEventListener("mousedown",s),o.addEventListener("touchstart",s,{passive:!0}),i.appendChild(n),i.appendChild(o)}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){t.setHeight(n.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-n.startY))}function a(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",t.getComponent())}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,n.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),a}(N);Xe.moduleName="resizeRows";var qe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).binding=!1,n.visibilityObserver=!1,n.resizeObserver=!1,n.containerObserver=!1,n.tableHeight=0,n.tableWidth=0,n.containerHeight=0,n.containerWidth=0,n.autoResize=!1,n.visible=!1,n.initialized=!1,n.initialRedraw=!1,n.registerTableOption("autoResize",!0),n}return n(a,[{key:"initialize",value:function(){var e=this;if(this.table.options.autoResize){var t,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.tableHeight==n&&e.tableWidth==o||(e.tableHeight=n,e.tableWidth=o,i.element.parentNode&&(e.containerHeight=i.element.parentNode.clientHeight,e.containerWidth=i.element.parentNode.clientWidth),e.redrawTable())}})),this.resizeObserver.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.containerHeight==n&&e.containerWidth==o||(e.containerHeight=n,e.containerWidth=o,e.tableHeight=i.element.clientHeight,e.tableWidth=i.element.clientWidth),e.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&(i.columnManager.rerenderColumns(!0),i.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}},{key:"initializeVisibilityObserver",value:function(){var e=this;this.visibilityObserver=new IntersectionObserver((function(t){e.visible=t[0].isIntersecting,e.initialized||(e.initialized=!0,e.initialRedraw=!e.visible),e.visible&&(e.redrawTable(e.initialRedraw),e.initialRedraw=!1)})),this.visibilityObserver.observe(this.table.element)}},{key:"redrawTable",value:function(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}},{key:"tableResized",value:function(){this.table.rowManager.redraw()}},{key:"clearBindings",value:function(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}]),a}(N);qe.moduleName="resizeTable";var Ke=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).columns=[],n.hiddenColumns=[],n.mode="",n.index=0,n.collapseFormatter=[],n.collapseStartOpen=!0,n.collapseHandleColumn=!1,n.registerTableOption("responsiveLayout",!1),n.registerTableOption("responsiveLayoutCollapseStartOpen",!0),n.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),n.registerTableOption("responsiveLayoutCollapseFormatter",!1),n.registerColumnOption("responsive"),n}return n(a,[{key:"initialize",value:function(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}},{key:"tableRedraw",value:function(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}},{key:"initializeResponsivity",value:function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach((function(i,n){i.modules.responsive&&i.modules.responsive.order&&i.modules.responsive.visible&&(i.modules.responsive.index=n,t.push(i),i.visible||"collapse"!==e.mode||e.hiddenColumns.push(i))})),t=(t=t.reverse()).sort((function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var i,n=p(this.table.columnManager.columnsByIndex);try{for(n.s();!(i=n.n()).done;){var o=i.value;if("responsiveCollapse"==o.definition.formatter){this.collapseHandleColumn=o;break}}}catch(e){n.e(e)}finally{n.f()}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}},{key:"initializeColumn",value:function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}},{key:"initializeRow",value:function(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}},{key:"layoutRow",value:function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}},{key:"updateColumnVisibility",value:function(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}},{key:"hideColumn",value:function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}},{key:"showColumn",value:function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}},{key:"update",value:function(){for(var e=this,t=!0;t;){var i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(n<0){var o=e.columns[e.index];o?(e.hideColumn(o),e.index++):t=!1}else{var a=e.columns[e.index-1];a&&n>0&&n>=a.getWidth()?(e.showColumn(a),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}},{key:"generateCollapsedContent",value:function(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}},{key:"generateCollapsedRowContent",value:function(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}},{key:"generateCollapsedRowData",value:function(e){var t,i=this,n=e.getData(),o=[];return this.hiddenColumns.forEach((function(a){var s=a.getFieldValue(n);if(a.definition.title&&a.field)if(a.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return s},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},o.push({field:a.field,title:a.definition.title,value:a.modules.format.formatter.call(i.table.modules.format,t,a.modules.format.params,(function(e){e()}))})}else o.push({field:a.field,title:a.definition.title,value:s})})),o}},{key:"formatCollapsedData",value:function(e){var t=document.createElement("table");return e.forEach((function(e){var i,n=document.createElement("tr"),o=document.createElement("td"),a=document.createElement("td"),s=document.createElement("strong");o.appendChild(s),this.langBind("columns|"+e.field,(function(t){s.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),a.appendChild(i)):a.innerHTML=e.value,n.appendChild(o),n.appendChild(a),t.appendChild(n)}),this),Object.keys(e).length?t:""}}]),a}(N);Ke.moduleName="responsiveLayout";var Je=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).selecting=!1,i.lastClickedRow=!1,i.selectPrev=[],i.selectedRows=[],i.headerCheckboxElement=null,i.registerTableOption("selectable","highlight"),i.registerTableOption("selectableRangeMode","drag"),i.registerTableOption("selectableRollingSelection",!0),i.registerTableOption("selectablePersistence",!0),i.registerTableOption("selectableCheck",(function(e,t){return!0})),i.registerTableFunction("selectRow",i.selectRows.bind(r(i))),i.registerTableFunction("deselectRow",i.deselectRows.bind(r(i))),i.registerTableFunction("toggleSelectRow",i.toggleRow.bind(r(i))),i.registerTableFunction("getSelectedRows",i.getSelectedRows.bind(r(i))),i.registerTableFunction("getSelectedData",i.getSelectedData.bind(r(i))),i.registerComponentFunction("row","select",i.selectRows.bind(r(i))),i.registerComponentFunction("row","deselect",i.deselectRows.bind(r(i))),i.registerComponentFunction("row","toggleSelect",i.toggleRow.bind(r(i))),i.registerComponentFunction("row","isSelected",i.isRowSelected.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}},{key:"rowRetrieve",value:function(e,t){return"selected"===e?this.selectedRows:t}},{key:"rowDeleted",value:function(e){this._deselectRow(e,!0)}},{key:"clearSelectionData",value:function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}},{key:"handleComplexRowClick",value:function(e,t){var i=this;if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var n=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),o=this.table.rowManager.getDisplayRowIndex(e),a=n<=o?n:o,s=n>=o?n:o,r=this.table.rowManager.getDisplayRows().slice(0).splice(a,s-a+1);t.ctrlKey||t.metaKey?(r.forEach((function(t){t!==i.lastClickedRow&&(!0===i.table.options.selectable||i.isRowSelected(e)||i.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}},{key:"toggleRow",value:function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}},{key:"selectRows",value:function(t){var i,n=this;switch(e(t)){case"undefined":this.table.rowManager.rows.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(i=this.table.rowManager.findRow(t))?(this._selectRow(i,!0,!0),this._rowSelectionChanged()):((i=this.table.rowManager.getRows(t)).forEach((function(e){n._selectRow(e,!0,!0)})),i.length&&this._rowSelectionChanged());break;default:Array.isArray(t)?(t.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(t,!1,!0)}}},{key:"_selectRow",value:function(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var n=this.table.rowManager.findRow(e);n?-1==this.selectedRows.indexOf(n)&&(n.getElement().classList.add("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!0,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!0),this.selectedRows.push(n),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!0),this.dispatchExternal("rowSelected",n.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}},{key:"isRowSelected",value:function(e){return-1!==this.selectedRows.indexOf(e)}},{key:"deselectRows",value:function(e,t){var i,n=this;if(void 0===e){i=n.selectedRows.length;for(var o=0;o-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}},{key:"getSelectedData",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}},{key:"getSelectedRows",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}},{key:"_rowSelectionChanged",value:function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}},{key:"registerRowSelectCheckbox",value:function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}},{key:"registerHeaderSelectCheckbox",value:function(e){this.headerCheckboxElement=e}},{key:"childRowSelection",value:function(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t){var n,o=p(i);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._selectRow(a,!0)}}catch(e){o.e(e)}finally{o.f()}}else{var s,r=p(i);try{for(r.s();!(s=r.n()).done;){var l=s.value;this._deselectRow(l,!0)}}catch(e){r.e(e)}finally{r.f()}}}}]),s}(N);function Ye(e,t,i,n,o,a,s){var r=window.DateTime||luxon.DateTime,l=s.format||"dd/MM/yyyy HH:mm:ss",u=s.alignEmptyValues,c=0;if(void 0!==r){if(r.isDateTime(e)||(e="iso"===l?r.fromISO(String(e)):r.fromFormat(String(e),l)),r.isDateTime(t)||(t="iso"===l?r.fromISO(String(t)):r.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;c=1}else c=t.isValid?-1:0;return("top"===u&&"desc"===a||"bottom"===u&&"asc"===a)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}Je.moduleName="selectRow";var $e={number:function(e,t,i,n,o,a,s){var r=s.alignEmptyValues,l=s.decimalSeparator,u=s.thousandSeparator,c=0;if(e=String(e),t=String(t),u&&(e=e.split(u).join(""),t=t.split(u).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===r&&"desc"===a||"bottom"===r&&"asc"===a)&&(c*=-1),c},string:function(t,i,n,o,a,s,r){var l,u=r.alignEmptyValues,c=0;if(t){if(i){switch(e(r.locale)){case"boolean":r.locale&&(l=this.langLocale());break;case"string":l=r.locale}return String(t).toLowerCase().localeCompare(String(i).toLowerCase(),l)}c=1}else c=i?-1:0;return("top"===u&&"desc"===s||"bottom"===u&&"asc"===s)&&(c*=-1),c},date:function(e,t,i,n,o,a,s){return s.format||(s.format="dd/MM/yyyy"),Ye.call(this,e,t,i,n,o,a,s)},time:function(e,t,i,n,o,a,s){return s.format||(s.format="HH:mm"),Ye.call(this,e,t,i,n,o,a,s)},datetime:Ye,boolean:function(e,t,i,n,o,a,s){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,n,o,a,s){var r=s.type||"length",l=s.alignEmptyValues,u=0;function c(e){var t;switch(r){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length}return t}if(Array.isArray(e)){if(Array.isArray(t))return c(t)-c(e);u=1}else u=Array.isArray(t)?-1:0;return("top"===l&&"desc"===a||"bottom"===l&&"asc"===a)&&(u*=-1),u},exists:function(e,t,i,n,o,a,s){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,n,o,a,s){var r,l,u,c,h,d=0,m=/(\d+)|(\D+)/g,p=/\d/,f=s.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((r=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(r)||!p.test(l))return r>l?1:-1;for(r=r.match(m),l=l.match(m),h=r.length>l.length?l.length:r.length;dc?1:-1;return r.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===a||"bottom"===f&&"asc"===a)&&(g*=-1),g}},Ze=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).sortList=[],i.changed=!1,i.registerTableOption("sortMode","local"),i.registerTableOption("initialSort",!1),i.registerTableOption("columnHeaderSortMulti",!0),i.registerTableOption("sortOrderReverse",!1),i.registerTableOption("headerSortElement","
"),i.registerColumnOption("sorter"),i.registerColumnOption("sorterParams"),i.registerColumnOption("headerSort",!0),i.registerColumnOption("headerSortStartingDir"),i.registerColumnOption("headerSortTristate"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}},{key:"tableBuilt",value:function(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}},{key:"remoteSortParams",value:function(e,t,i,n){var o=this.getSort();return o.forEach((function(e){delete e.column})),n.sort=o,n}},{key:"userSetSort",value:function(e,t){this.setSort(e,t),this.refreshSort()}},{key:"clearSort",value:function(){this.clear(),this.refreshSort()}},{key:"initializeColumn",value:function(t){var i,n,o=this,a=!1;switch(e(t.definition.sorter)){case"string":s.sorters[t.definition.sorter]?a=s.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":a=t.definition.sorter}if(t.modules.sort={sorter:a,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort){switch((i=t.getElement()).classList.add("tabulator-sortable"),(n=document.createElement("div")).classList.add("tabulator-col-sorter"),this.table.options.headerSortElement){case"function":break;case"object":n.appendChild(this.table.options.headerSortElement);break;default:n.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(n),t.modules.sort.element=n,this.setColumnHeaderSortIcon(t,"none"),i.addEventListener("click",(function(e){var i="",n=[],a=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}o.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((a=(n=o.getSort()).findIndex((function(e){return e.field===t.getField()})))>-1?(n[a].dir=i,a=n.splice(a,1)[0],"none"!=i&&n.push(a)):"none"!=i&&n.push({column:t,dir:i}),o.setSort(n)):"none"==i?o.clear():o.setSort(t,i),o.refreshSort()}}))}}},{key:"refreshSort",value:function(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"getSort",value:function(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}},{key:"setSort",value:function(e,t){var i=this,n=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,n.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=n,this.dispatch("sort-changed")}},{key:"clear",value:function(){this.setSort([])}},{key:"findSorter",value:function(t){var i,n=this.table.rowManager.activeRows[0],o="string";if(n&&(n=n.getData(),t.getField()))switch(e(i=t.getFieldValue(n))){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(i)||""===i?i.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return s.sorters[o]}},{key:"sort",value:function(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,n.push(e)),t.setColumnHeader(e.column,e.dir))})),n.length&&t._sortItems(e,n)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}},{key:"clearColumnHeaders",value:function(){var e=this;this.table.columnManager.getRealColumns().forEach((function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"),e.setColumnHeaderSortIcon(t,"none"))}))}},{key:"setColumnHeader",value:function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}},{key:"setColumnHeaderSortIcon",value:function(t,i){var n,o=t.modules.sort.element;if(t.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;o.firstChild;)o.removeChild(o.firstChild);"object"===e(n=this.table.options.headerSortElement.call(this.table,t.getComponent(),i))?o.appendChild(n):o.innerHTML=n}}},{key:"_sortItems",value:function(e,t){var i=this,n=t.length-1;e.sort((function(e,o){for(var a,s=n;s>=0;s--){var r=t[s];if(0!==(a=i._sortRow(e,o,r.column,r.dir,r.params)))break}return a}))}},{key:"_sortRow",value:function(e,t,i,n,o){var a,s,r="asc"==n?e:t,l="asc"==n?t:e;return e=void 0!==(e=i.getFieldValue(r.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",a=r.getComponent(),s=l.getComponent(),i.modules.sort.sorter.call(this,e,t,a,s,i.getComponent(),n,o)}}]),s}(N);Ze.moduleName="sort",Ze.sorters=$e;var Qe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).tooltipSubscriber=null,n.headerSubscriber=null,n.timeout=null,n.popupInstance=null,n.registerTableOption("tooltipGenerationMode",void 0),n.registerTableOption("tooltipDelay",300),n.registerColumnOption("tooltip"),n.registerColumnOption("headerTooltip"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}},{key:"initializeColumn",value:function(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}},{key:"mousemoveCheck",value:function(e,t,i){var n="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;n&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,n),this.table.options.tooltipDelay))}},{key:"mouseoutCheck",value:function(e,t,i){this.popupInstance||this.clearPopup()}},{key:"clearPopup",value:function(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}},{key:"loadTooltip",value:function(e,t,i){var n,o,a,s=this;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?n=i:(n=document.createElement("div"),!0===i&&(t instanceof y?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(function(e){n.innerHTML=i=e||t.definition.title})):i=t.definition.title),n.innerHTML=i),(i||0===i||!1===i)&&(n.classList.add("tabulator-tooltip"),n.addEventListener("mousemove",(function(e){return e.preventDefault()})),this.popupInstance=this.popup(n),"function"==typeof o&&this.popupInstance.renderCallback(o),a=this.popupInstance.containerEventCoords(e),this.popupInstance.show(a.x+15,a.y+15).hideOnBlur((function(){s.dispatchExternal("TooltipClosed",t.getComponent()),s.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}]),a}(N);Qe.moduleName="tooltip";var et={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var n=!0,o=e.getData(),a=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==a.getFieldValue(i)&&(n=!1)})),n},required:function(e,t,i){return""!==t&&null!=t}},tt=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).invalidCells=[],i.registerTableOption("validationMode","blocking"),i.registerColumnOption("validator"),i.registerTableFunction("getInvalidCells",i.getInvalidCells.bind(r(i))),i.registerTableFunction("clearCellValidation",i.userClearCellValidation.bind(r(i))),i.registerTableFunction("validate",i.userValidate.bind(r(i))),i.registerComponentFunction("cell","isValid",i.cellIsValid.bind(r(i))),i.registerComponentFunction("cell","clearValidation",i.clearValidation.bind(r(i))),i.registerComponentFunction("cell","validate",i.cellValidate.bind(r(i))),i.registerComponentFunction("column","validate",i.columnValidate.bind(r(i))),i.registerComponentFunction("row","validate",i.rowValidate.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}},{key:"editValidate",value:function(e,t,i){var n=this,o="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==o&&setTimeout((function(){e.getElement().classList.add("tabulator-validation-fail"),n.dispatchExternal("validationFailed",e.getComponent(),t,o)})),o}},{key:"editorClear",value:function(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}},{key:"editedClear",value:function(e){e.modules.validate&&(e.modules.validate.invalid=!1)}},{key:"cellIsValid",value:function(e){return e.modules.validate&&e.modules.validate.invalid||!0}},{key:"cellValidate",value:function(e){return this.validate(e.column.modules.validate,e,e.getValue())}},{key:"columnValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"rowValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"userClearCellValidation",value:function(e){var t=this;e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.clearValidation(e._getSelf())}))}},{key:"userValidate",value:function(e){var t=[];return this.table.rowManager.rows.forEach((function(e){var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.validator&&this.initializeColumn(e)}},{key:"initializeColumn",value:function(e){var t,i=this,n=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){(t=i._extractValidator(e))&&n.push(t)})):(t=this._extractValidator(e.definition.validator))&&n.push(t),e.modules.validate=!!n.length&&n)}},{key:"_extractValidator",value:function(t){var i,n,o;switch(e(t)){case"string":return(o=t.indexOf(":"))>-1?(i=t.substring(0,o),n=t.substring(o+1)):i=t,this._buildValidator(i,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}},{key:"_buildValidator",value:function(e,t){var i="function"==typeof e?e:s.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}},{key:"validate",value:function(e,t,i){var n=this,o=[],a=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(n,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==a&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),a>-1&&this.invalidCells.splice(a,1)),!o.length||o}},{key:"getInvalidCells",value:function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"clearValidation",value:function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}]),s}(N);tt.moduleName="validate",tt.validators=et;var it=Object.freeze({__proto__:null,AccessorModule:$,AjaxModule:ne,ClipboardModule:oe,ColumnCalcsModule:re,DataTreeModule:le,DownloadModule:ce,EditModule:pe,ExportModule:ve,FilterModule:ye,FormatModule:Ce,FrozenColumnsModule:ke,FrozenRowsModule:Ee,GroupRowsModule:Te,HistoryModule:Me,HtmlTableImportModule:Le,ImportModule:De,InteractionModule:Pe,KeybindingsModule:ze,MenuModule:Fe,MoveColumnsModule:He,MoveRowsModule:Oe,MutatorModule:Ae,PageModule:Be,PersistenceModule:Ne,PopupModule:We,PrintModule:je,ReactiveDataModule:Ge,ResizeColumnsModule:Ue,ResizeRowsModule:Xe,ResizeTableModule:qe,ResponsiveLayoutModule:Ke,SelectRowModule:Je,SortModule:Ze,TooltipModule:Qe,ValidateModule:tt}),nt=function(e){o(n,e);var i=u(n);function n(){return t(this,n),i.apply(this,arguments)}return n}(Y);return new K(nt,it),nt})); +/* Tabulator v5.3.4 (c) Oliver Folkerd 2022 */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Tabulator=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,r=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return s=e.done,e},e:function(e){r=!0,a=e},f:function(){try{s||null==i.return||i.return()}finally{if(r)throw a}}}}var f=function(){function e(i){t(this,e),this.table=i}return n(e,[{key:"reloadData",value:function(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}},{key:"langText",value:function(){var e;return(e=this.table.modules.localize).getText.apply(e,arguments)}},{key:"langBind",value:function(){var e;return(e=this.table.modules.localize).bind.apply(e,arguments)}},{key:"langLocale",value:function(){var e;return(e=this.table.modules.localize).getLocale.apply(e,arguments)}},{key:"commsConnections",value:function(){var e;return(e=this.table.modules.comms).getConnections.apply(e,arguments)}},{key:"commsSend",value:function(){var e;return(e=this.table.modules.comms).send.apply(e,arguments)}},{key:"layoutMode",value:function(){return this.table.modules.layout.getMode()}},{key:"layoutRefresh",value:function(e){return this.table.modules.layout.layout(e)}},{key:"subscribe",value:function(){var e;return(e=this.table.eventBus).subscribe.apply(e,arguments)}},{key:"unsubscribe",value:function(){var e;return(e=this.table.eventBus).unsubscribe.apply(e,arguments)}},{key:"subscribed",value:function(e){return this.table.eventBus.subscribed(e)}},{key:"subscriptionChange",value:function(){var e;return(e=this.table.eventBus).subscriptionChange.apply(e,arguments)}},{key:"dispatch",value:function(){var e;return(e=this.table.eventBus).dispatch.apply(e,arguments)}},{key:"chain",value:function(){var e;return(e=this.table.eventBus).chain.apply(e,arguments)}},{key:"confirm",value:function(){var e;return(e=this.table.eventBus).confirm.apply(e,arguments)}},{key:"dispatchExternal",value:function(){var e;return(e=this.table.externalEvents).dispatch.apply(e,arguments)}},{key:"subscribedExternal",value:function(e){return this.table.externalEvents.subscribed(e)}},{key:"subscriptionChangeExternal",value:function(){var e;return(e=this.table.externalEvents).subscriptionChange.apply(e,arguments)}},{key:"options",value:function(e){return this.table.options[e]}},{key:"setOption",value:function(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}},{key:"deprecationCheck",value:function(e,t){return this.table.deprecationAdvisor.check(e,t)}},{key:"deprecationCheckMsg",value:function(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}},{key:"deprecationMsg",value:function(e){return this.table.deprecationAdvisor.msg(e)}},{key:"module",value:function(e){return this.table.module(e)}}]),e}(),g=function(){function e(i){return t(this,e),this._column=i,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}return n(e,[{key:"getElement",value:function(){return this._column.getElement()}},{key:"getDefinition",value:function(){return this._column.getDefinition()}},{key:"getField",value:function(){return this._column.getField()}},{key:"getTitleDownload",value:function(){return this._column.getTitleDownload()}},{key:"getCells",value:function(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"isVisible",value:function(){return this._column.visible}},{key:"show",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}},{key:"hide",value:function(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}},{key:"toggle",value:function(){this._column.visible?this.hide():this.show()}},{key:"delete",value:function(){return this._column.delete()}},{key:"getSubColumns",value:function(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}},{key:"getParentColumn",value:function(){return this._column.parent instanceof w&&this._column.parent.getComponent()}},{key:"_getSelf",value:function(){return this._column}},{key:"scrollTo",value:function(){return this._column.table.columnManager.scrollToColumn(this._column)}},{key:"getTable",value:function(){return this._column.table}},{key:"move",value:function(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}},{key:"getNextColumn",value:function(){var e=this._column.nextColumn();return!!e&&e.getComponent()}},{key:"getPrevColumn",value:function(){var e=this._column.prevColumn();return!!e&&e.getComponent()}},{key:"updateDefinition",value:function(e){return this._column.updateDefinition(e)}},{key:"getWidth",value:function(){return this._column.getWidth()}},{key:"setWidth",value:function(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}]),e}(),v={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0},b=function(){function e(i){return t(this,e),this._cell=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}return n(e,[{key:"getValue",value:function(){return this._cell.getValue()}},{key:"getOldValue",value:function(){return this._cell.getOldValue()}},{key:"getInitialValue",value:function(){return this._cell.initialValue}},{key:"getElement",value:function(){return this._cell.getElement()}},{key:"getRow",value:function(){return this._cell.row.getComponent()}},{key:"getData",value:function(){return this._cell.row.getData()}},{key:"getField",value:function(){return this._cell.column.getField()}},{key:"getColumn",value:function(){return this._cell.column.getComponent()}},{key:"setValue",value:function(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}},{key:"restoreOldValue",value:function(){this._cell.setValueActual(this._cell.getOldValue())}},{key:"restoreInitialValue",value:function(){this._cell.setValueActual(this._cell.initialValue)}},{key:"checkHeight",value:function(){this._cell.checkHeight()}},{key:"getTable",value:function(){return this._cell.table}},{key:"_getSelf",value:function(){return this._cell}}]),e}(),y=function(i){o(s,i);var a=u(s);function s(e,i){var n;return t(this,s),(n=a.call(this,e.table)).table=e.table,n.column=e,n.row=i,n.element=null,n.value=null,n.initialValue,n.oldValue=null,n.modules={},n.height=null,n.width=null,n.minWidth=null,n.component=null,n.loaded=!1,n.build(),n}return n(s,[{key:"build",value:function(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}},{key:"generateElement",value:function(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}},{key:"_configureCell",value:function(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((function(t){e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}},{key:"_generateContents",value:function(){var t,i=this;switch(e(t=this.chain("cell-format",this,null,(function(){return i.element.innerHTML=i.value})))){case"object":if(t instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else this.element.innerHTML="",null!=t&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}},{key:"cellRendered",value:function(){this.dispatch("cell-rendered",this)}},{key:"getElement",value:function(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}},{key:"getValue",value:function(){return this.value}},{key:"getOldValue",value:function(){return this.oldValue}},{key:"setValue",value:function(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}},{key:"setValueProcessData",value:function(e,t,i){var n=!1;return(this.value!==e||i)&&(n=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),n&&this.dispatch("cell-value-changed",this),n}},{key:"setValueActual",value:function(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}},{key:"layoutElement",value:function(){this._generateContents(),this.dispatch("cell-layout",this)}},{key:"setWidth",value:function(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}},{key:"clearWidth",value:function(){this.width="",this.element.style.width=""}},{key:"getWidth",value:function(){return this.width||this.element.offsetWidth}},{key:"setMinWidth",value:function(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}},{key:"setMaxWidth",value:function(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}},{key:"checkHeight",value:function(){this.row.reinitializeHeight()}},{key:"clearHeight",value:function(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}},{key:"setHeight",value:function(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}},{key:"getHeight",value:function(){return this.height||this.element.offsetHeight}},{key:"show",value:function(){this.element.style.display=this.column.vertAlign?"inline-flex":""}},{key:"hide",value:function(){this.element.style.display="none"}},{key:"delete",value:function(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}},{key:"getIndex",value:function(){return this.row.getCellIndex(this)}},{key:"getComponent",value:function(){return this.component||(this.component=new b(this)),this.component}}]),s}(f),w=function(i){o(s,i);var a=u(s);function s(e,i){var n;return t(this,s),(n=a.call(this,i.table)).definition=e,n.parent=i,n.type="column",n.columns=[],n.cells=[],n.element=n.createElement(),n.contentElement=!1,n.titleHolderElement=!1,n.titleElement=!1,n.groupElement=n.createGroupElement(),n.isGroup=!1,n.hozAlign="",n.vertAlign="",n.field="",n.fieldStructure="",n.getFieldValue="",n.setFieldValue="",n.titleDownload=null,n.titleFormatterRendered=!1,n.mapDefinitions(),n.setField(n.definition.field),n.modules={},n.width=null,n.widthStyled="",n.maxWidth=null,n.maxWidthStyled="",n.maxInitialWidth=null,n.minWidth=null,n.minWidthStyled="",n.widthFixed=!1,n.visible=!0,n.component=null,n.definition.columns?(n.isGroup=!0,n.definition.columns.forEach((function(e,t){var i=new s(e,r(n));n.attachColumn(i)})),n.checkColumnVisibility()):i.registerColumnField(r(n)),n._initialize(),n}return n(s,[{key:"createElement",value:function(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}},{key:"createGroupElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}},{key:"mapDefinitions",value:function(){var e=this.table.options.columnDefaults;if(e)for(var t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(s.defaultOptionList,this.definition)}},{key:"checkDefinition",value:function(){var e=this;Object.keys(this.definition).forEach((function(t){-1===s.defaultOptionList.indexOf(t)&&console.warn("Invalid column definition option in '"+(e.field||e.definition.title)+"' column:",t)}))}},{key:"setField",value:function(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}},{key:"registerColumnPosition",value:function(e){this.parent.registerColumnPosition(e)}},{key:"registerColumnField",value:function(e){this.parent.registerColumnField(e)}},{key:"reRegisterPosition",value:function(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}},{key:"_initialize",value:function(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}},{key:"_buildColumnHeader",value:function(){var e=this,t=this.definition;(this.dispatch("column-layout",this),void 0!==t.visible&&(t.visible?this.show(!0):this.hide(!0)),t.cssClass)&&t.cssClass.split(" ").forEach((function(t){e.element.classList.add(t)}));t.field&&this.element.setAttribute("tabulator-field",t.field),this.setMinWidth(parseInt(t.minWidth)),t.maxInitialWidth&&(this.maxInitialWidth=parseInt(t.maxInitialWidth)),t.maxWidth&&this.setMaxWidth(parseInt(t.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}},{key:"_buildColumnHeaderContent",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}},{key:"_buildColumnHeaderTitle",value:function(){var e=this,t=this.definition,i=document.createElement("div");if(i.classList.add("tabulator-col-title"),t.editableTitle){var n=document.createElement("input");n.classList.add("tabulator-title-editor"),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("change",(function(){t.title=n.value,e.dispatchExternal("columnTitleChanged",e.getComponent())})),i.appendChild(n),t.field?this.langBind("columns|"+t.field,(function(e){n.value=e||t.title||" "})):n.value=t.title||" "}else t.field?this.langBind("columns|"+t.field,(function(n){e._formatColumnHeaderTitle(i,n||t.title||" ")})):this._formatColumnHeaderTitle(i,t.title||" ");return i}},{key:"_formatColumnHeaderTitle",value:function(t,i){var n=this.chain("column-format",[this,i,t],null,(function(){return i}));switch(e(n)){case"object":n instanceof Node?t.appendChild(n):(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:",n));break;case"undefined":t.innerHTML="";break;default:t.innerHTML=n}}},{key:"_buildGroupHeader",value:function(){var e=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(t){e.element.classList.add(t)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}},{key:"_getFlatData",value:function(e){return e[this.field]}},{key:"_getNestedData",value:function(e){for(var t,i=e,n=this.fieldStructure,o=n.length,a=0;a-1&&this.columns.splice(t,1),this.columns.length||this.delete()}},{key:"setWidth",value:function(e){this.widthFixed=!0,this.setWidthActual(e)}},{key:"setWidthActual",value:function(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}},{key:"checkCellHeights",value:function(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}},{key:"getWidth",value:function(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}},{key:"getHeight",value:function(){return Math.ceil(this.element.getBoundingClientRect().height)}},{key:"setMinWidth",value:function(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}},{key:"setMaxWidth",value:function(e){this.minWidth&&e-1&&this._nextVisibleColumn(e+1)}},{key:"_nextVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}},{key:"prevColumn",value:function(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}},{key:"_prevVisibleColumn",value:function(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}},{key:"reinitializeWidth",value:function(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}},{key:"fitToData",value:function(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((function(e){e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((function(e){var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}},{key:"updateDefinition",value:function(e){var t,i=this;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((function(e){return t.field==i.field&&(i.field=!1),i.delete().then((function(){return e.getComponent()}))})))}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"getComponent",value:function(){return this.component||(this.component=new g(this)),this.component}}]),s}(f);w.defaultOptionList=v;var C=function(){function i(){t(this,i)}return n(i,null,[{key:"elVisible",value:function(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}},{key:"elOffset",value:function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}},{key:"deepClone",value:function(t,i){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a={}.__proto__,s=[].__proto__;i||(i=Object.assign(Array.isArray(t)?[]:{},t));var r=function(){var r=t[l],u=void 0,c=void 0;null==r||"object"!==e(r)||r.__proto__!==a&&r.__proto__!==s||((u=o.findIndex((function(e){return e.subject===r})))>-1?i[l]=o[u].copy:(c=Object.assign(Array.isArray(r)?[]:{},r),o.unshift({subject:r,copy:c}),i[l]=n.deepClone(r,c,o)))};for(var l in t)r();return i}}]),i}(),k=function(){function i(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this,i),this.table=e,this.msgType=n,this.registeredDefaults=Object.assign({},o)}return n(i,[{key:"register",value:function(e,t){this.registeredDefaults[e]=t}},{key:"generate",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},this.registeredDefaults);if(Object.assign(n,t),!1!==i.debugInvalidOptions||this.table.options.debugInvalidOptions)for(var o in i)n.hasOwnProperty(o)||console.warn("Invalid "+this.msgType+" option:",o);for(var a in n)a in i?n[a]=i[a]:Array.isArray(n[a])?n[a]=Object.assign([],n[a]):"object"===e(n[a])&&null!==n[a]?n[a]=Object.assign({},n[a]):void 0===n[a]&&delete n[a];return n}}]),i}(),E=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).elementVertical=e.rowManager.element,n.elementHorizontal=e.columnManager.element,n.tableElement=e.rowManager.tableElement,n.verticalFillMode="fit",n}return n(a,[{key:"initialize",value:function(){}},{key:"clearRows",value:function(){}},{key:"clearColumns",value:function(){}},{key:"reinitializeColumnWidths",value:function(e){}},{key:"renderRows",value:function(){}},{key:"renderColumns",value:function(){}},{key:"rerenderRows",value:function(e){e&&e()}},{key:"rerenderColumns",value:function(e,t){}},{key:"renderRowCells",value:function(e){}},{key:"rerenderRowCells",value:function(e,t){}},{key:"scrollColumns",value:function(e,t){}},{key:"scrollRows",value:function(e,t){}},{key:"resize",value:function(){}},{key:"scrollToRow",value:function(e){}},{key:"scrollToRowNearestTop",value:function(e){}},{key:"visibleRows",value:function(e){return[]}},{key:"rows",value:function(){return this.table.rowManager.getDisplayRows()}},{key:"styleRow",value:function(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}},{key:"clear",value:function(){this.clearRows(),this.clearColumns()}},{key:"render",value:function(){this.renderRows(),this.renderColumns()}},{key:"rerender",value:function(e){this.rerenderRows(),this.rerenderColumns()}},{key:"scrollToRowPosition",value:function(e,t,i){var n=this,o=this.rows().indexOf(e),a=e.getElement(),s=0;return new Promise((function(r,l){if(o>-1){if(void 0===i&&(i=n.table.options.scrollToRowIfVisible),!i&&C.elVisible(a)&&(s=C.elOffset(a).top-C.elOffset(n.elementVertical).top)>0&&se&&(e=i)}})),this.windowBuffer=2*e}},{key:"rerenderColumns",value:function(e,t){var i=this,n={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},o=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((function(e){var t={};if(e.visible){var n=e.getWidth();t.leftPos=o,t.rightPos=o+n,t.width=n,i.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),o+n>i.vDomScrollPosLeft&&othis.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}},{key:"colPositionAdjust",value:function(e,t,i){for(var n=e;n=e.columns.length-1?e.vDomPadRight=0:e.vDomPadRight-=n.getWidth()):i=!1};i;)n();t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"addColLeft",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.leftCol-1];if(n)if(n.modules.vdomHoz.rightPos>=e.vDomScrollPosLeft){t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(n);e.getElement().prepend(t.getElement()),t.cellRendered()}})),e.leftCol--,e.leftCol<=0?e.vDomPadLeft=0:e.vDomPadLeft-=n.getWidth();var o=e.fitDataColActualWidthCheck(n);o&&(e.scrollLeft=e.elementVertical.scrollLeft=e.elementVertical.scrollLeft+o,e.vDomPadRight-=o)}else i=!1;else i=!1};i;)n();t&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}},{key:"removeColRight",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.rightCol];n&&n.modules.vdomHoz.leftPos>e.vDomScrollPosRight?(t=!0,e.getVisibleRows().forEach((function(e){if("group"!==e.type){var t=e.getCell(n);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),e.vDomPadRight+=n.getWidth(),e.rightCol--):i=!1};i;)n();t&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}},{key:"removeColLeft",value:function(){for(var e=this,t=!1,i=!0,n=function(){var n=e.columns[e.leftCol];n&&n.modules.vdomHoz.rightPosi?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}},{key:"generateColumnsFromRowData",value:function(t){var i,n,o=[],a=this.table.options.autoColumnsDefinitions;if(t&&t.length){for(var s in i=t[0]){var r={field:s,title:s},l=i[s];switch(e(l)){case"undefined":n="string";break;case"boolean":n="boolean";break;case"object":n=Array.isArray(l)?"array":"string";break;default:n=isNaN(l)||""===l?l.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}r.sorter=n,o.push(r)}if(a)switch(e(a)){case"function":this.table.options.columns=a.call(this.table,o);break;case"object":Array.isArray(a)?o.forEach((function(e){var t=a.find((function(t){return t.field===e.field}));t&&Object.assign(e,t)})):o.forEach((function(e){a[e.field]&&Object.assign(e,a[e.field])})),this.table.options.columns=o}else this.table.options.columns=o;this.setColumns(this.table.options.columns)}}},{key:"setColumns",value:function(e,t){for(var i=this;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach((function(e,t){i._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}},{key:"_addColumn",value:function(e,t,i){var n=new w(e,this),o=n.getElement(),a=i?this.findColumnIndex(i):i;if(i&&a>-1){var s=i.getTopColumn(),r=this.columns.indexOf(s),l=s.getElement();t?(this.columns.splice(r,0,n),l.parentNode.insertBefore(o,l)):(this.columns.splice(r+1,0,n),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(n),this.headersElement.insertBefore(n.getElement(),this.headersElement.firstChild)):(this.columns.push(n),this.headersElement.appendChild(n.getElement()));return n.columnRendered(),n}},{key:"registerColumnField",value:function(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}},{key:"registerColumnPosition",value:function(e){this.columnsByIndex.push(e)}},{key:"_reIndexColumns",value:function(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}},{key:"verticalAlignHeaders",value:function(){var e=this,t=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach((function(e){e.clearVerticalAlign()})),this.columns.forEach((function(e){var i=e.getHeight();i>t&&(t=i)})),this.headersElement.style.height=t+"px",this.columns.forEach((function(i){i.verticalAlign(e.table.options.columnHeaderVertAlign,t)})),this.table.rowManager.adjustTableSize())}},{key:"findColumn",value:function(t){var i;return"object"!=e(t)?this.columnsByField[t]||!1:t instanceof w?t:t instanceof g?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&(i=[],this.columns.forEach((function(e){i.push(e),i=i.concat(e.getColumns(!0))})),i.find((function(e){return e.element===t}))||!1)}},{key:"getColumnByField",value:function(e){return this.columnsByField[e]}},{key:"getColumnsByFieldRoot",value:function(e){var t=this,i=[];return Object.keys(this.columnsByField).forEach((function(n){n.split(".")[0]===e&&i.push(t.columnsByField[n])})),i}},{key:"getColumnByIndex",value:function(e){return this.columnsByIndex[e]}},{key:"getFirstVisibleColumn",value:function(){var e=this.columnsByIndex.findIndex((function(e){return e.visible}));return e>-1&&this.columnsByIndex[e]}},{key:"getColumns",value:function(){return this.columns}},{key:"findColumnIndex",value:function(e){return this.columnsByIndex.findIndex((function(t){return e===t}))}},{key:"getRealColumns",value:function(){return this.columnsByIndex}},{key:"traverse",value:function(e){this.columnsByIndex.forEach((function(t,i){e(t,i)}))}},{key:"getDefinitions",value:function(e){var t=[];return this.columnsByIndex.forEach((function(i){(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}},{key:"getDefinitionTree",value:function(){var e=[];return this.columns.forEach((function(t){e.push(t.getDefinition(!0))})),e}},{key:"getComponents",value:function(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getWidth",value:function(){var e=0;return this.columnsByIndex.forEach((function(t){t.visible&&(e+=t.getWidth())})),e}},{key:"moveColumn",value:function(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}},{key:"moveColumnActual",value:function(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}},{key:"_moveColumnInArray",value:function(e,t,i,n,o){var a,s=e.indexOf(t);s>-1&&(e.splice(s,1),(a=e.indexOf(i))>-1?n&&(a+=1):a=s,e.splice(a,0,t),o&&(this.chain("column-moving-rows",[t,i,n],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(s,1)[0];e.cells.splice(a,0,t)}})))}},{key:"scrollToColumn",value:function(e,t,i){var n=this,o=0,a=0,s=0,r=e.getElement();return new Promise((function(l,u){if(void 0===t&&(t=n.table.options.scrollToColumnPosition),void 0===i&&(i=n.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":s=-n.element.clientWidth/2;break;case"right":s=r.clientWidth-n.headersElement.clientWidth}if(!i&&(a=r.offsetLeft)>0&&a+r.offsetWidththis.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var n,o,a;i.visible&&(n=i.definition.width||0,o=parseInt(i.minWidth),a="string"==typeof n?n.indexOf("%")>-1?e/100*parseInt(n):parseInt(n):n,t+=a>o?a:o)})),t}},{key:"addColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var s=n._addColumn(e,t,i);n._reIndexColumns(),n.dispatch("column-add",e,t,i),"fitColumns"!=n.layoutMode()&&s.reinitializeWidth(),n.redraw(!0),n.table.rowManager.reinitialize(),n.rerenderColumns(),o(s)}))}},{key:"deregisterColumn",value:function(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}},{key:"rerenderColumns",value:function(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}},{key:"blockRedraw",value:function(){this.redrawBlock=!0,this.redrawBlockUpdate=null}},{key:"restoreRedraw",value:function(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}},{key:"redraw",value:function(e){C.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}]),s}(f),M=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return n(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"getIndex",value:function(){return this._row.getData("data")[this._row.table.options.index]}},{key:"getPosition",value:function(){return this._row.getPosition()}},{key:"watchPosition",value:function(e){return this._row.watchPosition(e)}},{key:"delete",value:function(){return this._row.delete()}},{key:"scrollTo",value:function(){return this._row.table.rowManager.scrollToRow(this._row)}},{key:"move",value:function(e,t){this._row.moveToRow(e,t)}},{key:"update",value:function(e){return this._row.updateData(e)}},{key:"normalizeHeight",value:function(){this._row.normalizeHeight(!0)}},{key:"_getSelf",value:function(){return this._row}},{key:"reformat",value:function(){return this._row.reinitialize()}},{key:"getTable",value:function(){return this._row.table}},{key:"getNextRow",value:function(){var e=this._row.nextRow();return e?e.getComponent():e}},{key:"getPrevRow",value:function(){var e=this._row.prevRow();return e?e.getComponent():e}}]),e}(),L=function(e){o(a,e);var i=u(a);function a(e,n){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"row";return t(this,a),(o=i.call(this,n.table)).parent=n,o.data={},o.type=s,o.element=!1,o.modules={},o.cells=[],o.height=0,o.heightStyled="",o.manualHeight=!1,o.outerHeight=0,o.initialized=!1,o.heightInitialized=!1,o.position=0,o.positionWatchers=[],o.component=null,o.created=!1,o.setData(e),o}return n(a,[{key:"create",value:function(){this.created||(this.created=!0,this.generateElement())}},{key:"createElement",value:function(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}},{key:"getElement",value:function(){return this.create(),this.element}},{key:"detachElement",value:function(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}},{key:"generateElement",value:function(){this.createElement(),this.dispatch("row-init",this)}},{key:"generateCells",value:function(){this.cells=this.table.columnManager.generateCells(this)}},{key:"initialize",value:function(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}},{key:"reinitializeHeight",value:function(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}},{key:"deinitialize",value:function(){this.initialized=!1}},{key:"deinitializeHeight",value:function(){this.heightInitialized=!1}},{key:"reinitialize",value:function(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}},{key:"calcHeight",value:function(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}},{key:"setCellHeight",value:function(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}},{key:"clearCellHeight",value:function(){this.cells.forEach((function(e){e.clearHeight()}))}},{key:"normalizeHeight",value:function(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}},{key:"setHeight",value:function(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}},{key:"getHeight",value:function(){return this.outerHeight}},{key:"getWidth",value:function(){return this.element.offsetWidth}},{key:"deleteCell",value:function(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}},{key:"setData",value:function(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}},{key:"updateData",value:function(e){var t,i=this,n=this.element&&C.elVisible(this.element),o={};return new Promise((function(a,s){for(var r in"string"==typeof e&&(e=JSON.parse(e)),i.dispatch("row-data-save-before",i),i.subscribed("row-data-changing")&&(o=Object.assign(o,i.data),o=Object.assign(o,e)),t=i.chain("row-data-changing",[i,o,e],null,e))i.data[r]=t[r];for(var l in i.dispatch("row-data-save-after",i),e){i.table.columnManager.getColumnsByFieldRoot(l).forEach((function(e){var o=i.getCell(e.getField());if(o){var a=e.getFieldValue(t);o.getValue()!=a&&(o.setValueProcessData(a),n&&o.cellRendered())}}))}n?(i.normalizeHeight(!0),i.table.options.rowFormatter&&i.table.options.rowFormatter(i.getComponent())):(i.initialized=!1,i.height=0,i.heightStyled=""),i.dispatch("row-data-changed",i,n,e),i.dispatchExternal("rowUpdated",i.getComponent()),i.subscribedExternal("dataChanged")&&i.dispatchExternal("dataChanged",i.table.rowManager.getData()),a()}))}},{key:"getData",value:function(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}},{key:"getCell",value:function(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}},{key:"getCellIndex",value:function(e){return this.cells.findIndex((function(t){return t===e}))}},{key:"findCell",value:function(e){return this.cells.find((function(t){return t.element===e}))}},{key:"getCells",value:function(){return this.initialized||this.generateCells(),this.cells}},{key:"nextRow",value:function(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}},{key:"prevRow",value:function(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}},{key:"moveToRow",value:function(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}},{key:"delete",value:function(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}},{key:"deleteActual",value:function(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}},{key:"detachModules",value:function(){this.dispatch("row-deleting",this)}},{key:"deleteCells",value:function(){for(var e=this.cells.length,t=0;tMath.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-t))}},{key:"scrollToRow",value:function(e){var t=e.getElement();this.elementVertical.scrollTop=C.elOffset(t).top-C.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}},{key:"visibleRows",value:function(e){return this.rows()}}]),a}(E),D=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).verticalFillMode="fill",n.scrollTop=0,n.scrollLeft=0,n.vDomRowHeight=20,n.vDomTop=0,n.vDomBottom=0,n.vDomScrollPosTop=0,n.vDomScrollPosBottom=0,n.vDomTopPad=0,n.vDomBottomPad=0,n.vDomMaxRenderChain=90,n.vDomWindowBuffer=0,n.vDomWindowMinTotalRows=20,n.vDomWindowMinMarginRows=5,n.vDomTopNewRows=[],n.vDomBottomNewRows=[],n}return n(a,[{key:"clearRows",value:function(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}},{key:"renderRows",value:function(){this._virtualRenderFill()}},{key:"rerenderRows",value:function(e){for(var t=this.elementVertical.scrollTop,i=!1,n=!1,o=this.table.rowManager.scrollLeft,a=this.rows(),s=this.vDomTop;s<=this.vDomBottom;s++)if(a[s]){var r=t-a[s].getElement().offsetTop;if(!(!1===n||Math.abs(r)o||n>o){var s=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*a.length)),this.scrollColumns(s)}else t?(i<0&&this._addTopRow(a,-i),n<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(a,-n):this.vDomScrollPosBottom=this.scrollTop)):(n>=0&&this._addBottomRow(a,n),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(a,i):this.vDomScrollPosTop=this.scrollTop))}},{key:"resize",value:function(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}},{key:"scrollToRowNearestTop",value:function(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}},{key:"scrollToRow",value:function(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}},{key:"visibleRows",value:function(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,n=!1,o=0,a=0,s=this.rows();if(e)o=this.vDomTop,a=this.vDomBottom;else for(var r=this.vDomTop;r<=this.vDomBottom;r++)if(s[r])if(n){if(!(i-s[r].getElement().offsetTop>=0))break;a=r}else if(t-s[r].getElement().offsetTop>=0)o=r;else{if(n=!0,!(i-s[r].getElement().offsetTop>=0))break;a=r}return s.slice(o,a+1)}},{key:"_virtualRenderFill",value:function(e,t,i){var n=this.tableElement,o=this.elementVertical,a=0,s=0,r=0,l=0,u=0,c=this.rows(),h=c.length,d=this.elementVertical.clientHeight;if(i=i||0,e=e||0){for(;n.firstChild;)n.removeChild(n.firstChild);(r=(h-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*m),this.vDomBottom++,u++}e?(this.vDomTopPad=t?this.vDomRowHeight*this.vDomTop+i:this.scrollTop-l,this.vDomBottomPad=this.vDomBottom==h-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-s-l,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((s+l)/u),this.vDomBottomPad=this.vDomRowHeight*(h-this.vDomBottom-1),this.vDomScrollHeight=l+s+this.vDomBottomPad-d),n.style.paddingTop=this.vDomTopPad+"px",n.style.paddingBottom=this.vDomBottomPad+"px",t&&(this.scrollTop=this.vDomTopPad+l+i-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-d:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-d),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&t&&(this.scrollTop+=this.elementVertical.offsetHeight-d),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,o.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}},{key:"_addTopRow",value:function(e,t){for(var i=this.tableElement,n=[],o=0,a=this.vDomTop-1,s=0,r=!0;r;)if(this.vDomTop){var l=e[a],u=void 0,c=void 0;l&&s=u?(this.styleRow(l,a),i.insertBefore(l.getElement(),i.firstChild),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),c||(u=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*u),t-=u,o+=u,this.vDomTop--,a--,s++):r=!1):r=!1}else r=!1;for(var h=0,d=n;h=(r=s.getHeight()||this.vDomRowHeight)?(this.vDomTop++,t-=r,n+=r,i.push(s),o++):a=!1}for(var l=0,u=i;l=u?(this.styleRow(l,a),i.appendChild(l.getElement()),l.initialized&&l.heightInitialized||n.push(l),l.initialize(),c||(u=l.getElement().offsetHeight)>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*u),t-=u,o+=u,this.vDomBottom++,a++,s++):r=!1):r=!1}for(var h=0,d=n;h=(r=s.getHeight()||this.vDomRowHeight)?(this.vDomBottom--,t-=r,n+=r,i.push(s),o++):a=!1}for(var l=0,u=i;lt,n=e.element.scrollTop,o=e.scrollTop>n;e.scrollLeft!=t&&(e.scrollLeft=t,e.dispatch("scroll-horizontal",t,i),e.dispatchExternal("scrollHorizontal",t,i),e._positionPlaceholder()),e.scrollTop!=n&&(e.scrollTop=n,e.renderer.scrollRows(n,o),e.dispatch("scroll-vertical",n,o),e.dispatchExternal("scrollVertical",n,o))}))}},{key:"findRow",value:function(t){var i=this;return"object"!=e(t)?void 0!==t&&(this.rows.find((function(e){return e.data[i.table.options.index]==t}))||!1):t instanceof L?t:t instanceof M?t._getSelf()||!1:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&this.rows.find((function(e){return e.getElement()===t}))||!1}},{key:"getRowFromDataObject",value:function(e){return this.rows.find((function(t){return t.data===e}))||!1}},{key:"getRowFromPosition",value:function(e){return this.getDisplayRows().find((function(t){return t.getPosition()===e&&t.isDisplayed()}))}},{key:"scrollToRow",value:function(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}},{key:"setData",value:function(e,t,i){var n=this;return new Promise((function(o,a){t&&n.getDisplayRows().length?n.table.options.pagination?n._setDataActual(e,!0):n.reRenderInPosition((function(){n._setDataActual(e)})):(n.table.options.autoColumns&&i&&n.table.initialized&&n.table.columnManager.generateColumnsFromRowData(e),n.resetScroll(),n._setDataActual(e)),o()}))}},{key:"_setDataActual",value:function(t,i){var n=this;this.dispatchExternal("dataProcessing",t),this._wipeElements(),Array.isArray(t)?(this.dispatch("data-processing",t),t.forEach((function(t,i){if(t&&"object"===e(t)){var o=new L(t,n);n.rows.push(o)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)})),this.refreshActiveData(!1,!1,i),this.dispatch("data-processed",t),this.dispatchExternal("dataProcessed",t)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",e(t),"\nData: ",t)}},{key:"_wipeElements",value:function(){this.dispatch("rows-wipe"),this.rows.forEach((function(e){e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}},{key:"deleteRow",value:function(e,t){var i=this.rows.indexOf(e),n=this.activeRows.indexOf(e);n>-1&&this.activeRows.splice(n,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((function(t){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}},{key:"addRow",value:function(e,t,i,n){return this.addRowActual(e,t,i,n)}},{key:"addRows",value:function(e,t,i){var n=this,o=[];return new Promise((function(a,s){t=n.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach((function(a,s){var r=n.addRow(a,t,i,!0);o.push(r),n.dispatch("row-added",r,e,t,i)})),n.refreshActiveData(!1,!1,!0),n.regenerateRowPositions(),o.length&&n._clearPlaceholder(),a(o)}))}},{key:"findAddRowPos",value:function(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}},{key:"addRowActual",value:function(e,t,i,n){var o,a,s=e instanceof L?e:new L(e||{},this),r=this.findAddRowPos(t),l=-1;return i||(a=this.chain("row-adding-position",[s,r],null,{index:i,top:r}),i=a.index,r=a.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[s,i,r],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(r?t:t+1,0,s)})),o>-1&&this.activeRows.splice(r?o:o+1,0,s),this.rows.splice(r?l:l+1,0,s)):r?(this.displayRowIterator((function(e){e.unshift(s)})),this.activeRows.unshift(s),this.rows.unshift(s)):(this.displayRowIterator((function(e){e.push(s)})),this.activeRows.push(s),this.rows.push(s)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",s.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),n||this.reRenderInPosition(),s}},{key:"moveRow",value:function(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}},{key:"moveRowActual",value:function(e,t,i){var n=this;this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((function(o){n.moveRowInArray(o,e,t,i)})),this.dispatch("row-moving",e,t,i)}},{key:"moveRowInArray",value:function(e,t,i,n){var o,a,s;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(a=e.indexOf(i))>-1?n?e.splice(a+1,0,t):e.splice(a,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){s=a>o?a:o+1;for(var r=o-1&&t}},{key:"nextDisplayRow",value:function(e,t){var i=this.getDisplayRowIndex(e),n=!1;return!1!==i&&i-1)&&i}},{key:"getData",value:function(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}},{key:"getComponents",value:function(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}},{key:"getDataCount",value:function(e){return this.getRows(e).length}},{key:"scrollHorizontal",value:function(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}},{key:"registerDataPipelineHandler",value:function(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Data pipeline handlers must have a priority in order to be registered")}},{key:"registerDisplayPipelineHandler",value:function(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort((function(e,t){return e.priority-t.priority}))):console.error("Display pipeline handlers must have a priority in order to be registered")}},{key:"refreshActiveData",value:function(e,t,i){var n=this.table,o="",a=0,s=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((a=this.dataPipeline.findIndex((function(t){return t.handler===e})))>-1)o="dataPipeline",t&&(a==this.dataPipeline.length-1?o="display":a++);else{if(!((a=this.displayPipeline.findIndex((function(t){return t.handler===e})))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);o="displayPipeline",t&&(a==this.displayPipeline.length-1?o="end":a++)}else o=e||"all",a=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===o&&a-1&&(n.splice(o,1),a=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),a&&this.updateEventListeners()}},{key:"updateEventListeners",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}},{key:"track",value:function(e,t){var i=t.composedPath&&t.composedPath()||t.path,n=this.findTargets(i);n=this.bindComponents(e,n),this.triggerEvents(e,t,n),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(n).length||this.pseudoMouseLeave("none",t)}},{key:"findTargets",value:function(e){var t,i=this,n={},o=Object.keys(this.componentMap),a=p(e);try{for(a.s();!(t=a.n()).done;){var s=t.value,r=s.classList?h(s.classList):[];if(r.filter((function(e){return i.abortClasses.includes(e)})).length)break;var l,u=p(r.filter((function(e){return o.includes(e)})));try{for(u.s();!(l=u.n()).done;){var c=l.value;n[this.componentMap[c]]||(n[this.componentMap[c]]=s)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){a.e(e)}finally{a.f()}return n.group&&n.group===n.row&&delete n.row,n}},{key:"bindComponents",value:function(e,t){var i,n=this,o=Object.keys(t).reverse(),a=this.listeners[e],s={},r={},l=p(o);try{var u=function(){var e=i.value,o=void 0,l=t[e],u=n.previousTargets[e];if(u&&u.target===l)o=u.component;else switch(e){case"row":case"group":if(a.components.includes("row")||a.components.includes("cell")||a.components.includes("group"))o=n.table.rowManager.getVisibleRows(!0).find((function(e){return e.getElement()===l})),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1);break;case"column":a.components.includes("column")&&(o=n.table.columnManager.findColumn(l));break;case"cell":a.components.includes("cell")&&(s.row instanceof L?o=s.row.findCell(l):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}o&&(s[e]=o,r[e]={target:l,component:o})};for(l.s();!(i=l.n()).done;)u()}catch(e){l.e(e)}finally{l.f()}return this.previousTargets=r,s}},{key:"triggerEvents",value:function(e,t,i){var n=this.listeners[e];for(var o in i)i[o]&&n.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}},{key:"clearWatchers",value:function(){for(var e in this.listeners){var t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}]),a}(f),H=function(){function e(i){t(this,e),this.table=i,this.bindings={}}return n(e,[{key:"bind",value:function(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}},{key:"handle",value:function(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}]),e}(),O=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).requestOrder=0,i.loading=!1,i}return n(s,[{key:"initialize",value:function(){}},{key:"load",value:function(t,i,n,o,a,s){var r=this,l=++this.requestOrder;return this.dispatchExternal("dataLoading",t),!t||0!=t.indexOf("{")&&0!=t.indexOf("[")||(t=JSON.parse(t)),this.confirm("data-loading",[t,i,n,a])?(this.loading=!0,a||this.alertLoader(),i=this.chain("data-params",[t,n,a],i||{},i||{}),i=this.mapParams(i,this.table.options.dataSendParams),this.chain("data-load",[t,i,n,a],!1,Promise.resolve([])).then((function(t){Array.isArray(t)||"object"!=e(t)||(t=r.mapParams(t,r.objectInvert(r.table.options.dataReceiveParams)));var i=r.chain("data-loaded",t,null,t);l==r.requestOrder?(r.clearAlert(),!1!==i&&(r.dispatchExternal("dataLoaded",i),r.table.rowManager.setData(i,o,void 0===s?!o:s))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((function(e){console.error("Data Load Error: ",e),r.dispatchExternal("dataLoadError",e),a||r.alertError(),setTimeout((function(){r.clearAlert()}),r.table.options.dataLoaderErrorTimeout)})).finally((function(){r.loading=!1}))):(this.dispatchExternal("dataLoaded",t),t||(t=[]),this.table.rowManager.setData(t,o,void 0===s?!o:s),Promise.resolve())}},{key:"mapParams",value:function(e,t){var i={};for(var n in e)i[t.hasOwnProperty(n)?t[n]:n]=e[n];return i}},{key:"objectInvert",value:function(e){var t={};for(var i in e)t[e[i]]=i;return t}},{key:"blockActiveLoad",value:function(){this.requestOrder++}},{key:"alertLoader",value:function(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}},{key:"alertError",value:function(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}},{key:"clearAlert",value:function(){this.table.alertManager.clear()}}]),s}(f),A=function(){function e(i,n,o){t(this,e),this.table=i,this.events={},this.optionsList=n||{},this.subscriptionNotifiers={},this.dispatch=o?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=o}return n(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_notifySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e,t=this,i=Array.from(arguments),n=i.shift();return this.events[n]&&this.events[n].forEach((function(n,o){var a=n.apply(t.table,i);o||(e=a)})),e}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="ExternalEvent:"+t[0],!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._dispatch.apply(this,arguments)}}]),e}(),_=function(){function e(i){t(this,e),this.events={},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=i?this._debugChain.bind(this):this._chain.bind(this),this.confirm=i?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=i}return n(e,[{key:"subscriptionChange",value:function(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}},{key:"subscribe",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort((function(e,t){return e.priority-t.priority})),this._notifySubscriptionChange(e,!0)}},{key:"unsubscribe",value:function(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((function(e){return e.callback===t})))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}},{key:"subscribed",value:function(e){return this.events[e]&&this.events[e].length}},{key:"_chain",value:function(e,t,i,n){var o=this,a=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach((function(e,i){a=e.callback.apply(o,t.concat([a]))})),a):"function"==typeof n?n():n}},{key:"_confirm",value:function(e,t){var i=this,n=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach((function(e,o){e.callback.apply(i,t)&&(n=!0)})),n}},{key:"_notifySubscriptionChange",value:function(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((function(e){e(t)}))}},{key:"_dispatch",value:function(){var e=this,t=Array.from(arguments),i=t.shift();this.events[i]&&this.events[i].forEach((function(i){i.callback.apply(e,t)}))}},{key:"_debugDispatch",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._dispatch.apply(this,arguments)}},{key:"_debugChain",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._chain.apply(this,arguments)}},{key:"_debugConfirm",value:function(){var e,t=Array.from(arguments),i=t[0];(t[0]="InternalEvent:"+i,!0===this.debug||this.debug.includes(i))&&(e=console).log.apply(e,h(t));return this._confirm.apply(this,arguments)}}]),e}(),B=function(e){o(a,e);var i=u(a);function a(e){return t(this,a),i.call(this,e)}return n(a,[{key:"_warnUser",value:function(){var e;this.options("debugDeprecation")&&(e=console).warn.apply(e,arguments)}},{key:"check",value:function(e,t){var i="";return void 0===this.options(e)||(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1)}},{key:"checkMsg",value:function(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}},{key:"msg",value:function(e){this._warnUser(e)}}]),a}(f),I=function(){function e(){t(this,e)}return n(e,null,[{key:"register",value:function(t){e.tables.push(t)}},{key:"deregister",value:function(t){var i=e.tables.indexOf(t);i>-1&&e.tables.splice(i,1)}},{key:"lookupTable",value:function(t,i){var n,o,a=[];if("string"==typeof t){if((n=document.querySelectorAll(t)).length)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:this.table.element;return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}},{key:"renderCallback",value:function(e){this.renderedCallback=e}},{key:"containerEventCoords",value:function(e){var t=!(e instanceof MouseEvent),i=t?e.touches[0].pageX:e.pageX,n=t?e.touches[0].pageY:e.pageY;if(this.container!==document.body){var o=C.elOffset(this.container);i-=o.left,n-=o.top}return{x:i,y:n}}},{key:"elementPositionCoords",value:function(e){var t,i,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right",a=C.elOffset(e);switch(this.container!==document.body&&(t=C.elOffset(this.container),a.left-=t.left,a.top-=t.top),o){case"right":i=a.left+e.offsetWidth,n=a.top-1;break;case"bottom":i=a.left,n=a.top+e.offsetHeight}return{x:i,y:n,offset:a}}},{key:"show",value:function(e,t){var i,n,o,a,s;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,a=(s=this.elementPositionCoords(e,t)).offset,i=s.x,n=s.y):"number"==typeof e?(a={top:0,left:0},i=e,n=t):(i=(s=this.containerEventCoords(e)).x,n=s.y,this.reversedX=!1),this.element.style.top=n+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,n,o,a,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(function(e){e.stopPropagation()}))),this}},{key:"_fitToScreen",value:function(e,t,i,n,o){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-n.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}},{key:"isVisible",value:function(){return this.visible}},{key:"hideOnBlur",value:function(e){var t=this;return this.blurable=!0,this.visible&&(setTimeout((function(){t.table.rowManager.element.addEventListener("scroll",t.blurEvent),t.subscribe("cell-editing",t.blurEvent),document.body.addEventListener("click",t.blurEvent),document.body.addEventListener("contextmenu",t.blurEvent),document.body.addEventListener("mousedown",t.blurEvent),window.addEventListener("resize",t.blurEvent),document.body.addEventListener("keydown",t.escEvent)}),100),this.blurCallback=e),this}},{key:"_escapeCheck",value:function(e){27==e.keyCode&&this.hide()}},{key:"blockHide",value:function(){this.hideable=!1}},{key:"restoreHide",value:function(){this.hideable=!0}},{key:"hide",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.visible&&this.hideable&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}},{key:"child",value:function(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new a(this.table,e,this),this.childPopup}}]),a}(f),N=function(e){o(a,e);var i=u(a);function a(e,n){var o;return t(this,a),(o=i.call(this,e))._handler=null,o}return n(a,[{key:"initialize",value:function(){}},{key:"registerTableOption",value:function(e,t){this.table.optionsList.register(e,t)}},{key:"registerColumnOption",value:function(e,t){this.table.columnManager.optionsList.register(e,t)}},{key:"registerTableFunction",value:function(e,t){var i=this;void 0===this.table[e]?this.table[e]=function(){return i.table.initGuard(e),t.apply(void 0,arguments)}:console.warn("Unable to bind table function, name already in use",e)}},{key:"registerComponentFunction",value:function(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}},{key:"registerDataHandler",value:function(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}},{key:"registerDisplayHandler",value:function(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}},{key:"displayRows",value:function(e){var t,i=this,n=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((function(e){return e.handler===i._handler})))>-1&&(n=t),e&&(n+=e),this._handler)return n>-1?this.table.rowManager.getDisplayRows(n):this.activeRows()}},{key:"activeRows",value:function(){return this.table.rowManager.activeRows}},{key:"refreshData",value:function(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}},{key:"footerAppend",value:function(e){return this.table.footerManager.append(e)}},{key:"footerPrepend",value:function(e){return this.table.footerManager.prepend(e)}},{key:"footerRemove",value:function(e){return this.table.footerManager.remove(e)}},{key:"popup",value:function(e,t){return new V(this.table,e,t)}},{key:"alert",value:function(e,t){return this.table.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){return this.table.alertManager.clear()}}]),a}(f);function W(e,t){e.forEach((function(e){e.reinitializeWidth()})),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()}var j={fitData:function(e,t){t&&this.table.columnManager.renderer.reinitializeColumnWidths(e),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitDataFill:W,fitDataTable:W,fitDataStretch:function(e,t){var i=this,n=0,o=this.table.rowManager.element.clientWidth,a=0,s=!1;e.forEach((function(e,t){e.widthFixed||e.reinitializeWidth(),(i.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(s=e),e.visible&&(n+=e.getWidth())})),s?(a=o-n+s.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(s.setWidth(0),this.table.modules.responsiveLayout.update()),a>0?s.setWidth(a):s.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,n,o=this.table.rowManager.element.getBoundingClientRect().width,a=0,s=0,r=0,l=[],u=[],c=0,h=0;function d(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function m(e,t,i,n){var o=[],a=0,s=0,l=0,u=r,c=0,h=0,p=[];function f(e){return i*(e.column.definition.widthGrow||1)}function g(e){return d(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,a){var s=n?g(e):f(e);e.column.minWidth>=s?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,n;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(n=d(t),a+=n>i?n:i,e.definition.widthShrink&&(u.push({column:e,width:n>i?n:i}),c+=e.definition.widthShrink)):(l.push({column:e,width:0}),r+=e.definition.widthGrow||1))})),s=o-a,i=Math.floor(s/r),h=m(l,s,i,!1),l.length&&h>0&&(l[l.length-1].width+=h),l.forEach((function(e){s-=e.width})),(n=Math.abs(h)+s)>0&&c&&(h=m(u,n,Math.floor(n/c),!0)),h&&u.length&&(u[u.length-1].width-=h),l.forEach((function(e){e.column.setWidth(e.width)})),u.forEach((function(e){e.column.setWidth(e.width)}))}},G=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e,"layout")).mode=null,n.registerTableOption("layout","fitData"),n.registerTableOption("layoutColumnsOnNewData",!1),n.registerColumnOption("widthGrow"),n.registerColumnOption("widthShrink"),n}return n(a,[{key:"initialize",value:function(){var e=this.table.options.layout;a.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}},{key:"getMode",value:function(){return this.mode}},{key:"layout",value:function(e){this.dispatch("layout-refreshing"),a.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}]),a}(N);G.moduleName="layout",G.modes=j;var U=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).locale="default",i.lang=!1,i.bindings={},i.langList={},i.registerTableOption("locale",!1),i.registerTableOption("langs",{}),i}return n(s,[{key:"initialize",value:function(){for(var e in this.langList=C.deepClone(s.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder),this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}},{key:"setHeaderFilterPlaceholder",value:function(e){this.langList.default.headerFilters.default=e}},{key:"setHeaderFilterColumnPlaceholder",value:function(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}},{key:"installLang",value:function(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}},{key:"_setLangProp",value:function(t,i){for(var n in i)t[n]&&"object"==e(t[n])?this._setLangProp(t[n],i[n]):t[n]=i[n]}},{key:"setLocale",value:function(t){if(!0===(t=t||"default")&&navigator.language&&(t=navigator.language.toLowerCase()),t&&!this.langList[t]){var i=t.split("-")[0];this.langList[i]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i),t=i):(console.warn("Localization Error - Matching locale not found, using default: ",t),t="default")}this.locale=t,this.lang=C.deepClone(this.langList.default||{}),"default"!=t&&function t(i,n){for(var o in i)"object"==e(i[o])?(n[o]||(n[o]={}),t(i[o],n[o])):n[o]=i[o]}(this.langList[t],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}},{key:"getLocale",value:function(e){return this.locale}},{key:"getLang",value:function(e){return e?this.langList[e]:this.lang}},{key:"getText",value:function(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}},{key:"_getLangElement",value:function(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}},{key:"bind",value:function(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}},{key:"_executeBindings",value:function(){var e=this,t=function(t){e.bindings[t].forEach((function(i){i(e.getText(t),e.lang)}))};for(var i in this.bindings)t(i)}}]),s}(N);U.moduleName="localize",U.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};var X=function(e){o(a,e);var i=u(a);function a(e){return t(this,a),i.call(this,e)}return n(a,[{key:"initialize",value:function(){this.registerTableFunction("tableComms",this.receive.bind(this))}},{key:"getConnections",value:function(e){var t=this,i=[];return I.lookupTable(e).forEach((function(e){t.table!==e&&i.push(e)})),i}},{key:"send",value:function(e,t,i,n){var o=this,a=this.getConnections(e);a.forEach((function(e){e.tableComms(o.table.element,t,i,n)})),!a.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}},{key:"receive",value:function(e,t,i,n){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,n);console.warn("Inter-table Comms Error - no such module:",t)}}]),a}(N);X.moduleName="comms";var q=Object.freeze({__proto__:null,LayoutModule:G,LocalizeModule:U,CommsModule:X}),K=function(){function i(e,n){t(this,i),this.bindStaticFunctionality(e),this.bindModules(e,q,!0),n&&this.bindModules(e,n)}return n(i,[{key:"bindStaticFunctionality",value:function(t){t.moduleBindings={},t.extendModule=function(i,n,o){if(t.moduleBindings[i]){var a=t.moduleBindings[i][n];if(a)if("object"==e(o))for(var s in o)a[s]=o[s];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",n)}else console.warn("Module Error - module does not exist:",i)},t.registerModule=function(e){Array.isArray(e)||(e=[e]),e.forEach((function(e){t.registerModuleBinding(e)}))},t.registerModuleBinding=function(e){t.moduleBindings[e.moduleName]=e},t.findTable=function(e){var t=I.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},t.prototype.bindModules=function(){var e=[],i=[],n=[];for(var o in this.modules={},t.moduleBindings){var a=t.moduleBindings[o],s=new a(this);this.modules[o]=s,a.prototype.moduleCore?this.modulesCore.push(s):a.moduleInitOrder?a.moduleInitOrder<0?e.push(s):i.push(s):n.push(s)}e.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),i.sort((function(e,t){return e.moduleInitOrder>t.moduleInitOrder?1:-1})),this.modulesRegular=e.concat(n.concat(i))}}},{key:"bindModules",value:function(e,t,i){var n=Object.values(t);i&&n.forEach((function(e){e.prototype.moduleCore=!0})),e.registerModule(n)}}]),i}(),J=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).element=n._createAlertElement(),n.msgElement=n._createMsgElement(),n.type=null,n.element.appendChild(n.msgElement),n}return n(a,[{key:"_createAlertElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}},{key:"_createMsgElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}},{key:"_typeClass",value:function(){return"tabulator-alert-state-"+this.type}},{key:"alert",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"msg";if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}},{key:"clear",value:function(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}]),a}(f),Y=function(){function i(e,n){var o=this;t(this,i),this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new H(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new B(this),this.optionsList=new k(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(n),setTimeout((function(){o._create()}))),I.register(this)}return n(i,[{key:"initializeElement",value:function(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}},{key:"initializeCoreSystems",value:function(e){this.columnManager=new T(this),this.rowManager=new P(this),this.footerManager=new z(this),this.dataLoader=new O(this),this.alertManager=new J(this),this.bindModules(),this.options=this.optionsList.generate(i.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new A(this,this.options,this.options.debugEventsExternal),this.eventBus=new _(this.options.debugEventsInternal),this.interactionMonitor=new F(this),this.dataLoader.initialize(),this.footerManager.initialize()}},{key:"_mapDeprecatedFunctionality",value:function(){}},{key:"_clearSelection",value:function(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}},{key:"_create",value:function(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}},{key:"_rtlCheck",value:function(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}},{key:"_clearObjectPointers",value:function(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}},{key:"_buildElement",value:function(){var t,i=this.element,n=this.options;if("TABLE"===i.tagName){this.originalElement=this.element,t=document.createElement("div");var o=i.attributes;for(var a in o)"object"==e(o[a])&&t.setAttribute(o[a].name,o[a].value);i.parentNode.replaceChild(t,i),this.element=i=t}for(i.classList.add("tabulator"),i.setAttribute("role","grid");i.firstChild;)i.removeChild(i.firstChild);n.height&&(n.height=isNaN(n.height)?n.height:n.height+"px",i.style.height=n.height),!1!==n.minHeight&&(n.minHeight=isNaN(n.minHeight)?n.minHeight:n.minHeight+"px",i.style.minHeight=n.minHeight),!1!==n.maxHeight&&(n.maxHeight=isNaN(n.maxHeight)?n.maxHeight:n.maxHeight+"px",i.style.maxHeight=n.maxHeight)}},{key:"_initializeTable",value:function(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((function(e){e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((function(e){e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}},{key:"_loadInitialData",value:function(){this.dataLoader.load(this.options.data)}},{key:"destroy",value:function(){var e=this.element;for(this.destroyed=!0,I.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}},{key:"_detectBrowser",value:function(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}},{key:"initGuard",value:function(e,t){var i,n;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(n="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?n.trim().split(" ")[1].split(".")[1]:n.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}},{key:"blockRedraw",value:function(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}},{key:"restoreRedraw",value:function(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}},{key:"setData",value:function(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}},{key:"clearData",value:function(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}},{key:"getData",value:function(e){return this.rowManager.getData(e)}},{key:"getDataCount",value:function(e){return this.rowManager.getDataCount(e)}},{key:"replaceData",value:function(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}},{key:"updateData",value:function(e){var t=this,i=0;return this.initGuard(),new Promise((function(n,o){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((function(e){var o=t.rowManager.findRow(e[t.options.index]);o&&(i++,o.updateData(e).then((function(){--i||n()})))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}},{key:"addData",value:function(e,t,i){var n=this;return this.initGuard(),new Promise((function(o,a){n.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?n.rowManager.addRows(e,t,i).then((function(e){var t=[];e.forEach((function(e){t.push(e.getComponent())})),o(t)})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"updateOrAddData",value:function(e){var t=this,i=[],n=0;return this.initGuard(),new Promise((function(o,a){t.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((function(e){var a=t.rowManager.findRow(e[t.options.index]);n++,a?a.updateData(e).then((function(){n--,i.push(a.getComponent()),n||o(i)})):t.rowManager.addRows(e).then((function(e){n--,i.push(e[0].getComponent()),n||o(i)}))})):(console.warn("Update Error - No data provided"),a("Update Error - No data provided"))}))}},{key:"getRow",value:function(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"getRowFromPosition",value:function(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}},{key:"deleteRow",value:function(e){var t=this,i=[];this.initGuard(),Array.isArray(e)||(e=[e]);var n,o=p(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=this.rowManager.findRow(a,!0);if(!s)return console.error("Delete Error - No matching row found:",a),Promise.reject("Delete Error - No matching row found");i.push(s)}}catch(e){o.e(e)}finally{o.f()}return i.sort((function(e,i){return t.rowManager.rows.indexOf(e)>t.rowManager.rows.indexOf(i)?1:-1})),i.forEach((function(e){e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}},{key:"addRow",value:function(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((function(e){return e[0].getComponent()}))}},{key:"updateOrAddRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return i.getComponent()})):this.rowManager.addRows(t).then((function(e){return e[0].getComponent()}))}},{key:"updateRow",value:function(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((function(){return Promise.resolve(i.getComponent())})):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}},{key:"scrollToRow",value:function(e,t,i){var n=this.rowManager.findRow(e);return n?this.rowManager.scrollToRow(n,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}},{key:"moveRow",value:function(e,t,i){var n=this.rowManager.findRow(e);this.initGuard(),n?n.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}},{key:"getRows",value:function(e){return this.rowManager.getComponents(e)}},{key:"getRowPosition",value:function(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}},{key:"setColumns",value:function(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}},{key:"getColumns",value:function(e){return this.columnManager.getComponents(e)}},{key:"getColumn",value:function(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}},{key:"getColumnDefinitions",value:function(){return this.columnManager.getDefinitionTree()}},{key:"showColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}},{key:"hideColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}},{key:"toggleColumn",value:function(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}},{key:"addColumn",value:function(e,t,i){var n=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,n).then((function(e){return e.getComponent()}))}},{key:"deleteColumn",value:function(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}},{key:"updateColumnDefinition",value:function(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}},{key:"moveColumn",value:function(e,t,i){var n=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),n?o?this.columnManager.moveColumn(n,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}},{key:"scrollToColumn",value:function(e,t,i){var n=this;return new Promise((function(o,a){var s=n.columnManager.findColumn(e);return s?n.columnManager.scrollToColumn(s,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}},{key:"redraw",value:function(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}},{key:"setHeight",value:function(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}},{key:"on",value:function(e,t){this.externalEvents.subscribe(e,t)}},{key:"off",value:function(e,t){this.externalEvents.unsubscribe(e,t)}},{key:"dispatchEvent",value:function(){var e,t=Array.from(arguments);t.shift(),(e=this.externalEvents).dispatch.apply(e,arguments)}},{key:"alert",value:function(e,t){this.initGuard(),this.alertManager.alert(e,t)}},{key:"clearAlert",value:function(){this.initGuard(),this.alertManager.clear()}},{key:"modExists",value:function(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}},{key:"module",value:function(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}]),i}();Y.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new K(Y);var $=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).allowedTypes=["","data","download","clipboard","print","htmlOutput"],i.registerColumnOption("accessor"),i.registerColumnOption("accessorParams"),i.registerColumnOption("accessorData"),i.registerColumnOption("accessorDataParams"),i.registerColumnOption("accessorDownload"),i.registerColumnOption("accessorDownloadParams"),i.registerColumnOption("accessorClipboard"),i.registerColumnOption("accessorClipboardParams"),i.registerColumnOption("accessorPrint"),i.registerColumnOption("accessorPrintParams"),i.registerColumnOption("accessorHtmlOutput"),i.registerColumnOption("accessorHtmlOutputParams"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,s="accessor"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[s]&&(a=t.lookupAccessor(e.definition[s]))&&(i=!0,n[s]={accessor:a,params:e.definition[s+"Params"]||{}})})),i&&(e.modules.accessor=n)}},{key:"lookupAccessor",value:function(t){var i=!1;switch(e(t)){case"string":s.accessors[t]?i=s.accessors[t]:console.warn("Accessor Error - No such accessor found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t){var i="accessor"+(t.charAt(0).toUpperCase()+t.slice(1)),n=e.getComponent(),o=C.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var a,s,r,l;e.modules.accessor&&(s=e.modules.accessor[i]||e.modules.accessor.accessor||!1)&&"undefined"!=(a=e.getFieldValue(o))&&(l=e.getComponent(),r="function"==typeof s.params?s.params(a,o,t,l,n):s.params,e.setFieldValue(o,s.accessor(a,o,t,r,l,n)))})),o}}]),s}(N);$.moduleName="accessor",$.accessors={};function Z(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(Z(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(Z(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}function Q(e){var t=Z(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function ee(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+Q(i))),e}function te(t,i){var n=[];if(i=i||"",Array.isArray(t))t.forEach((function(e,t){n=n.concat(te(e,i?i+"["+t+"]":t))}));else if("object"===e(t))for(var o in t)n=n.concat(te(t[o],i?i+"["+o+"]":o));else n.push({key:i,value:t});return n}var ie={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var n=te(i),o=new FormData;return n.forEach((function(e){o.append(e.key,e.value)})),o}}},ne=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).config={},n.url="",n.urlGenerator=!1,n.params=!1,n.loaderPromise=!1,n.registerTableOption("ajaxURL",!1),n.registerTableOption("ajaxURLGenerator",!1),n.registerTableOption("ajaxParams",{}),n.registerTableOption("ajaxConfig","get"),n.registerTableOption("ajaxContentType","form"),n.registerTableOption("ajaxRequestFunc",!1),n.registerTableOption("ajaxRequesting",(function(){})),n.registerTableOption("ajaxResponse",!1),n.contentTypeFormatters=a.contentTypeFormatters,n}return n(a,[{key:"initialize",value:function(){this.loaderPromise=this.table.options.ajaxRequestFunc||a.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||a.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}},{key:"requestParams",value:function(e,t,i,n){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),n=Object.assign(n,o)),n}},{key:"requestDataCheck",value:function(e,t,i,n){return!((e||!this.url)&&"string"!=typeof e)}},{key:"requestData",value:function(e,t,i,n,o){var a;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),a=this.generateConfig(i),this.sendRequest(this.url,t,a)):o}},{key:"setDefaultConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=Object.assign({},a.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}},{key:"generateConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}},{key:"setUrl",value:function(e){this.url=e}},{key:"getUrl",value:function(){return this.url}},{key:"sendRequest",value:function(e,t,i){var n=this;return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((function(i){return n.table.options.ajaxResponse&&(i=n.table.options.ajaxResponse.call(n.table,e,t,i)),i})):Promise.reject()}}]),a}(N);ne.moduleName="ajax",ne.defaultConfig={method:"GET"},ne.defaultURLGenerator=ee,ne.defaultLoaderPromise=function(t,i,n){var o,a=this;return new Promise((function(s,r){if(t=a.urlGenerator.call(a.table,t,i,n),"GET"!=i.method.toUpperCase())if(o="object"===e(a.table.options.ajaxContentType)?a.table.options.ajaxContentType:a.contentTypeFormatters[a.table.options.ajaxContentType]){for(var l in o.headers)i.headers||(i.headers={}),void 0===i.headers[l]&&(i.headers[l]=o.headers[l]);i.body=o.body.call(a,t,i,n)}else console.warn("Ajax Error - Invalid ajaxContentType value:",a.table.options.ajaxContentType);t?(void 0===i.headers&&(i.headers={}),void 0===i.headers.Accept&&(i.headers.Accept="application/json"),void 0===i.headers["X-Requested-With"]&&(i.headers["X-Requested-With"]="XMLHttpRequest"),void 0===i.mode&&(i.mode="cors"),"cors"==i.mode?(void 0===i.headers.Origin&&(i.headers.Origin=window.location.origin),void 0===i.credentials&&(i.credentials="same-origin")):void 0===i.credentials&&(i.credentials="include"),fetch(t,i).then((function(e){e.ok?e.json().then((function(e){s(e)})).catch((function(e){r(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),r(e))})).catch((function(e){console.error("Ajax Load Error - Connection Error: ",e),r(e)}))):(console.warn("Ajax Load Error - No URL Set"),s([]))}))},ne.contentTypeFormatters=ie;var oe=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).mode=!0,i.pasteParser=function(){},i.pasteAction=function(){},i.customSelection=!1,i.rowRange=!1,i.blocked=!0,i.registerTableOption("clipboard",!1),i.registerTableOption("clipboardCopyStyled",!0),i.registerTableOption("clipboardCopyConfig",!1),i.registerTableOption("clipboardCopyFormatter",!1),i.registerTableOption("clipboardCopyRowRange","active"),i.registerTableOption("clipboardPasteParser","table"),i.registerTableOption("clipboardPasteAction","insert"),i.registerColumnOption("clipboard"),i.registerColumnOption("titleClipboard"),i}return n(s,[{key:"initialize",value:function(){var e=this;this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(function(t){var i,n,o;e.blocked||(t.preventDefault(),e.customSelection?(i=e.customSelection,e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i))):(o=e.table.modules.export.generateExportList(e.table.options.clipboardCopyConfig,e.table.options.clipboardCopyStyled,e.rowRange,"clipboard"),i=(n=e.table.modules.export.generateHTMLTable(o))?e.generatePlainContent(o):"",e.table.options.clipboardCopyFormatter&&(i=e.table.options.clipboardCopyFormatter("plain",i),n=e.table.options.clipboardCopyFormatter("html",n))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",i):t.clipboardData&&t.clipboardData.setData?(t.clipboardData.setData("text/plain",i),n&&t.clipboardData.setData("text/html",n)):t.originalEvent&&t.originalEvent.clipboardData.setData&&(t.originalEvent.clipboardData.setData("text/plain",i),n&&t.originalEvent.clipboardData.setData("text/html",n)),e.dispatchExternal("clipboardCopied",i,n),e.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(function(t){e.paste(t)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}},{key:"reset",value:function(){this.blocked=!0,this.customSelection=!1}},{key:"generatePlainContent",value:function(t){var i=[];return t.forEach((function(t){var n=[];t.columns.forEach((function(i){var o="";if(i)if("group"===t.type&&(i.value=i.component.getKey()),null===i.value)o="";else switch(e(i.value)){case"object":o=JSON.stringify(i.value);break;case"undefined":o="";break;default:o=i.value}n.push(o)})),i.push(n.join("\t"))})),i.join("\n")}},{key:"copy",value:function(e,t){var i,n;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((n=document.body.createTextRange()).moveToElementText(this.table.element),n.select()),document.execCommand("copy"),i&&i.removeAllRanges())}},{key:"setPasteAction",value:function(t){switch(e(t)){case"string":this.pasteAction=s.pasteActions[t],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",t);break;case"function":this.pasteAction=t}}},{key:"setPasteParser",value:function(t){switch(e(t)){case"string":this.pasteParser=s.pasteParsers[t],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",t);break;case"function":this.pasteParser=t}}},{key:"paste",value:function(e){var t,i,n;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),n=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,n)):this.dispatchExternal("clipboardPasteError",t))}},{key:"mutateData",value:function(e){var t=this,i=[];return Array.isArray(e)?e.forEach((function(e){i.push(t.table.modules.mutator.transformRow(e,"clipboard"))})):i=e,i}},{key:"checkPaseOrigin",value:function(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}},{key:"getPasteData",value:function(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}]),s}(N);oe.moduleName="clipboard",oe.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},oe.pasteParsers={table:function(e){var t=[],i=!0,n=this.table.columnManager.columns,o=[],a=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=n.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=n.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),a.push(t)})),a)}};var ae=function(){function e(i){return t(this,e),this._row=i,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}return n(e,[{key:"getData",value:function(e){return this._row.getData(e)}},{key:"getElement",value:function(){return this._row.getElement()}},{key:"getTable",value:function(){return this._row.table}},{key:"getCells",value:function(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}},{key:"getCell",value:function(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}},{key:"_getSelf",value:function(){return this._row}}]),e}(),se={avg:function(e,t,i){var n=0,o=void 0!==i.precision?i.precision:2;return e.length&&(n=e.reduce((function(e,t){return Number(e)+Number(t)})),n/=e.length,n=!1!==o?n.toFixed(o):n),parseFloat(n).toString()},max:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>n||null===n)&&(n=e)})),null!==n?!1!==o?n.toFixed(o):n:""},min:function(e,t,i){var n=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))"),i.dataTreeExpandElement?"string"==typeof i.dataTreeExpandElement?((t=document.createElement("div")).innerHTML=i.dataTreeExpandElement,this.expandEl=t.firstChild):this.expandEl=i.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),e(i.dataTreeStartExpanded)){case"boolean":this.startOpen=function(e,t){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(e,t){return i.dataTreeStartExpanded[t]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}},{key:"tableRedrawing",value:function(e){var t=this;e&&this.table.rowManager.getRows().forEach((function(e){t.reinitializeRowChildren(e)}))}},{key:"initializeElementField",value:function(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}},{key:"getRowChildren",value:function(e){return this.getTreeChildren(e,!0)}},{key:"columnMoving",value:function(){var e=this,t=[];return this.table.rowManager.rows.forEach((function(i){t=t.concat(e.getTreeChildren(i,!1,!0))})),t}},{key:"rowDataChanged",value:function(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}},{key:"cellValueChanged",value:function(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}},{key:"initializeRow",value:function(t){var i=t.getData()[this.field],n=Array.isArray(i),o=n||!n&&"object"===e(i)&&null!==i;!o&&t.modules.dataTree&&t.modules.dataTree.branchEl&&t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl),!o&&t.modules.dataTree&&t.modules.dataTree.controlEl&&t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl),t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:!!o&&(t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0)),controlEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.controlEl,branchEl:!(!t.modules.dataTree||!o)&&t.modules.dataTree.branchEl,parent:!!t.modules.dataTree&&t.modules.dataTree.parent,children:o}}},{key:"reinitializeRowChildren",value:function(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}},{key:"layoutRow",value:function(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}},{key:"generateControlElement",value:function(e,t){var i=this,n=e.modules.dataTree,o=n.controlEl;t=t||e.getCells()[0].getElement(),!1!==n.children&&(n.open?(n.controlEl=this.collapseEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.collapseRow(e)}))):(n.controlEl=this.expandEl.cloneNode(!0),n.controlEl.addEventListener("click",(function(t){t.stopPropagation(),i.expandRow(e)}))),n.controlEl.addEventListener("mousedown",(function(e){e.stopPropagation()})),o&&o.parentNode===t?o.parentNode.replaceChild(n.controlEl,o):t.insertBefore(n.controlEl,t.firstChild))}},{key:"getRows",value:function(e){var t=this,i=[];return e.forEach((function(e,n){var o;i.push(e),e instanceof L&&(e.create(),(o=e.modules.dataTree.children).index||!1===o.children||t.getChildren(e).forEach((function(e){e.create(),i.push(e)})))})),i}},{key:"getChildren",value:function(e,t){var i=this,n=e.modules.dataTree,o=[],a=[];return!1!==n.children&&(n.open||t)&&(Array.isArray(n.children)||(n.children=this.generateChildren(e)),o=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(n.children):n.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(o),o.forEach((function(e){a.push(e),i.getChildren(e).forEach((function(e){a.push(e)}))}))),a}},{key:"generateChildren",value:function(e){var t=this,i=[],n=e.getData()[this.field];return Array.isArray(n)||(n=[n]),n.forEach((function(n){var o=new L(n||{},t.table.rowManager);o.create(),o.modules.dataTree.index=e.modules.dataTree.index+1,o.modules.dataTree.parent=e,o.modules.dataTree.children&&(o.modules.dataTree.open=t.startOpen(o.getComponent(),o.modules.dataTree.index)),i.push(o)})),i}},{key:"expandRow",value:function(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}},{key:"collapseRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}},{key:"toggleRow",value:function(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}},{key:"isRowExpanded",value:function(e){return e.modules.dataTree.open}},{key:"getTreeParent",value:function(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}},{key:"getTreeParentRoot",value:function(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}},{key:"getFilteredTreeChildren",value:function(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((function(e){e instanceof L&&i.push(e)}))),i}},{key:"rowDelete",value:function(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}},{key:"addTreeChildRow",value:function(e,t,i,n){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==n&&!1!==(o=this.findChildIndex(n,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}},{key:"findChildIndex",value:function(t,i){var n=this,o=!1;return"object"==e(t)?t instanceof L?o=t.data:t instanceof M?o=t._getSelf().data:"undefined"!=typeof HTMLElement&&t instanceof HTMLElement?i.modules.dataTree&&(o=i.modules.dataTree.children.find((function(e){return e instanceof L&&e.element===t})))&&(o=o.data):null===t&&(o=!1):o=void 0!==t&&i.data[this.field].find((function(e){return e.data[n.table.options.index]==t})),o&&(Array.isArray(i.data[this.field])&&(o=i.data[this.field].indexOf(o)),-1==o&&(o=!1)),o}},{key:"getTreeChildren",value:function(e,t,i){var n=this,o=e.modules.dataTree,a=[];return o.children&&(Array.isArray(o.children)||(o.children=this.generateChildren(e)),o.children.forEach((function(e){e instanceof L&&(a.push(t?e.getComponent():e),i&&(a=a.concat(n.getTreeChildren(e,t,i))))}))),a}},{key:"getChildField",value:function(){return this.field}},{key:"redrawNeeded",value:function(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}]),s}(N);le.moduleName="dataTree";var ue={csv:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=i.delimiter?i.delimiter:",",a=[],s=[];t.forEach((function(t){var i=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach((function(e,t){e&&1===e.depth&&(s[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":t.columns.forEach((function(t){if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}i.push('"'+String(t.value).split('"').join('""')+'"')}})),a.push(i.join(o))}})),s.length&&a.unshift(s.join(o)),a=a.join("\n"),i.bom&&(a="\ufeff"+a),n(a,"text/csv")},json:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(t)}})),i(n=JSON.stringify(n,null,"\t"),"application/json")},jsonLines:function(e,t,i){var n=[];e.forEach((function(e){var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((function(e){e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),n.push(JSON.stringify(t))}})),i(n.join("\n"),"application/x-ndjson")},pdf:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=[],a=[],s={},r=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},l=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},u=i.jsPDF||{},c=i.title?i.title:"";function h(t,i){var n=[];return t.columns.forEach((function(t){var o;if(t){switch(e(t.value)){case"object":t.value=null!==t.value?JSON.stringify(t.value):"";break;case"undefined":t.value=""}o={content:t.value,colSpan:t.width,rowSpan:t.height},i&&(o.styles=i),n.push(o)}})),n}u.orientation||(u.orientation=i.orientation||"landscape"),u.unit||(u.unit="pt"),t.forEach((function(e){switch(e.type){case"header":o.push(h(e));break;case"group":a.push(h(e,r));break;case"calc":a.push(h(e,l));break;case"row":a.push(h(e))}}));var d=new jspdf.jsPDF(u);i.autoTable&&(s="function"==typeof i.autoTable?i.autoTable(d)||{}:i.autoTable),c&&(s.didDrawPage=function(e){d.text(c,40,30)}),s.head=o,s.body=a,d.autoTable(s),i.documentProcessing&&i.documentProcessing(d),n(d.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,n){var o=i.sheetName||"Sheet1",a=XLSX.utils.book_new(),s=new f(this);function r(){var i=[],n=[],o={},a={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce((function(e,t){return e+(t&&t.width?t.width:1)}),0):0,r:t.length}};return t.forEach((function(t,o){var a=[];t.columns.forEach((function(t,i){t?(a.push(t.value instanceof Date||"object"!==e(t.value)?t.value:JSON.stringify(t.value)),(t.width>1||t.height>-1)&&(t.height>1||t.width>1)&&n.push({s:{r:o,c:i},e:{r:o+t.height-1,c:i+t.width-1}})):a.push("")})),i.push(a)})),XLSX.utils.sheet_add_aoa(o,i),o["!ref"]=XLSX.utils.encode_range(a),n.length&&(o["!merges"]=n),o}if(a.SheetNames=[],a.Sheets={},i.sheetOnly)n(r());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(a.SheetNames.push(l),a.Sheets[l]=r()):(a.SheetNames.push(l),s.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){a.Sheets[l]=e}}));else a.SheetNames.push(o),a.Sheets[o]=r();i.documentProcessing&&(a=i.documentProcessing(a)),n(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n!=e.length;++n)i[n]=255&e.charCodeAt(n);return t}(XLSX.write(a,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}},ce=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),n.registerTableOption("downloadReady",void 0),n.registerTableOption("downloadConfig",{}),n.registerTableOption("downloadRowRange","active"),n.registerColumnOption("download"),n.registerColumnOption("titleDownload"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheck("downloadReady","downloadEncoder")}},{key:"downloadToTab",value:function(e,t,i,n){this.download(e,t,i,n,!0)}},{key:"download",value:function(e,t,i,n,o){var s=!1;if("function"==typeof e?s=e:a.downloaders[e]?s=a.downloaders[e]:console.warn("Download Error - No such download type found: ",e),s){var r=this.generateExportList(n);s.call(this.table,r,i||{},function(i,n){o?!0===o?this.triggerDownload(i,n,e,t,!0):o(i):this.triggerDownload(i,n,e,t)}.bind(this))}}},{key:"generateExportList",value:function(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((function(e){var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}},{key:"triggerDownload",value:function(e,t,i,n,o){var a=document.createElement("a"),s=this.table.options.downloadEncoder(e,t);s&&(o?window.open(window.URL.createObjectURL(s)):(n=n||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(s,n):(a.setAttribute("href",window.URL.createObjectURL(s)),a.setAttribute("download",n),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a))),this.dispatchExternal("downloadComplete"))}},{key:"commsReceived",value:function(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}]),a}(N);function he(e,t){var i=t.mask,n=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",a=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function s(t){var r=i[t];void 0!==r&&r!==a&&r!==n&&r!==o&&(e.value=e.value+""+r,s(t+1))}e.addEventListener("keydown",(function(t){var s=e.value.length,r=t.key;if(t.keyCode>46){if(s>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[s]){case n:if(r.toUpperCase()==r.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(r))return t.preventDefault(),t.stopPropagation(),!1;break;case a:break;default:if(r!==i[s])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(function(i){i.keyCode>46&&t.maskAutoFill&&s(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&s(e.value.length)}ce.moduleName="download",ce.downloaders=ue;var de=function(){function i(e,n,o,a,s,r){t(this,i),this.edit=e,this.table=e.table,this.cell=n,this.params=this._initializeParams(r),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!n._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.blurable=!0,this.actions={success:a,cancel:s},this._deprecatedOptionsCheck(),this._initializeValue(),o(this._onRendered.bind(this))}return n(i,[{key:"_deprecatedOptionsCheck",value:function(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}},{key:"_initializeValue",value:function(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}},{key:"_onRendered",value:function(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((function(){e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}},{key:"_createListElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}},{key:"_setListWidth",value:function(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}},{key:"_createInputElement",value:function(){var t=this.params.elementAttributes,i=document.createElement("input");if(i.setAttribute("type",this.params.clearable?"search":"text"),i.style.padding="4px",i.style.width="100%",i.style.boxSizing="border-box",this.params.autocomplete||(i.style.cursor="default",i.style.caretColor="transparent"),t&&"object"==e(t))for(var n in t)"+"==n.charAt(0)?(n=n.slice(1),i.setAttribute(n,i.getAttribute(n)+t["+"+n])):i.setAttribute(n,t[n]);return this.params.mask&&he(i,this.params),this._bindInputEvents(i),i}},{key:"_initializeParams",value:function(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((function(e){return i.includes(e)})).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}},{key:"_bindInputEvents",value:function(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}},{key:"_inputFocus",value:function(e){this.rebuildOptionsList()}},{key:"_filter",value:function(){var e=this;this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((function(){e.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}},{key:"_inputClick",value:function(e){e.stopPropagation()}},{key:"_inputBlur",value:function(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}},{key:"_inputSearch",value:function(){this._clearChoices()}},{key:"_inputKeyDown",value:function(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}},{key:"_inputKeyUp",value:function(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}},{key:"_preventPopupBlur",value:function(){var e=this;this.popup&&this.popup.blockHide(),setTimeout((function(){e.popup&&e.popup.restoreHide()}),10)}},{key:"_preventBlur",value:function(){var e=this;this.blurable=!1,setTimeout((function(){e.blurable=!0}),10)}},{key:"_keyUp",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}},{key:"_keyDown",value:function(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}},{key:"_keyAutoCompLetter",value:function(e){this._filter(),this.lastAction="typing",this.typing=!0}},{key:"_scrollToValue",value:function(e){var t=this;clearTimeout(this.filterTimeout);var i=String.fromCharCode(e).toLowerCase();this.filterTerm+=i.toLowerCase();var n=this.displayItems.find((function(e){return void 0!==e.label&&e.label.toLowerCase().startsWith(t.filterTerm)}));n&&this._focusItem(n),this.filterTimeout=setTimeout((function(){t.filterTerm=""}),800)}},{key:"_focusItem",value:function(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}},{key:"headerFilterInitialListGen",value:function(){this._generateOptions(!0)}},{key:"rebuildOptionsList",value:function(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((function(e){Number.isInteger(e)||console.error("List generation error",e)}))}},{key:"_filterList",value:function(){this._buildList(this._filterOptions()),this._showList()}},{key:"_generateOptions",value:function(e){var t=this,i=[],n=++this.listIteration;return this.filtered=!1,this.params.values?i=this.params.values:this.params.valuesURL?i=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?i=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(i=this._uniqueColumnValues(this.params.valuesLookupField)),i instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),i.then().then((function(e){return t.listIteration===n?t._parseList(e):Promise.reject(n)}))):Promise.resolve(this._parseList(i))}},{key:"_addPlaceholder",value:function(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}},{key:"_ajaxRequest",value:function(e,t){return e=ee(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((function(e){return e.ok?e.json().catch((function(e){return console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)})):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e))})).catch((function(e){return console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e)}))}},{key:"_uniqueColumnValues",value:function(e){var t,i={},n=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?n.forEach((function(e){var n=t.getFieldValue(e);null!=n&&""!==n&&(i[n]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}},{key:"_parseList",value:function(t){var i=this,n=[];return Array.isArray(t)||(t=Object.entries(t).map((function(e){var t=c(e,2),i=t[0];return{label:t[1],value:i}}))),t.forEach((function(t){"object"!==e(t)&&(t={label:t,value:t}),i._parseListItem(t,n,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=n,n}},{key:"_parseListItem",value:function(e,t,i){var n={};e.options?n=this._parseListGroup(e,i+1):(n={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(n,!0)),t.push(n)}},{key:"_parseListGroup",value:function(e,t){var i=this,n={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((function(e){i._parseListItem(e,n.options,t)})),n}},{key:"_sortOptions",value:function(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}},{key:"_sortGroup",value:function(e,t){var i=this;t.sort((function(t,i){return e(t.label,i.label,t.value,i.value,t.original,i.original)})),t.forEach((function(t){t.group&&i._sortGroup(e,t.options)}))}},{key:"_defaultSortFunction",value:function(e,t){var i,n,o,a,s,r=0,l=/(\d+)|(\D+)/g,u=/\d/,c=0;if("desc"===this.params.sort){var h=[t,e];e=h[0],t=h[1]}if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(n=String(t).toLowerCase()))return 0;if(!u.test(i)||!u.test(n))return i>n?1:-1;for(i=i.match(l),n=n.match(l),s=i.length>n.length?n.length:i.length;ra?1:-1;return i.length>n.length}c=1}else c=t||0===t?-1:0;return c}},{key:"_filterOptions",value:function(){var e=this,t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;return i?(this.filtered=!0,this.data.forEach((function(n){e._filterItem(t,i,n)}))):this.filtered=!1,this.data}},{key:"_filterItem",value:function(e,t,i){var n=this,o=!1;return i.group?(i.options.forEach((function(i){n._filterItem(e,t,i)&&(o=!0)})),i.visible=o):i.visible=e(t,i.label,i.value,i.original),i.visible}},{key:"_defaultFilterFunc",value:function(e,t,i,n){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}},{key:"_clearList",value:function(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}},{key:"_buildList",value:function(e){var t=this;this._clearList(),e.forEach((function(e){t._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}},{key:"_buildItem",value:function(t){var i,n=this,o=t.element;if(!this.filtered||t.visible){if(!o){if((o=document.createElement("div")).tabIndex=0,(i=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,o):t.label)instanceof HTMLElement?o.appendChild(i):o.innerHTML=i,t.group?o.classList.add("tabulator-edit-list-group"):o.classList.add("tabulator-edit-list-item"),o.classList.add("tabulator-edit-list-group-level-"+t.level),t.elementAttributes&&"object"==e(t.elementAttributes))for(var a in t.elementAttributes)"+"==a.charAt(0)?(a=a.slice(1),o.setAttribute(a,this.input.getAttribute(a)+t.elementAttributes["+"+a])):o.setAttribute(a,t.elementAttributes[a]);t.group?o.addEventListener("click",this._groupClick.bind(this,t)):o.addEventListener("click",this._itemClick.bind(this,t)),o.addEventListener("mousedown",this._preventBlur.bind(this)),t.element=o}this._styleItem(t),this.listEl.appendChild(o),t.group?t.options.forEach((function(e){n._buildItem(e)})):this.displayItems.push(t)}}},{key:"_showList",value:function(){var e=this,t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),t||setTimeout((function(){e.popup.hideOnBlur(e._resolveValue.bind(e,!0))}),10)}}},{key:"_styleItem",value:function(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}},{key:"_itemClick",value:function(e,t){t.stopPropagation(),this._chooseItem(e)}},{key:"_groupClick",value:function(e,t){t.stopPropagation()}},{key:"_cancel",value:function(){this.popup.hide(!0),this.actions.cancel()}},{key:"_clearChoices",value:function(){var e=this;this.typing=!0,this.currentItems.forEach((function(t){t.selected=!1,e._styleItem(t)})),this.currentItems=[],this.focusedItem=null}},{key:"_chooseItem",value:function(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((function(e){return e.label})).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}},{key:"_resolveValue",value:function(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((function(e){return e.value}));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}}]),i}();var me={input:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input");if(r.setAttribute("type",a.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+a.elementAttributes["+"+l])):r.setAttribute(l,a.elementAttributes[l]);function u(e){null==s&&""!==r.value||r.value!==s?n(r.value)&&(s=r.value):o()}return r.value=void 0!==s?s:"",i((function(){r.focus({preventScroll:!0}),r.style.height="100%",a.selectContents&&r.select()})),r.addEventListener("change",u),r.addEventListener("blur",u),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(r,a),r},textarea:function(t,i,n,o,a){var s=t.getValue(),r=a.verticalNavigation||"hybrid",l=String(null!=s?s:""),u=document.createElement("textarea"),c=0;if(u.style.display="block",u.style.padding="2px",u.style.height="100%",u.style.width="100%",u.style.boxSizing="border-box",u.style.whiteSpace="pre-wrap",u.style.resize="none",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){null==s&&""!==u.value||u.value!==s?(n(u.value)&&(s=u.value),setTimeout((function(){t.getRow().normalizeHeight()}),300)):o()}return u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",u.scrollHeight,u.style.height=u.scrollHeight+"px",t.getRow().normalizeHeight(),a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keyup",(function(){u.style.height="";var e=u.scrollHeight;u.style.height=e+"px",e!=c&&(c=e,t.getRow().normalizeHeight())})),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&a.shiftEnterSubmit&&d();break;case 27:o();break;case 38:("editor"==r||"hybrid"==r&&u.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&u.selectionStart!==u.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(u,a),u},number:function(t,i,n,o,a){var s=t.getValue(),r=a.verticalNavigation||"editor",l=document.createElement("input");if(l.setAttribute("type","number"),void 0!==a.max&&l.setAttribute("max",a.max),void 0!==a.min&&l.setAttribute("min",a.min),void 0!==a.step&&l.setAttribute("step",a.step),l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var u in a.elementAttributes)"+"==u.charAt(0)?(u=u.slice(1),l.setAttribute(u,l.getAttribute(u)+a.elementAttributes["+"+u])):l.setAttribute(u,a.elementAttributes[u]);l.value=s;var c=function(e){h()};function h(){var e=l.value;isNaN(e)||""===e||(e=Number(e)),e!==s?n(e)&&(s=e):o()}return i((function(){l.removeEventListener("blur",c),l.focus({preventScroll:!0}),l.style.height="100%",l.addEventListener("blur",c),a.selectContents&&l.select()})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:o();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),a.mask&&he(l,a),l},range:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==a.max&&r.setAttribute("max",a.max),void 0!==a.min&&r.setAttribute("min",a.min),void 0!==a.step&&r.setAttribute("step",a.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var l in a.elementAttributes)"+"==l.charAt(0)?(l=l.slice(1),r.setAttribute(l,r.getAttribute(l)+a.elementAttributes["+"+l])):r.setAttribute(l,a.elementAttributes[l]);function u(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=s?n(e)&&(s=e):o()}return r.value=s,i((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){u()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:u();break;case 27:o()}})),r},date:function(t,i,n,o,a){var s=a.format,r=s?window.DateTime||luxon.DateTime:null,l=t.getValue(),u=document.createElement("input");function c(e){return(r.isDateTime(e)?e:"iso"===s?r.fromISO(String(e)):r.fromFormat(String(e),s)).toFormat("yyyy-MM-dd")}if(u.type="date",u.style.padding="4px",u.style.width="100%",u.style.boxSizing="border-box",a.max&&u.setAttribute("max",s?c(a.max):a.max),a.min&&u.setAttribute("min",s?c(a.min):a.min),a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),u.setAttribute(h,u.getAttribute(h)+a.elementAttributes["+"+h])):u.setAttribute(h,a.elementAttributes[h]);function d(e){var t=u.value;null==l&&""!==t||t!==l?(t&&s&&(t=r.fromFormat(String(t),"yyyy-MM-dd").toFormat(s)),n(t)&&(l=u.value)):o()}return l=void 0!==l?l:"",s&&(r?l=c(l):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),u.value=l,i((function(){u.focus({preventScroll:!0}),u.style.height="100%",a.selectContents&&u.select()})),u.addEventListener("change",d),u.addEventListener("blur",d),u.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),u},time:function(t,i,n,o,a){var s,r=a.format,l=r?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="time",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),c.setAttribute(h,c.getAttribute(h)+a.elementAttributes["+"+h])):c.setAttribute(h,a.elementAttributes[h]);function d(e){var t=c.value;null==u&&""!==t||t!==u?(t&&r&&(t=l.fromFormat(String(t),"hh:mm").toFormat(r)),n(t)&&(u=c.value)):o()}return u=void 0!==u?u:"",r&&(l?(s=l.isDateTime(u)?u:"iso"===r?l.fromISO(String(u)):l.fromFormat(String(u),r),u=s.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),c.value=u,i((function(){c.focus({preventScroll:!0}),c.style.height="100%",a.selectContents&&c.select()})),c.addEventListener("change",d),c.addEventListener("blur",d),c.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),c},datetime:function(t,i,n,o,a){var s,r=a.format,l=r?window.DateTime||luxon.DateTime:null,u=t.getValue(),c=document.createElement("input");if(c.type="datetime-local",c.style.padding="4px",c.style.width="100%",c.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var h in a.elementAttributes)"+"==h.charAt(0)?(h=h.slice(1),c.setAttribute(h,c.getAttribute(h)+a.elementAttributes["+"+h])):c.setAttribute(h,a.elementAttributes[h]);function d(e){var t=c.value;null==u&&""!==t||t!==u?(t&&r&&(t=l.fromISO(String(t)).toFormat(r)),n(t)&&(u=c.value)):o()}return u=void 0!==u?u:"",r&&(l?(s=l.isDateTime(u)?u:"iso"===r?l.fromISO(String(u)):l.fromFormat(String(u),r),u=s.toFormat("yyyy-MM-dd")+"T"+s.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),c.value=u,i((function(){c.focus({preventScroll:!0}),c.style.height="100%",a.selectContents&&c.select()})),c.addEventListener("change",d),c.addEventListener("blur",d),c.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:o();break;case 35:case 36:e.stopPropagation()}})),c},select:function(e,t,i,n,o){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new de(this,e,t,i,n,o).input},list:function(e,t,i,n,o){return new de(this,e,t,i,n,o).input},autocomplete:function(e,t,i,n,o){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new de(this,e,t,i,n,o).input},star:function(t,i,n,o,a){var s=this,r=t.getElement(),l=t.getValue(),u=r.getElementsByTagName("svg").length||5,c=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,h=[],d=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");function p(e){h.forEach((function(t,i){i'):("ie"==s.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function f(e){var t=document.createElement("span"),i=m.cloneNode(!0);h.push(i),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),p(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),n(e),r.blur()})),t.appendChild(i),d.appendChild(t)}function g(e){l=e,p(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",d.style.verticalAlign="middle",d.style.display="inline-block",d.style.padding="4px",m.setAttribute("width",c),m.setAttribute("height",c),m.setAttribute("viewBox","0 0 512 512"),m.setAttribute("xml:space","preserve"),m.style.padding="0 1px",a.elementAttributes&&"object"==e(a.elementAttributes))for(var v in a.elementAttributes)"+"==v.charAt(0)?(v=v.slice(1),d.setAttribute(v,d.getAttribute(v)+a.elementAttributes["+"+v])):d.setAttribute(v,a.elementAttributes[v]);for(var b=1;b<=u;b++)f(b);return p(l=Math.min(parseInt(l),u)),d.addEventListener("mousemove",(function(e){p(0)})),d.addEventListener("click",(function(e){n(0)})),r.addEventListener("blur",(function(e){o()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(l+1);break;case 37:g(l-1);break;case 13:n(l);break;case 27:o()}})),d},progress:function(t,i,n,o,a){var s,r,l=t.getElement(),u=void 0===a.max?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("max")||100:a.max,c=void 0===a.min?l.getElementsByTagName("div")[0]&&l.getElementsByTagName("div")[0].getAttribute("min")||0:a.min,h=(u-c)/100,d=t.getValue()||0,m=document.createElement("div"),p=document.createElement("div");function f(){var e=window.getComputedStyle(l,null),t=h*Math.round(p.offsetWidth/((l.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+c;n(t),l.setAttribute("aria-valuenow",t),l.setAttribute("aria-label",d)}if(m.style.position="absolute",m.style.right="0",m.style.top="0",m.style.bottom="0",m.style.width="5px",m.classList.add("tabulator-progress-handle"),p.style.display="inline-block",p.style.position="relative",p.style.height="100%",p.style.backgroundColor="#488CE9",p.style.maxWidth="100%",p.style.minWidth="0%",a.elementAttributes&&"object"==e(a.elementAttributes))for(var g in a.elementAttributes)"+"==g.charAt(0)?(g=g.slice(1),p.setAttribute(g,p.getAttribute(g)+a.elementAttributes["+"+g])):p.setAttribute(g,a.elementAttributes[g]);return l.style.padding="4px 4px",d=Math.min(parseFloat(d),u),d=Math.max(parseFloat(d),c),d=Math.round((d-c)/h),p.style.width=d+"%",l.setAttribute("aria-valuemin",c),l.setAttribute("aria-valuemax",u),p.appendChild(m),m.addEventListener("mousedown",(function(e){s=e.screenX,r=p.offsetWidth})),m.addEventListener("mouseover",(function(){m.style.cursor="ew-resize"})),l.addEventListener("mousemove",(function(e){s&&(p.style.width=r+e.screenX-s+"px")})),l.addEventListener("mouseup",(function(e){s&&(e.stopPropagation(),e.stopImmediatePropagation(),s=!1,r=!1,f())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),p.style.width=p.clientWidth+l.clientWidth/100+"px";break;case 37:e.preventDefault(),p.style.width=p.clientWidth-l.clientWidth/100+"px";break;case 9:case 13:f();break;case 27:o()}})),l.addEventListener("blur",(function(){o()})),p},tickCross:function(t,i,n,o,a){var s=t.getValue(),r=document.createElement("input"),l=a.tristate,u=void 0===a.indeterminateValue?null:a.indeterminateValue,c=!1,h=Object.keys(a).includes("trueValue"),d=Object.keys(a).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",a.elementAttributes&&"object"==e(a.elementAttributes))for(var m in a.elementAttributes)"+"==m.charAt(0)?(m=m.slice(1),r.setAttribute(m,r.getAttribute(m)+a.elementAttributes["+"+m])):r.setAttribute(m,a.elementAttributes[m]);function p(e){var t=r.checked;return h&&t?t=a.trueValue:d&&!t&&(t=a.falseValue),l?e?c?u:t:r.checked&&!c?(r.checked=!1,r.indeterminate=!0,c=!0,u):(c=!1,t):t}return r.value=s,!l||void 0!==s&&s!==u&&""!==s||(c=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&i((function(){r.focus({preventScroll:!0})})),r.checked=h?s===a.trueValue:!0===s||"true"===s||"True"===s||1===s,i((function(){r.focus()})),r.addEventListener("change",(function(e){n(p())})),r.addEventListener("blur",(function(e){n(p(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&n(p()),27==e.keyCode&&o()})),r}},pe=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).currentCell=!1,i.mouseClick=!1,i.recursionBlock=!1,i.invalidEdit=!1,i.editedCells=[],i.editors=s.editors,i.registerColumnOption("editable"),i.registerColumnOption("editor"),i.registerColumnOption("editorParams"),i.registerColumnOption("cellEditing"),i.registerColumnOption("cellEdited"),i.registerColumnOption("cellEditCancelled"),i.registerTableFunction("getEditedCells",i.getEditedCells.bind(r(i))),i.registerTableFunction("clearCellEdited",i.clearCellEdited.bind(r(i))),i.registerTableFunction("navigatePrev",i.navigatePrev.bind(r(i))),i.registerTableFunction("navigateNext",i.navigateNext.bind(r(i))),i.registerTableFunction("navigateLeft",i.navigateLeft.bind(r(i))),i.registerTableFunction("navigateRight",i.navigateRight.bind(r(i))),i.registerTableFunction("navigateUp",i.navigateUp.bind(r(i))),i.registerTableFunction("navigateDown",i.navigateDown.bind(r(i))),i.registerComponentFunction("cell","isEdited",i.cellIsEdited.bind(r(i))),i.registerComponentFunction("cell","clearEdited",i.clearEdited.bind(r(i))),i.registerComponentFunction("cell","edit",i.editCell.bind(r(i))),i.registerComponentFunction("cell","cancelEdit",i.cellCancelEdit.bind(r(i))),i.registerComponentFunction("cell","navigatePrev",i.navigatePrev.bind(r(i))),i.registerComponentFunction("cell","navigateNext",i.navigateNext.bind(r(i))),i.registerComponentFunction("cell","navigateLeft",i.navigateLeft.bind(r(i))),i.registerComponentFunction("cell","navigateRight",i.navigateRight.bind(r(i))),i.registerComponentFunction("cell","navigateUp",i.navigateUp.bind(r(i))),i.registerComponentFunction("cell","navigateDown",i.navigateDown.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}},{key:"keybindingNavigateNext",value:function(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((function(){setTimeout((function(){t.getComponent().navigateNext()}))}))))}},{key:"cellIsEdited",value:function(e){return!!e.modules.edit&&e.modules.edit.edited}},{key:"cellCancelEdit",value:function(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}},{key:"updateCellClass",value:function(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}},{key:"clearCellEdited",value:function(e){var t=this;e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.table.modules.edit.clearEdited(e._getSelf())}))}},{key:"navigatePrev",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateLeft())return!0;if((t=this.table.rowManager.prevDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,t.cells.length)))return e.getComponent().edit(),!0}return!1}},{key:"navigateNext",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;if(i){if(n&&n.preventDefault(),e=this.navigateRight())return!0;if((t=this.table.rowManager.nextDisplayRow(i.row,!0))&&(e=this.findNextEditableCell(t,-1)))return e.getComponent().edit(),!0}return!1}},{key:"navigateLeft",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findPrevEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateRight",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.findNextEditableCell(i.row,e)))&&(t.getComponent().edit(),!0)}},{key:"navigateUp",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.prevDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"navigateDown",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentCell,n=arguments.length>1?arguments[1]:void 0;return!!(i&&(n&&n.preventDefault(),e=i.getIndex(),t=this.table.rowManager.nextDisplayRow(i.row,!0)))&&(t.cells[e].getComponent().edit(),!0)}},{key:"findNextEditableCell",value:function(e,t){var i=!1;if(t0)for(var n=t-1;n>=0;n--){var o=e.cells[n];if(o.column.modules.edit&&C.elVisible(o.getElement()))if(this.allowEdit(o)){i=o;break}}return i}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.editor&&this.initializeColumn(e)}},{key:"columnDeleteCheck",value:function(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}},{key:"rowDeleteCheck",value:function(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}},{key:"initializeColumn",value:function(t){var i={editor:!1,blocked:!1,check:t.definition.editable,params:t.definition.editorParams||{}};switch(e(t.definition.editor)){case"string":this.editors[t.definition.editor]?i.editor=this.editors[t.definition.editor]:console.warn("Editor Error - No such editor found: ",t.definition.editor);break;case"function":i.editor=t.definition.editor;break;case"boolean":!0===t.definition.editor&&("function"!=typeof t.definition.formatter?this.editors[t.definition.formatter]?i.editor=this.editors[t.definition.formatter]:i.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",t.definition.formatter))}i.editor&&(t.modules.edit=i)}},{key:"getCurrentCell",value:function(){return!!this.currentCell&&this.currentCell.getComponent()}},{key:"clearEditor",value:function(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}},{key:"cancelEdit",value:function(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}},{key:"bindEditor",value:function(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}},{key:"focusCellNoEvent",value:function(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}},{key:"editCell",value:function(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}},{key:"focusScrollAdjust",value:function(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,n=e.row.getElement();n.offsetTopi&&(this.table.rowManager.element.scrollTop+=n.offsetTop+n.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,a=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,s=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),a-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),a-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),s.offsetLefta&&(this.table.rowManager.element.scrollLeft+=s.offsetLeft+s.offsetWidth-a)}}},{key:"allowEdit",value:function(t){var i=!!t.column.modules.edit;if(t.column.modules.edit)switch(e(t.column.modules.edit.check)){case"function":i=t.column.modules.edit.check(t.getComponent());break;case"string":i=!!t.row.data[t.column.modules.edit.check];break;case"boolean":i=t.column.modules.edit.check}return i}},{key:"edit",value:function(e,t,i){var n,o,a,s=this,r=function(){},l=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(s.cancelEdit(),s.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),a="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(n=e.column.modules.edit.editor.call(s,o,(function(e){r=e}),(function(t){if(s.currentCell===e){var i=s.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===s.table.options.validationMode?(s.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==s.editedCells.indexOf(e)&&s.editedCells.push(e),e.setValue(t,!0),!0===i):(s.invalidEdit=!0,s.focusCellNoEvent(e,!0),r(),!1)}}),(function(){s.currentCell===e&&s.cancelEdit()}),a)))return l.blur(),!1;if(!(n instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",n),l.blur(),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(n),r();for(var u=l.children,c=0;c-1&&this.editedCells.splice(t,1)}}]),s}(N);pe.moduleName="edit",pe.editors=me;var fe=function e(i,n,o,a){t(this,e),this.type=i,this.columns=n,this.component=o||!1,this.indent=a||0},ge=function e(i,n,o,a,s){t(this,e),this.value=i,this.component=n||!1,this.width=o,this.height=a,this.depth=s},ve=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).config={},i.cloneTableStyle=!0,i.colVisProp="",i.registerTableOption("htmlOutputConfig",!1),i.registerColumnOption("htmlOutput"),i.registerColumnOption("titleHtmlOutput"),i}return n(s,[{key:"initialize",value:function(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}},{key:"generateExportList",value:function(e,t,i,n){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=n;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],a=this.bodyToExportRows(this.rowLookup(i));return o.concat(a)}},{key:"generateTable",value:function(e,t,i,n){var o=this.generateExportList(e,t,i,n);return this.generateTableElement(o)}},{key:"rowLookup",value:function(e){var t=this,i=[];if("function"==typeof e)e.call(this.table).forEach((function(e){(e=t.table.rowManager.findRow(e))&&i.push(e)}));else switch(e){case!0:case"visible":i=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":i=this.table.rowManager.rows;break;case"selected":i=this.table.modules.selectRow.selectedRows;break;case"active":default:i=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],i)}},{key:"generateColumnGroupHeaders",value:function(){var e=this,t=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((function(i){var n=e.processColumnGroup(i);n&&t.push(n)})),t}},{key:"processColumnGroup",value:function(e){var t=this,i=e.columns,n=0,o={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(i.length){if(o.subGroups=[],o.width=0,i.forEach((function(e){var i=t.processColumnGroup(e);i&&(o.width+=i.width,o.subGroups.push(i),i.depth>n&&(n=i.depth))})),o.depth+=n,!o.width)return!1}else{if(!this.columnVisCheck(e))return!1;o.width=1}return o}},{key:"columnVisCheck",value:function(e){var t=e.definition[this.colVisProp];return"function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1!==t&&(e.visible||!e.visible&&t)}},{key:"headersToExportRows",value:function(e){var t=[],i=0,n=[];function o(e,n){var a=i-n;if(void 0===t[n]&&(t[n]=[]),e.height=e.subGroups?1:a-e.depth+1,t[n].push(e),e.height>1)for(var s=1;s1)for(var r=1;ri&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((function(e){var t=[];e.forEach((function(e){if(e){var i=void 0===e.title?"":e.title;t.push(new ge(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),n.push(new fe("header",t))})),n}},{key:"bodyToExportRows",value:function(e){var t=this,i=[],n=[];return this.table.columnManager.columnsByIndex.forEach((function(e){t.columnVisCheck(e)&&i.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((function(e){switch(e.type){case"group":return!1!==t.config.rowGroups;case"calc":return!1!==t.config.columnCalcs;case"row":return!(t.table.options.dataTree&&!1===t.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach((function(e,o){var a=e.getData(t.colVisProp),s=[],r=0;switch(e.type){case"group":r=e.level,s.push(new ge(e.key,e.getComponent(),i.length,1));break;case"calc":case"row":i.forEach((function(e){s.push(new ge(e._column.getFieldValue(a),e,1,1))})),t.table.options.dataTree&&!1!==t.config.dataTree&&(r=e.modules.dataTree.index)}n.push(new fe(e.type,s,e.getComponent(),r))})),n}},{key:"generateTableElement",value:function(e){var t=this,i=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody"),a=this.lookupTableStyles(),s=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==s?s:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),i.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),n,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach((function(e,i){var s;switch(e.type){case"header":n.appendChild(t.generateHeaderElement(e,r,a));break;case"group":o.appendChild(t.generateGroupElement(e,r,a));break;case"calc":o.appendChild(t.generateCalcElement(e,r,a));break;case"row":s=t.generateRowElement(e,r,a),t.mapElementStyles(i%2&&a.evenRow?a.evenRow:a.oddRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),o.appendChild(s)}})),n.innerHTML&&i.appendChild(n),i.appendChild(o),this.mapElementStyles(this.table.element,i,["border-top","border-left","border-right","border-bottom"]),i}},{key:"lookupTableStyles",value:function(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}},{key:"generateHeaderElement",value:function(e,t,i){var n=this,o=document.createElement("tr");return e.columns.forEach((function(e){if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,n.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),n.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),n.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?n.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&n.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),o.appendChild(t)}})),o}},{key:"generateGroupElement",value:function(e,t,i){var n=document.createElement("tr"),o=document.createElement("td"),a=e.columns[0];return n.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?a.value=t.groupHeader[e.indent](a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(a.value=e.component._group.generator(a.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=a.width,o.innerHTML=a.value,n.classList.add("tabulator-print-table-group"),n.classList.add("tabulator-group-level-"+e.indent),a.component.isVisible()&&n.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),n.appendChild(o),n}},{key:"generateCalcElement",value:function(e,t,i){var n=this.generateRowElement(e,t,i);return n.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),n}},{key:"generateRowElement",value:function(t,i,n){var o=this,a=document.createElement("tr");return a.classList.add("tabulator-print-table-row"),t.columns.forEach((function(s,r){if(s){var l,u=document.createElement("td"),c=s.component._column,h=o.table.columnManager.findColumnIndex(c),d=s.value,m={modules:{},getValue:function(){return d},getField:function(){return c.definition.field},getElement:function(){return u},getColumn:function(){return c.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getComponent:function(){return m},column:c};if((c.definition.cssClass?c.definition.cssClass.split(" "):[]).forEach((function(e){u.classList.add(e)})),o.table.modExists("format")&&!1!==o.config.formatCells)d=o.table.modules.format.formatExportValue(m,o.colVisProp);else switch(e(d)){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?u.appendChild(d):u.innerHTML=d,(l=n.styleCells&&n.styleCells[h]?n.styleCells[h]:n.firstCell)&&(o.mapElementStyles(l,u,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),c.definition.align&&(u.style.textAlign=c.definition.align)),o.table.options.dataTree&&!1!==o.config.dataTree&&(i.treeElementField&&i.treeElementField==c.field||!i.treeElementField&&0==r)&&(t.component._row.modules.dataTree.controlEl&&u.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(!0),u.firstChild),t.component._row.modules.dataTree.branchEl&&u.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(!0),u.firstChild)),a.appendChild(u),m.modules.format&&m.modules.format.renderedCallback&&m.modules.format.renderedCallback(),i.rowFormatter&&!1!==o.config.formatCells&&i.rowFormatter(t.component)}})),a}},{key:"generateHTMLTable",value:function(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}},{key:"getHtml",value:function(e,t,i,n){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,n||"htmlOutput");return this.generateHTMLTable(o)}},{key:"mapElementStyles",value:function(e,t,i){if(this.cloneTableStyle&&e&&t){var n={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[n[e]]=o.getPropertyValue(e)}))}}}}]),s}(N);ve.moduleName="export";var be={"=":function(e,t,i,n){return t==e},"<":function(e,t,i,n){return t":function(e,t,i,n){return t>e},">=":function(e,t,i,n){return t>=e},"!=":function(e,t,i,n){return t!=e},regex:function(e,t,i,n){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,n){var o=e.toLowerCase().split(void 0===n.separator?" ":n.separator),a=String(null==t?"":t).toLowerCase(),s=[];return o.forEach((function(e){a.includes(e)&&s.push(!0)})),n.matchAll?s.length===o.length:!!s.length},starts:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,n){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,n){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}},ye=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).filterList=[],i.headerFilters={},i.headerFilterColumns=[],i.prevHeaderFilterChangeCheck="",i.prevHeaderFilterChangeCheck="{}",i.changed=!1,i.tableInitialized=!1,i.registerTableOption("filterMode","local"),i.registerTableOption("initialFilter",!1),i.registerTableOption("initialHeaderFilter",!1),i.registerTableOption("headerFilterLiveFilterDelay",300),i.registerColumnOption("headerFilter"),i.registerColumnOption("headerFilterPlaceholder"),i.registerColumnOption("headerFilterParams"),i.registerColumnOption("headerFilterEmptyCheck"),i.registerColumnOption("headerFilterFunc"),i.registerColumnOption("headerFilterFuncParams"),i.registerColumnOption("headerFilterLiveFilter"),i.registerTableFunction("searchRows",i.searchRows.bind(r(i))),i.registerTableFunction("searchData",i.searchData.bind(r(i))),i.registerTableFunction("setFilter",i.userSetFilter.bind(r(i))),i.registerTableFunction("refreshFilter",i.userRefreshFilter.bind(r(i))),i.registerTableFunction("addFilter",i.userAddFilter.bind(r(i))),i.registerTableFunction("getFilters",i.getFilters.bind(r(i))),i.registerTableFunction("setHeaderFilterFocus",i.userSetHeaderFilterFocus.bind(r(i))),i.registerTableFunction("getHeaderFilterValue",i.userGetHeaderFilterValue.bind(r(i))),i.registerTableFunction("setHeaderFilterValue",i.userSetHeaderFilterValue.bind(r(i))),i.registerTableFunction("getHeaderFilters",i.getHeaderFilters.bind(r(i))),i.registerTableFunction("removeFilter",i.userRemoveFilter.bind(r(i))),i.registerTableFunction("clearFilter",i.userClearFilter.bind(r(i))),i.registerTableFunction("clearHeaderFilter",i.userClearHeaderFilter.bind(r(i))),i.registerComponentFunction("column","headerFilterFocus",i.setHeaderFilterFocus.bind(r(i))),i.registerComponentFunction("column","reloadHeaderFilter",i.reloadHeaderFilter.bind(r(i))),i.registerComponentFunction("column","getHeaderFilterValue",i.getHeaderFilterValue.bind(r(i))),i.registerComponentFunction("column","setHeaderFilterValue",i.setHeaderFilterValue.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}},{key:"tableBuilt",value:function(){var e=this;this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((function(t){var i=e.table.columnManager.findColumn(t.field);if(!i)return console.warn("Column Filter Error - No matching column found:",t.field),!1;e.setHeaderFilterValue(i,t.value)})),this.tableInitialized=!0}},{key:"remoteFilterParams",value:function(e,t,i,n){return n.filter=this.getFilters(!0,!0),n}},{key:"userSetFilter",value:function(e,t,i,n){this.setFilter(e,t,i,n),this.refreshFilter()}},{key:"userRefreshFilter",value:function(){this.refreshFilter()}},{key:"userAddFilter",value:function(e,t,i,n){this.addFilter(e,t,i,n),this.refreshFilter()}},{key:"userSetHeaderFilterFocus",value:function(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}},{key:"userGetHeaderFilterValue",value:function(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}},{key:"userSetHeaderFilterValue",value:function(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}},{key:"userRemoveFilter",value:function(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}},{key:"userClearFilter",value:function(e){this.clearFilter(e),this.refreshFilter()}},{key:"userClearHeaderFilter",value:function(){this.clearHeaderFilter(),this.refreshFilter()}},{key:"searchRows",value:function(e,t,i){return this.search("rows",e,t,i)}},{key:"searchData",value:function(e,t,i){return this.search("data",e,t,i)}},{key:"initializeColumnHeaderFilter",value:function(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}},{key:"initializeColumn",value:function(t,i){var n=this,o=t.getField();t.modules.filter={success:function(i){var a,r="input"==t.modules.filter.tagType&&"text"==t.modules.filter.attrType||"textarea"==t.modules.filter.tagType?"partial":"match",l="",u="";if(void 0===t.modules.filter.prevSuccess||t.modules.filter.prevSuccess!==i){if(t.modules.filter.prevSuccess=i,t.modules.filter.emptyFunc(i))delete n.headerFilters[o];else{switch(t.modules.filter.value=i,e(t.definition.headerFilterFunc)){case"string":s.filters[t.definition.headerFilterFunc]?(l=t.definition.headerFilterFunc,a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,s.filters[t.definition.headerFilterFunc](i,o,e,n)}):console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc);break;case"function":l=a=function(e){var n=t.definition.headerFilterFuncParams||{},o=t.getFieldValue(e);return n="function"==typeof n?n(i,o,e):n,t.definition.headerFilterFunc(i,o,e,n)}}if(!a)switch(r){case"partial":a=function(e){var n=t.getFieldValue(e);return null!=n&&String(n).toLowerCase().indexOf(String(i).toLowerCase())>-1},l="like";break;default:a=function(e){return t.getFieldValue(e)==i},l="="}n.headerFilters[o]={value:i,func:a,type:l}}t.modules.filter.value=i,u=JSON.stringify(n.headerFilters),n.prevHeaderFilterChangeCheck!==u&&(n.prevHeaderFilterChangeCheck=u,n.trackChanges(),n.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(t)}},{key:"generateHeaderFilterElement",value:function(t,i,n){var o,a,s,r,l,u,c,h=this,d=this,m=t.modules.filter.success,p=t.getField();if(t.modules.filter.value=i,t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode&&t.contentElement.removeChild(t.modules.filter.headerElement.parentNode),p){switch(t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(o=document.createElement("div")).classList.add("tabulator-header-filter"),e(t.definition.headerFilter)){case"string":d.table.modules.edit.editors[t.definition.headerFilter]?(a=d.table.modules.edit.editors[t.definition.headerFilter],"tick"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor);break;case"function":a=t.definition.headerFilter;break;case"boolean":t.modules.edit&&t.modules.edit.editor?a=t.modules.edit.editor:t.definition.formatter&&d.table.modules.edit.editors[t.definition.formatter]?(a=d.table.modules.edit.editors[t.definition.formatter],"tick"!==t.definition.formatter&&"tickCross"!==t.definition.formatter||t.definition.headerFilterEmptyCheck||(t.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):a=d.table.modules.edit.editors.input}if(a){if(r={getValue:function(){return void 0!==i?i:""},getField:function(){return t.definition.field},getElement:function(){return o},getColumn:function(){return t.getComponent()},getTable:function(){return h.table},getRow:function(){return{normalizeHeight:function(){}}}},c="function"==typeof(c=t.definition.headerFilterParams||{})?c.call(d.table,r):c,!(s=a.call(this.table.modules.edit,r,(function(){}),m,(function(){}),c)))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor returned a value of false");if(!(s instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+p+" column, editor should return an instance of Node, the editor returned:",s);d.langBind("headerFilters|columns|"+t.definition.field,(function(e){s.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})),s.addEventListener("click",(function(e){e.stopPropagation(),s.focus()})),s.addEventListener("focus",(function(e){var t=h.table.columnManager.element.scrollLeft;t!==h.table.rowManager.element.scrollLeft+parseInt(h.table.columnManager.element.style.marginLeft)&&(h.table.rowManager.scrollHorizontal(t),h.table.columnManager.scrollHorizontal(t))})),l=!1,u=function(e){l&&clearTimeout(l),l=setTimeout((function(){m(s.value)}),d.table.options.headerFilterLiveFilterDelay)},t.modules.filter.headerElement=s,t.modules.filter.attrType=s.hasAttribute("type")?s.getAttribute("type").toLowerCase():"",t.modules.filter.tagType=s.tagName.toLowerCase(),!1!==t.definition.headerFilterLiveFilter&&("autocomplete"!==t.definition.headerFilter&&"tickCross"!==t.definition.headerFilter&&("autocomplete"!==t.definition.editor&&"tickCross"!==t.definition.editor||!0!==t.definition.headerFilter)&&(s.addEventListener("keyup",u),s.addEventListener("search",u),"number"==t.modules.filter.attrType&&s.addEventListener("change",(function(e){m(s.value)})),"text"==t.modules.filter.attrType&&"ie"!==this.table.browser&&s.setAttribute("type","search")),"input"!=t.modules.filter.tagType&&"select"!=t.modules.filter.tagType&&"textarea"!=t.modules.filter.tagType||s.addEventListener("mousedown",(function(e){e.stopPropagation()}))),o.appendChild(s),t.contentElement.appendChild(o),n||d.headerFilterColumns.push(t)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}},{key:"hideHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}},{key:"showHeaderFilterElements",value:function(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}},{key:"setHeaderFilterFocus",value:function(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}},{key:"getHeaderFilterValue",value:function(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}},{key:"setHeaderFilterValue",value:function(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"reloadHeaderFilter",value:function(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}},{key:"refreshFilter",value:function(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}},{key:"trackChanges",value:function(){this.changed=!0,this.dispatch("filter-changed")}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"setFilter",value:function(e,t,i,n){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),this.addFilter(e)}},{key:"addFilter",value:function(e,t,i,n){var o=this,a=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:n}]),e.forEach((function(e){(e=o.findFilter(e))&&(o.filterList.push(e),a=!0)})),a&&this.trackChanges()}},{key:"findFilter",value:function(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:s.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return s.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return s.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}},{key:"findSubFilters",value:function(e){var t=this,i=[];return e.forEach((function(e){(e=t.findFilter(e))&&i.push(e)})),!!i.length&&i}},{key:"getFilters",value:function(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}},{key:"filtersToArray",value:function(e,t){var i=this,n=[];return e.forEach((function(e){var o;Array.isArray(e)?n.push(i.filtersToArray(e,t)):(o={field:e.field,type:e.type,value:e.value},t&&"function"==typeof o.type&&(o.type="function"),n.push(o))})),n}},{key:"getHeaderFilters",value:function(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}},{key:"removeFilter",value:function(t,i,n){var o=this;Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(t){var i=-1;(i="object"==e(t.field)?o.filterList.findIndex((function(e){return t===e})):o.filterList.findIndex((function(e){return t.field===e.field&&t.type===e.type&&t.value===e.value})))>-1?o.filterList.splice(i,1):console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)})),this.trackChanges()}},{key:"clearFilter",value:function(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}},{key:"clearHeaderFilter",value:function(){var e=this;this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((function(t){void 0!==t.modules.filter.value&&delete t.modules.filter.value,t.modules.filter.prevSuccess=void 0,e.reloadHeaderFilter(t)})),this.trackChanges()}},{key:"search",value:function(e,t,i,n){var o=this,a=[],s=[];return Array.isArray(t)||(t=[{field:t,type:i,value:n}]),t.forEach((function(e){(e=o.findFilter(e))&&s.push(e)})),this.table.rowManager.rows.forEach((function(t){var i=!0;s.forEach((function(e){o.filterRecurse(e,t.getData())||(i=!1)})),i&&a.push("data"===e?t.getData("data"):t.getComponent())})),a}},{key:"filter",value:function(e,t){var i=this,n=[],o=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((function(e){i.filterRow(e)&&n.push(e)})):n=e.slice(0),this.subscribedExternal("dataFiltered")&&(n.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),o)),n}},{key:"filterRow",value:function(e,t){var i=this,n=!0,o=e.getData();for(var a in this.filterList.forEach((function(e){i.filterRecurse(e,o)||(n=!1)})),this.headerFilters)this.headerFilters[a].func(o)||(n=!1);return n}},{key:"filterRecurse",value:function(e,t){var i=this,n=!1;return Array.isArray(e)?e.forEach((function(e){i.filterRecurse(e,t)&&(n=!0)})):n=e.func(t),n}}]),s}(N);ye.moduleName="filter",ye.filters=be;var we={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var n,o,a,s,r=parseFloat(e.getValue()),l="",u=t.decimal||".",c=t.thousand||",",h=t.negativeSign||"-",d=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(r))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(r<0&&(r=Math.abs(r),l=h),n=!1!==p?r.toFixed(p):r,o=(n=String(n).split("."))[0],a=n.length>1?u+n[1]:"",!1!==t.thousand)for(s=/(\d+)(\d{3})/;s.test(o);)o=o.replace(s,"$1"+c+"$2");return m?l+o+a+d:l+d+o+a},link:function(t,i,n){var o,a=t.getValue(),s=i.urlPrefix||"",r=i.download,l=a,u=document.createElement("a");if(i.labelField&&(o=t.getData(),l=function t(i,n){var o=n[i.shift()];return i.length&&"object"===e(o)?t(i,o):o}(i.labelField.split(this.table.options.nestedFieldSeparator),o)),i.label)switch(e(i.label)){case"string":l=i.label;break;case"function":l=i.label(t)}if(l){if(i.urlField&&(a=(o=t.getData())[i.urlField]),i.url)switch(e(i.url)){case"string":a=i.url;break;case"function":a=i.url(t)}return u.setAttribute("href",s+a),i.target&&u.setAttribute("target",i.target),i.download&&(r="function"==typeof r?r(t):!0===r?"":r,u.setAttribute("download",r)),u.innerHTML=this.emptyToSpace(this.sanitizeHTML(l)),u}return" "},image:function(t,i,n){var o=document.createElement("img"),a=t.getValue();switch(i.urlPrefix&&(a=i.urlPrefix+t.getValue()),i.urlSuffix&&(a+=i.urlSuffix),o.setAttribute("src",a),e(i.height)){case"number":o.style.height=i.height+"px";break;case"string":o.style.height=i.height}switch(e(i.width)){case"number":o.style.width=i.width+"px";break;case"string":o.style.width=i.width}return o.addEventListener("load",(function(){t.getRow().normalizeHeight()})),o},tickCross:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t.allowEmpty,s=t.allowTruthy,r=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',u=void 0!==t.crossElement?t.crossElement:'';return r&&n===t.trueValue||!r&&(s&&n||!0===n||"true"===n||"True"===n||1===n||"1"===n)?(o.setAttribute("aria-checked",!0),l||""):!a||"null"!==n&&""!==n&&null!=n?(o.setAttribute("aria-checked",!1),u||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",s=t.outputFormat||"dd/MM/yyyy HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(n=o.isDateTime(l)?l:"iso"===a?o.fromISO(String(l)):o.fromFormat(String(l),a)).isValid?(t.timezone&&(n=n.setZone(t.timezone)),n.toFormat(s)):!0!==r&&l?"function"==typeof r?r(l):r:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var n,o=window.DateTime||luxon.DateTime,a=t.inputFormat||"yyyy-MM-dd HH:mm:ss",s=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",r=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",u=void 0!==t.humanize&&t.humanize,c=void 0!==t.date?t.date:o.now(),h=e.getValue();if(void 0!==o)return(n=o.isDateTime(h)?h:"iso"===a?o.fromISO(String(h)):o.fromFormat(String(h),a)).isValid?u?n.diff(c,l).toHuman()+(r?" "+r:""):parseInt(n.diff(c,l)[l])+(r?" "+r:""):!0===s?h:"function"==typeof s?s(h):s;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var n=e.getValue();return void 0===t[n]?(console.warn("Missing display value for "+n),n):t[n]},star:function(e,t,i){var n=e.getValue(),o=e.getElement(),a=t&&t.stars?t.stars:5,s=document.createElement("span"),r=document.createElementNS("http://www.w3.org/2000/svg","svg");s.style.verticalAlign="middle",r.setAttribute("width","14"),r.setAttribute("height","14"),r.setAttribute("viewBox","0 0 512 512"),r.setAttribute("xml:space","preserve"),r.style.padding="0 1px",n=n&&!isNaN(n)?parseInt(n):0,n=Math.max(0,Math.min(n,a));for(var l=1;l<=a;l++){var u=r.cloneNode(!0);u.innerHTML=l<=n?'':'',s.appendChild(u)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",n),s},traffic:function(t,i,n){var o,a,s=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),l=i&&i.max?i.max:100,u=i&&i.min?i.min:0,c=i&&void 0!==i.color?i.color:["red","orange","green"],h="#666666";if(!isNaN(s)&&void 0!==t.getValue()){switch(r.classList.add("tabulator-traffic-light"),a=parseFloat(s)<=l?parseFloat(s):l,a=parseFloat(a)>=u?parseFloat(a):u,o=(l-u)/100,a=Math.round((a-u)/o),e(c)){case"string":h=c;break;case"function":h=c(s);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),h=c[m=Math.max(m,0)];break}}return r.style.backgroundColor=h,r}},progress:function(t){var i,n,o,a,s,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0,u=this.sanitizeHTML(t.getValue())||0,c=t.getElement(),h=r.max?r.max:100,d=r.min?r.min:0,m=r.legendAlign?r.legendAlign:"center";switch(n=parseFloat(u)<=h?parseFloat(u):h,n=parseFloat(n)>=d?parseFloat(n):d,i=(h-d)/100,n=Math.round((n-d)/i),e(r.color)){case"string":o=r.color;break;case"function":o=r.color(u);break;case"object":if(Array.isArray(r.color)){var p=100/r.color.length,f=Math.floor(n/p);f=Math.min(f,r.color.length-1),f=Math.max(f,0),o=r.color[f];break}default:o="#2DC214"}switch(e(r.legend)){case"string":a=r.legend;break;case"function":a=r.legend(u);break;case"boolean":a=u;break;default:a=!1}switch(e(r.legendColor)){case"string":s=r.legendColor;break;case"function":s=r.legendColor(u);break;case"object":if(Array.isArray(r.legendColor)){var g=100/r.legendColor.length,v=Math.floor(n/g);v=Math.min(v,r.legendColor.length-1),v=Math.max(v,0),s=r.legendColor[v]}break;default:s="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",n);var y=document.createElement("div");y.style.display="inline-block",y.style.width=n+"%",y.style.backgroundColor=o,y.style.height="100%",y.setAttribute("data-max",h),y.setAttribute("data-min",d);var w=document.createElement("div");if(w.style.position="relative",w.style.width="100%",w.style.height="100%",a){var C=document.createElement("div");C.style.position="absolute",C.style.top=0,C.style.left=0,C.style.textAlign=m,C.style.width="100%",C.style.color=s,C.innerHTML=a}return l((function(){if(!(t instanceof b)){var e=document.createElement("div");e.style.position="absolute",e.style.top="4px",e.style.bottom="4px",e.style.left="4px",e.style.right="4px",c.appendChild(e),c=e}c.appendChild(w),w.appendChild(y),a&&w.appendChild(C)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){var n=document.createElement("span");return e.getRow().watchPosition((function(e){n.innerText=e})),n},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var n=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function a(e){var t=o.element;o.open=e,t&&(o.open?(n.classList.add("open"),t.style.display=""):(n.classList.remove("open"),t.style.display="none"))}return n.classList.add("tabulator-responsive-collapse-toggle"),n.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),n.addEventListener("click",(function(t){t.stopImmediatePropagation(),a(!o.open),e.getTable().rowManager.adjustTableSize()})),a(o.open),n},rowSelection:function(e,t,i){var n=this,o=document.createElement("input"),a=!1;if(o.type="checkbox",o.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(o.addEventListener("click",(function(e){e.stopPropagation()})),"function"==typeof e.getRow){var s=e.getRow();s instanceof M?(o.addEventListener("change",(function(e){"click"===n.table.options.selectableRangeMode&&a?a=!1:s.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&o.addEventListener("click",(function(e){a=!0,n.table.modules.selectRow.handleComplexRowClick(s._row,e)})),o.checked=s.isSelected&&s.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(s,o)):o=""}else o.addEventListener("change",(function(e){n.table.modules.selectRow.selectedRows.length?n.table.deselectRow():n.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Ce=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).registerColumnOption("formatter"),i.registerColumnOption("formatterParams"),i.registerColumnOption("formatterPrint"),i.registerColumnOption("formatterPrintParams"),i.registerColumnOption("formatterClipboard"),i.registerColumnOption("formatterClipboardParams"),i.registerColumnOption("formatterHtmlOutput"),i.registerColumnOption("formatterHtmlOutputParams"),i.registerColumnOption("titleFormatter"),i.registerColumnOption("titleFormatterParams"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}},{key:"initializeColumn",value:function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}},{key:"lookupFormatter",value:function(t,i){var n={params:t.definition["formatter"+i+"Params"]||{}},o=t.definition["formatter"+i];switch(e(o)){case"string":s.formatters[o]?n.formatter=s.formatters[o]:(console.warn("Formatter Error - No such formatter found: ",o),n.formatter=s.formatters.plaintext);break;case"function":n.formatter=o;break;default:n.formatter=s.formatters.plaintext}return n}},{key:"cellRendered",value:function(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}},{key:"formatHeader",value:function(e,t,i){var n,o,a,s;return e.definition.titleFormatter?(n=this.getFormatter(e.definition.titleFormatter),a=function(t){e.titleFormatterRendered=t},s={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,n.call(this,s,o,a)):t}},{key:"formatValue",value:function(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}},{key:"formatExportValue",value:function(e,t){var i,n=e.column.modules.format[t];if(n){return i="function"==typeof n.params?n.params(e.getComponent()):n.params,n.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}},{key:"sanitizeHTML",value:function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}},{key:"emptyToSpace",value:function(e){return null==e||""===e?" ":e}},{key:"getFormatter",value:function(t){switch(e(t)){case"string":s.formatters[t]?t=s.formatters[t]:(console.warn("Formatter Error - No such formatter found: ",t),t=s.formatters.plaintext);break;case"function":break;default:t=s.formatters.plaintext}return t}}]),s}(N);Ce.moduleName="format",Ce.formatters=we;var ke=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).leftColumns=[],n.rightColumns=[],n.leftMargin=0,n.rightMargin=0,n.rightPadding=0,n.initializationMode="left",n.active=!1,n.blocked=!0,n.registerColumnOption("frozen"),n}return n(a,[{key:"reset",value:function(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}},{key:"initialize",value:function(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}},{key:"blockLayout",value:function(){this.blocked=!0}},{key:"unblockLayout",value:function(){this.blocked=!1}},{key:"layoutCell",value:function(e){this.layoutElement(e.element,e.column)}},{key:"reinitializeColumns",value:function(){var e=this;this.reset(),this.table.columnManager.columnsByIndex.forEach((function(t){e.initializeColumn(t)}))}},{key:"initializeColumn",value:function(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}},{key:"frozenCheck",value:function(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}},{key:"scrollHorizontal",value:function(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}},{key:"calcMargins",value:function(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}},{key:"layoutCalcRows",value:function(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}},{key:"layoutGroupCalcs",value:function(e){var t=this;e.forEach((function(e){e.calcs.top&&t.layoutRow(e.calcs.top),e.calcs.bottom&&t.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&t.layoutGroupCalcs(e.groupList)}))}},{key:"layoutColumnPosition",value:function(e){var t=this,i=[],n=0,o=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach((function(o,a){if(o.modules.frozen.marginValue=n+t.table.columnManager.scrollLeft,o.modules.frozen.margin=o.modules.frozen.marginValue+"px",o.visible&&(n+=o.getWidth()),a==t.leftColumns.length-1?o.modules.frozen.edge=!0:o.modules.frozen.edge=!1,o.parent.isGroup){var s=t.getColGroupParentElement(o);i.includes(s)||(t.layoutElement(s,o),i.push(s)),o.modules.frozen.edge&&s.classList.add("tabulator-frozen-"+o.modules.frozen.position)}else t.layoutElement(o.getElement(),o);e&&o.cells.forEach((function(e){t.layoutElement(e.getElement(!0),o)}))})),this.rightColumns.forEach((function(i,n){i.visible&&(o+=i.getWidth()),i.modules.frozen.marginValue=t.rightPadding-o,i.modules.frozen.margin=i.modules.frozen.marginValue+"px",n==t.rightColumns.length-1?i.modules.frozen.edge=!0:i.modules.frozen.edge=!1,i.parent.isGroup?t.layoutElement(t.getColGroupParentElement(i),i):t.layoutElement(i.getElement(),i),e&&i.cells.forEach((function(e){t.layoutElement(e.getElement(!0),i)}))}))}},{key:"getColGroupParentElement",value:function(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}},{key:"layout",value:function(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}},{key:"reinitializeRows",value:function(){var e=this,t=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((function(e){return!t.includes(e)})).forEach((function(e){e.deinitialize()})),t.forEach((function(t){"row"===t.type&&e.layoutRow(t)}))}},{key:"layoutRow",value:function(e){var t=this;e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)})),this.rightColumns.forEach((function(i){var n=e.getCell(i);n&&t.layoutElement(n.getElement(!0),i)}))}},{key:"layoutElement",value:function(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}},{key:"_calcSpace",value:function(e,t){for(var i=0,n=0;n-1}},{key:"isFrozen",value:function(){return!!this.rows.length}},{key:"visibleRows",value:function(e,t){return this.rows.forEach((function(e){t.push(e)})),t}},{key:"getRows",value:function(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}},{key:"freezeRow",value:function(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}},{key:"unfreezeRow",value:function(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}},{key:"detachRow",value:function(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}},{key:"styleRows",value:function(e){var t=this;this.rows.forEach((function(e,i){t.table.rowManager.styleRow(e,i)}))}}]),s}(N);Ee.moduleName="frozenRows";var Re=function(){function e(i){return t(this,e),this._group=i,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}return n(e,[{key:"getKey",value:function(){return this._group.key}},{key:"getField",value:function(){return this._group.field}},{key:"getElement",value:function(){return this._group.element}},{key:"getRows",value:function(){return this._group.getRows(!0)}},{key:"getSubGroups",value:function(){return this._group.getSubGroups(!0)}},{key:"getParentGroup",value:function(){return!!this._group.parent&&this._group.parent.getComponent()}},{key:"isVisible",value:function(){return this._group._visible}},{key:"show",value:function(){this._group.show()}},{key:"hide",value:function(){this._group.hide()}},{key:"toggle",value:function(){this._group.toggleVisibility()}},{key:"_getSelf",value:function(){return this._group}},{key:"getTable",value:function(){return this._group.groupManager.table}}]),e}(),xe=function(){function e(i,n,o,a,s,r,l){t(this,e),this.groupManager=i,this.parent=n,this.key=a,this.level=o,this.field=s,this.hasSubGroups=o-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}},{key:"scrollHeader",value:function(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"getRowIndex",value:function(e){}},{key:"conformRowData",value:function(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}},{key:"removeRow",value:function(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}},{key:"getHeadersAndRows",value:function(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}},{key:"getData",value:function(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((function(e){i.push(e.getData(t||"data"))})),i}},{key:"getRowCount",value:function(){var e=0;return this.groupList.length?this.groupList.forEach((function(t){e+=t.getRowCount()})):e=this.rows.length,e}},{key:"toggleVisibility",value:function(){this.visible?this.hide():this.show()}},{key:"hide",value:function(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((function(e){e.getHeadersAndRows().forEach((function(e){e.detachElement()}))})):this.rows.forEach((function(e){var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}},{key:"show",value:function(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((function(t){t.getHeadersAndRows().forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((function(t){var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}},{key:"_visSet",value:function(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}},{key:"getRowGroup",value:function(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})):this.rows.find((function(t){return t===e}))&&(t=this),t}},{key:"getSubGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getRows",value:function(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"generateGroupHeaderContents",value:function(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}},{key:"getPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}},{key:"getElement",value:function(){return this.elementContents?this.element:this.generateElement()}},{key:"generateElement",value:function(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;en.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",(function(t,i){e.headerGenerator[0]=function(e,n,o){return(void 0===e?"":e)+"("+n+" "+(1===n?t:i.groups.items)+")"}})),this.groupIDLookups=[],Array.isArray(t))this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((function(t){t.definition.topCalc&&e.table.modules.columnCalcs.initializeTopRow(),t.definition.bottomCalc&&e.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(t)||(t=[t]),t.forEach((function(t,i){var n,o;n="function"==typeof t?t:(o=e.table.columnManager.getColumnByField(t))?function(e){return o.getFieldValue(e)}:function(e){return e[t]},e.groupIDLookups.push({field:"function"!=typeof t&&t,func:n,values:!!e.allowedValues&&e.allowedValues[i]})})),i&&(Array.isArray(i)||(i=[i]),i.forEach((function(e){})),this.startOpen=i),n&&(this.headerGenerator=Array.isArray(n)?n:[n])}else this.groupList=[],this.groups={}}},{key:"rowSample",value:function(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}},{key:"virtualRenderFill",value:function(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((function(e){return"group"!==e.type})),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}},{key:"rowAddingIndex",value:function(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var n=e.modules.group.rows;return n.length>1&&(!t||t&&-1==n.indexOf(t)?i?n[0]!==e&&(t=n[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):n[n.length-1]!==e&&(t=n[n.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}},{key:"trackChanges",value:function(){this.dispatch("group-changed")}},{key:"setGroupBy",value:function(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupValues",value:function(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}},{key:"setGroupStartOpen",value:function(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"setGroupHeader",value:function(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}},{key:"userGetGroups",value:function(e){return this.getGroups(!0)}},{key:"userGetGroupedData",value:function(){return this.table.options.groupBy?this.getGroupedData():this.getData()}},{key:"rowGetGroup",value:function(e){return!!e.modules.group&&e.modules.group.getComponent()}},{key:"rowMoving",value:function(e,t,i){if(this.table.options.groupBy){!i&&t instanceof xe&&(t=this.table.rowManager.prevDisplayRow(e)||t);var n=t instanceof xe?t:t.modules.group,o=e instanceof xe?e:e.modules.group;n===o?this.table.rowManager.moveRowInArray(n.rows,e,t,i):(o&&o.removeRow(e),n.insertRow(e,t,i))}}},{key:"rowDeleting",value:function(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}},{key:"rowsUpdated",value:function(e){this.table.options.groupBy&&this.updateGroupRows(!0)}},{key:"cellUpdated",value:function(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}},{key:"getRows",value:function(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}},{key:"getGroups",value:function(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}},{key:"getChildGroups",value:function(e){var t=this,i=[];return e||(e=this),e.groupList.forEach((function(e){e.groupList.length?i=i.concat(t.getChildGroups(e)):i.push(e)})),i}},{key:"wipe",value:function(){this.table.options.groupBy&&this.groupList.forEach((function(e){e.wipe()}))}},{key:"pullGroupListData",value:function(e){var t=this,i=[];return e.forEach((function(e){var n={level:0,rowCount:0,headerContent:""},o=[];e.hasSubGroups?(o=t.pullGroupListData(e.groupList),n.level=e.level,n.rowCount=o.length-e.groupList.length,n.headerContent=e.generator(e.key,n.rowCount,e.rows,e),i.push(n),i=i.concat(o)):(n.level=e.level,n.headerContent=e.generator(e.key,e.rows.length,e.rows,e),n.rowCount=e.getRows().length,i.push(n),e.getRows().forEach((function(e){i.push(e.getData("data"))})))})),i}},{key:"getGroupedData",value:function(){return this.pullGroupListData(this.groupList)}},{key:"getRowGroup",value:function(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((function(i){var n=i.getRowGroup(e);n&&(t=n)})),t}},{key:"countGroups",value:function(){return this.groupList.length}},{key:"generateGroups",value:function(e){var t=this,i=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((function(e){t.createGroup(e,0,i)})),e.forEach((function(e){t.assignRowToExistingGroup(e,i)}))):e.forEach((function(e){t.assignRowToGroup(e,i)}))}},{key:"createGroup",value:function(e,t,i){var n,o=t+"_"+e;i=i||[],n=new xe(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=n,this.groupList.push(n)}},{key:"assignRowToExistingGroup",value:function(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}},{key:"assignRowToGroup",value:function(e,t){var i=this.groupIDLookups[0].func(e.getData()),n=!this.groups["0_"+i];return n&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!n}},{key:"reassignRowToGroup",value:function(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),n=this.getExpectedPath(e);i.length==n.length&&i.every((function(e,t){return e===n[t]}))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}},{key:"getExpectedPath",value:function(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((function(e){t.push(e.func(i))})),t}},{key:"updateGroupRows",value:function(e){var t=[];return this.groupList.forEach((function(e){t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}},{key:"scrollHeaders",value:function(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((function(t){t.scrollHeader(e)})))}},{key:"removeGroup",value:function(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}},{key:"checkBasicModeGroupHeaderWidth",value:function(){var e=this,t=this.table.rowManager.tableElement,i=!0;this.table.rowManager.getDisplayRows().forEach((function(n,o){e.table.rowManager.styleRow(n,o),t.appendChild(n.getElement()),n.initialize(!0),"group"!==n.type&&(i=!1)})),t.style.minWidth=i?this.table.columnManager.getWidth()+"px":""}}]),a}(N);Te.moduleName="groupRows";var Me=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).history=[],n.index=-1,n.registerTableOption("history",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}},{key:"rowMoved",value:function(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}},{key:"rowAdded",value:function(e,t,i,n){this.action("rowAdd",e,{data:t,pos:i,index:n})}},{key:"rowDeleted",value:function(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}},{key:"cellUpdated",value:function(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}},{key:"clear",value:function(){this.history=[],this.index=-1}},{key:"action",value:function(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}},{key:"getHistoryUndoSize",value:function(){return this.index+1}},{key:"getHistoryRedoSize",value:function(){return this.history.length-(this.index+1)}},{key:"clearComponentHistory",value:function(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}},{key:"undo",value:function(){if(this.index>-1){var e=this.history[this.index];return a.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}},{key:"redo",value:function(){if(this.history.length-1>this.index){this.index++;var e=this.history[this.index];return a.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}},{key:"_rebindRow",value:function(e,t){this.history.forEach((function(i){if(i.component instanceof L)i.component===e&&(i.component=t);else if(i.component instanceof y&&i.component.row===e){var n=i.component.column.getField();n&&(i.component=t.getCell(n))}}))}}]),a}(N);Me.moduleName="history",Me.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},Me.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};var Le=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).fieldIndex=[],i.hasIndex=!1,i}return n(s,[{key:"initialize",value:function(){this.tableElementCheck()}},{key:"tableElementCheck",value:function(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}},{key:"parseTable",value:function(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),n=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),n=n?n.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,n):this._generateBlankHeaders(i,n);for(var a=0;a-1&&e.pressedKeys.splice(n,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}},{key:"clearBindings",value:function(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}},{key:"checkBinding",value:function(e,t){var i=this,n=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((function(e){-1==i.pressedKeys.indexOf(e)&&(n=!1)})),n&&t.action.call(this,e),!0)}}]),s}(N);ze.moduleName="keybindings",ze.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},ze.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,n=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=n?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};var Fe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).menuContainer=null,n.nestedMenuBlock=!1,n.currentComponent=null,n.rootPopup=null,n.columnSubscribers={},n.registerTableOption("menuContainer",void 0),n.registerTableOption("rowContextMenu",!1),n.registerTableOption("rowClickMenu",!1),n.registerTableOption("groupContextMenu",!1),n.registerTableOption("groupClickMenu",!1),n.registerColumnOption("headerContextMenu"),n.registerColumnOption("headerClickMenu"),n.registerColumnOption("headerMenu"),n.registerColumnOption("headerMenuIcon"),n.registerColumnOption("contextMenu"),n.registerColumnOption("clickMenu"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}},{key:"initializeColumnHeaderMenu",value:function(e){var t,i=this,n=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadMenuTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}},{key:"loadMenuTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}},{key:"loadMenuEvent",value:function(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}},{key:"loadMenu",value:function(e,t,i,n,o){var a,s=this,r=!(e instanceof MouseEvent),l=document.createElement("div");if(l.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(n)a=o.child(l);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((function(){s.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=a=this.popup(l)}i.forEach((function(e){var i=document.createElement("div"),n=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof n&&(n=n.call(s.table,t.getComponent())),n instanceof Node?i.appendChild(n):i.innerHTML=n,"function"==typeof o&&(o=o.call(s.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(function(e){e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(function(n){n.stopPropagation(),s.loadMenu(n,t,e.menu,i,a)})):e.action&&i.addEventListener("click",(function(i){e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),l.appendChild(i)})),l.addEventListener("click",(function(e){s.rootPopup.hide()})),a.show(n||e),a===this.rootPopup&&(this.rootPopup.hideOnBlur((function(){s.rootPopup=null,s.currentComponent&&(s.dispatchExternal("menuClosed",s.currentComponent.getComponent()),s.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}]),a}(N);Fe.moduleName="menu";var He=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).placeholderElement=n.createPlaceholderElement(),n.hoverElement=!1,n.checkTimeout=!1,n.checkPeriod=250,n.moving=!1,n.toCol=!1,n.toColAfter=!1,n.startX=0,n.autoScrollMargin=40,n.autoScrollStep=5,n.autoScrollTimeout=!1,n.touchMove=!1,n.moveHover=n.moveHover.bind(r(n)),n.endMove=n.endMove.bind(r(n)),n.registerTableOption("movableColumns",!1),n}return n(a,[{key:"createPlaceholderElement",value:function(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}},{key:"initialize",value:function(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeColumn",value:function(e){var t,i=this,n={};e.modules.frozen||e.isGroup||(t=e.getElement(),n.mousemove=function(n){e.parent===i.moving.parent&&((i.touchMove?n.touches[0].pageX:n.pageX)-C.elOffset(t).left+i.table.columnManager.element.scrollLeft>e.getWidth()/2?i.toCol===e&&i.toColAfter||(t.parentNode.insertBefore(i.placeholderElement,t.nextSibling),i.moveColumn(e,!0)):(i.toCol!==e||i.toColAfter)&&(t.parentNode.insertBefore(i.placeholderElement,t),i.moveColumn(e,!1)))}.bind(i),t.addEventListener("mousedown",(function(t){i.touchMove=!1,1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),i.bindTouchEvents(e)),e.modules.moveColumn=n}},{key:"bindTouchEvents",value:function(e){var t,i,n,o,a,s,r=this,l=e.getElement(),u=!1;l.addEventListener("touchstart",(function(l){r.checkTimeout=setTimeout((function(){r.touchMove=!0,t=e.nextColumn(),n=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,a=0,s=0,u=!1,r.startMove(l,e)}),r.checkPeriod)}),{passive:!0}),l.addEventListener("touchmove",(function(l){var c,h;r.moving&&(r.moveHover(l),u||(u=l.touches[0].pageX),(c=l.touches[0].pageX-u)>0?t&&c-a>n&&(h=t)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(r.placeholderElement,h.getElement().nextSibling),r.moveColumn(h,!0)):i&&-c-s>o&&(h=i)!==e&&(u=l.touches[0].pageX,h.getElement().parentNode.insertBefore(r.placeholderElement,h.getElement()),r.moveColumn(h,!1)),h&&(t=h.nextColumn(),a=n,n=t?t.getWidth()/2:0,i=h.prevColumn(),s=o,o=i?i.getWidth()/2:0))}),{passive:!0}),l.addEventListener("touchend",(function(e){r.checkTimeout&&clearTimeout(r.checkTimeout),r.moving&&r.endMove(e)}))}},{key:"startMove",value:function(e,t){var i=t.getElement(),n=this.table.columnManager.getElement(),o=this.table.columnManager.getHeadersElement();this.moving=t,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-C.elOffset(i).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=n.clientHeight-o.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}},{key:"_bindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}},{key:"moveColumn",value:function(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n.nextSibling)})):e.getCells().forEach((function(e,t){var n=e.getElement(!0);n.parentNode&&i[t]&&n.parentNode.insertBefore(i[t].getElement(),n)}))}},{key:"endMove",value:function(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}},{key:"moveHover",value:function(e){var t,i=this,n=this.table.columnManager.getElement(),o=n.scrollLeft,a=(this.touchMove?e.touches[0].pageX:e.pageX)-C.elOffset(n).left+o;this.hoverElement.style.left=a-this.startX+"px",a-oe.getHeight()/2?t.toRow===e&&t.toRowAfter||((n=e.getElement()).parentNode.insertBefore(t.placeholderElement,n.nextSibling),t.moveRow(e,!0)):(t.toRow!==e||t.toRowAfter)&&(n=e.getElement()).previousSibling&&(n.parentNode.insertBefore(t.placeholderElement,n),t.moveRow(e,!1))}.bind(t),e.modules.moveRow=i}},{key:"initializeRow",value:function(e){var t,i=this,n={};n.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),n.mousemove=function(t){var n=e.getElement();t.pageY-C.elOffset(n).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||(n.parentNode.insertBefore(i.placeholderElement,n.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(n.parentNode.insertBefore(i.placeholderElement,n),i.moveRow(e,!1))}.bind(i),this.hasHandle||((t=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(i.checkTimeout=setTimeout((function(){i.startMove(t,e)}),i.checkPeriod))})),t.addEventListener("mouseup",(function(e){1===e.which&&i.checkTimeout&&clearTimeout(i.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=n}},{key:"initializeColumn",value:function(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}},{key:"initializeCell",value:function(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}},{key:"bindTouchEvents",value:function(e,t){var i,n,o,a,s,r,l=this,u=!1;t.addEventListener("touchstart",(function(t){l.checkTimeout=setTimeout((function(){l.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,n=e.prevRow(),a=n?n.getHeight()/2:0,s=0,r=0,u=!1,l.startMove(t,e)}),l.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(function(t){var c,h;l.moving&&(t.preventDefault(),l.moveHover(t),u||(u=t.touches[0].pageY),(c=t.touches[0].pageY-u)>0?i&&c-s>o&&(h=i)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement().nextSibling),l.moveRow(h,!0)):n&&-c-r>a&&(h=n)!==e&&(u=t.touches[0].pageY,h.getElement().parentNode.insertBefore(l.placeholderElement,h.getElement()),l.moveRow(h,!1)),h&&(i=h.nextRow(),s=o,o=i?i.getHeight()/2:0,n=h.prevRow(),r=a,a=n?n.getHeight()/2:0))})),t.addEventListener("touchend",(function(e){l.checkTimeout&&clearTimeout(l.checkTimeout),l.moving&&(l.endMove(e),l.touchMove=!1)}))}},{key:"_bindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"_unbindMouseMove",value:function(){this.table.rowManager.getDisplayRows().forEach((function(e){("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}},{key:"startMove",value:function(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}},{key:"setStartPosition",value:function(e,t){var i,n,o=this.touchMove?e.touches[0].pageX:e.pageX,a=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(n=i.getBoundingClientRect(),this.startX=n.left-o+window.pageXOffset,this.startY=n.top-a+window.pageYOffset):this.startY=a-i.getBoundingClientRect().top}},{key:"endMove",value:function(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}},{key:"moveRow",value:function(e,t){this.toRow=e,this.toRowAfter=t}},{key:"moveHover",value:function(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}},{key:"moveHoverTable",value:function(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,n=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(n-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}},{key:"moveHoverConnections",value:function(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}},{key:"elementRowDrop",value:function(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}},{key:"connectToTables",value:function(e){var t,i=this;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((function(e){"string"==typeof e?i.connectionElements=i.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):i.connectionElements.push(e)})),this.connectionElements.forEach((function(e){var t=function(t){i.elementRowDrop(t,e,i.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}},{key:"disconnectFromTables",value:function(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((function(e){e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}},{key:"connect",value:function(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}},{key:"disconnect",value:function(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((function(e){"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}},{key:"dropComplete",value:function(t,i,n){var o=!1;if(n){switch(e(this.table.options.movableRowsSender)){case"string":o=this.senders[this.table.options.movableRowsSender];break;case"function":o=this.table.options.movableRowsSender}o?o.call(this,this.moving?this.moving.getComponent():void 0,i?i.getComponent():void 0,t):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),i?i.getComponent():void 0,t)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),i?i.getComponent():void 0,t);this.endMove()}},{key:"tableRowDrop",value:function(t,i){var n=!1,o=!1;switch(t.stopImmediatePropagation(),e(this.table.options.movableRowsReceiver)){case"string":n=this.receivers[this.table.options.movableRowsReceiver];break;case"function":n=this.table.options.movableRowsReceiver}n?o=n.call(this,this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),o?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),i?i.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:i,success:o})}},{key:"commsReceived",value:function(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}]),s}(N);Oe.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},Oe.prototype.senders={delete:function(e,t,i){e.delete()}},Oe.moduleName="moveRow";var Ae=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).allowedTypes=["","data","edit","clipboard"],i.enabled=!0,i.registerColumnOption("mutator"),i.registerColumnOption("mutatorParams"),i.registerColumnOption("mutatorData"),i.registerColumnOption("mutatorDataParams"),i.registerColumnOption("mutatorEdit"),i.registerColumnOption("mutatorEditParams"),i.registerColumnOption("mutatorClipboard"),i.registerColumnOption("mutatorClipboardParams"),i.registerColumnOption("mutateLink"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}},{key:"rowDataChanged",value:function(e,t,i){return this.transformRow(t,"data",i)}},{key:"initializeColumn",value:function(e){var t=this,i=!1,n={};this.allowedTypes.forEach((function(o){var a,s="mutator"+(o.charAt(0).toUpperCase()+o.slice(1));e.definition[s]&&(a=t.lookupMutator(e.definition[s]))&&(i=!0,n[s]={mutator:a,params:e.definition[s+"Params"]||{}})})),i&&(e.modules.mutate=n)}},{key:"lookupMutator",value:function(t){var i=!1;switch(e(t)){case"string":s.mutators[t]?i=s.mutators[t]:console.warn("Mutator Error - No such mutator found, ignoring: ",t);break;case"function":i=t}return i}},{key:"transformRow",value:function(e,t,i){var n,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((function(a){var s,r,l;a.modules.mutate&&(s=a.modules.mutate[o]||a.modules.mutate.mutator||!1)&&(n=a.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===n||(l=a.getComponent(),r="function"==typeof s.params?s.params(n,e,t,l):s.params,a.setFieldValue(e,s.mutator(n,e,t,r,l))))})),e}},{key:"transformCell",value:function(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,n={};if(i)return n=Object.assign(n,e.row.getData()),e.column.setFieldValue(n,t),i.mutator(t,n,"edit",i.params,e.getComponent())}return t}},{key:"mutateLink",value:function(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((function(t){var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}},{key:"enable",value:function(){this.enabled=!0}},{key:"disable",value:function(){this.enabled=!1}}]),s}(N);Ae.moduleName="mutator",Ae.mutators={};var _e={rows:function(e,t,i,n,o){var a=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){s.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(function(e){c.innerHTML=e})),n?(r.innerHTML=" "+t+"-"+Math.min(t+e-1,n)+" ",u.innerHTML=" "+n+" ",a.appendChild(s),a.appendChild(r),a.appendChild(l),a.appendChild(u),a.appendChild(c)):(r.innerHTML=" 0 ",a.appendChild(s),a.appendChild(r),a.appendChild(c)),a},pages:function(e,t,i,n,o){var a=document.createElement("span"),s=document.createElement("span"),r=document.createElement("span"),l=document.createElement("span"),u=document.createElement("span"),c=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(function(e){s.innerHTML=e})),r.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(function(e){l.innerHTML=e})),u.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(function(e){c.innerHTML=e})),a.appendChild(s),a.appendChild(r),a.appendChild(l),a.appendChild(u),a.appendChild(c),a}},Be=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).mode="local",i.progressiveLoad=!1,i.element=null,i.pageCounterElement=null,i.pageCounter=null,i.size=0,i.page=1,i.count=5,i.max=1,i.remoteRowCountEstimate=null,i.initialLoad=!0,i.dataChanging=!1,i.pageSizes=[],i.registerTableOption("pagination",!1),i.registerTableOption("paginationMode","local"),i.registerTableOption("paginationSize",!1),i.registerTableOption("paginationInitialPage",1),i.registerTableOption("paginationCounter",!1),i.registerTableOption("paginationCounterElement",!1),i.registerTableOption("paginationButtonCount",5),i.registerTableOption("paginationSizeSelector",!1),i.registerTableOption("paginationElement",!1),i.registerTableOption("paginationAddRow","page"),i.registerTableOption("progressiveLoad",!1),i.registerTableOption("progressiveLoadDelay",0),i.registerTableOption("progressiveLoadScrollMargin",0),i.registerTableFunction("setMaxPage",i.setMaxPage.bind(r(i))),i.registerTableFunction("setPage",i.setPage.bind(r(i))),i.registerTableFunction("setPageToRow",i.userSetPageToRow.bind(r(i))),i.registerTableFunction("setPageSize",i.userSetPageSize.bind(r(i))),i.registerTableFunction("getPageSize",i.getPageSize.bind(r(i))),i.registerTableFunction("previousPage",i.previousPage.bind(r(i))),i.registerTableFunction("nextPage",i.nextPage.bind(r(i))),i.registerTableFunction("getPage",i.getPage.bind(r(i))),i.registerTableFunction("getPageMax",i.getPageMax.bind(r(i))),i.registerComponentFunction("row","pageTo",i.setPageToRow.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}},{key:"rowAddingPosition",value:function(e,t){var i,n=this.table.rowManager,o=n.getDisplayRows();return t?o.length?i=o[0]:n.activeRows.length&&(i=n.activeRows[n.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.lengththis.max&&(this.page=this.max)}},{key:"reset",value:function(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}},{key:"setMaxPage",value:function(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}},{key:"setPage",value:function(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}},{key:"setPageToRow",value:function(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}},{key:"setPageSize",value:function(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}},{key:"_setPageCounter",value:function(t,i,n){var o;if(this.pageCounter)switch("remote"===this.mode&&(i=this.size,n=(this.page-1)*this.size+1,t=this.remoteRowCountEstimate),e(o=this.pageCounter.call(this,i,n,this.page,t,this.max))){case"object":if(o instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(o)}else this.pageCounterElement.innerHTML="",null!=o&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",o);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=o}}},{key:"_setPageButtons",value:function(){for(var e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&o<=this.max&&this.pagesElement.appendChild(this._generatePageButton(o));this.footerRedraw()}},{key:"_generatePageButton",value:function(e){var t=this,i=document.createElement("button");return i.classList.add("tabulator-page"),e==this.page&&i.classList.add("active"),i.setAttribute("type","button"),i.setAttribute("role","button"),this.langBind("pagination|page_title",(function(t){i.setAttribute("aria-label",t+" "+e),i.setAttribute("title",t+" "+e)})),i.setAttribute("data-page",e),i.textContent=e,i.addEventListener("click",(function(i){t.setPage(e)})),i}},{key:"previousPage",value:function(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}},{key:"nextPage",value:function(){return this.page-1&&(o=o.slice(s),(i=o.indexOf(";"))>-1&&(o=o.slice(0,i)),n=o.replace(a+"=","")),!!n&&JSON.parse(n)}},Ve={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var n=new Date;n.setDate(n.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+n.toUTCString()}},Ne=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).mode="",n.id="",n.defWatcherBlock=!1,n.config={},n.readFunc=!1,n.writeFunc=!1,n.registerTableOption("persistence",!1),n.registerTableOption("persistenceID",""),n.registerTableOption("persistenceMode",!0),n.registerTableOption("persistenceReaderFunc",!1),n.registerTableOption("persistenceWriterFunc",!1),n}return n(a,[{key:"localStorageTest",value:function(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}},{key:"initialize",value:function(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:a.readers[this.table.options.persistenceReaderFunc]?this.readFunc=a.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):a.readers[this.mode]?this.readFunc=a.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:a.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=a.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):a.writers[this.mode]?this.writeFunc=a.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}},{key:"eventSave",value:function(e){this.config[e]&&this.save(e)}},{key:"tableBuilt",value:function(){var e,t;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}},{key:"tableRedraw",value:function(e){e&&this.config.columns&&this.save("columns")}},{key:"getColumnLayout",value:function(){return this.parseColumns(this.table.columnManager.getColumns())}},{key:"setColumnLayout",value:function(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}},{key:"initializeColumn",value:function(e){var t,i=this;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((function(e){var n=Object.getOwnPropertyDescriptor(t,e),o=t[e];n&&Object.defineProperty(t,e,{set:function(e){o=e,i.defWatcherBlock||i.save("columns"),n.set&&n.set(e)},get:function(){return n.get&&n.get(),o}})})),this.defWatcherBlock=!1)}},{key:"load",value:function(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}},{key:"retrieveData",value:function(e){return!!this.readFunc&&this.readFunc(this.id,e)}},{key:"mergeDefinition",value:function(e,t){var i=this,n=[];return(t=t||[]).forEach((function(t,o){var a,s=i._findColumn(e,t);s&&(!0===i.config.columns||null==i.config.columns?(a=Object.keys(s)).push("width"):a=i.config.columns,a.forEach((function(e){"columns"!==e&&void 0!==t[e]&&(s[e]=t[e])})),s.columns&&(s.columns=i.mergeDefinition(s.columns,t.columns)),n.push(s))})),e.forEach((function(e,o){i._findColumn(t,e)||(n.length>o?n.splice(o,0,e):n.push(e))})),n}},{key:"_findColumn",value:function(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}},{key:"save",value:function(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}},{key:"validateSorters",value:function(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}},{key:"getGroupConfig",value:function(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}},{key:"getPageConfig",value:function(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}},{key:"parseColumns",value:function(e){var t=this,i=[],n=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((function(e){var o,a={},s=e.getDefinition();e.isGroup?(a.title=s.title,a.columns=t.parseColumns(e.getColumns())):(a.field=e.getField(),!0===t.config.columns||null==t.config.columns?((o=Object.keys(s)).push("width"),o.push("visible")):o=t.config.columns,o.forEach((function(t){switch(t){case"width":a.width=e.getWidth();break;case"visible":a.visible=e.visible;break;default:"function"!=typeof s[t]&&-1===n.indexOf(t)&&(a[t]=s[t])}}))),i.push(a)})),i}}]),a}(N);Ne.moduleName="persistence",Ne.moduleInitOrder=-10,Ne.readers=Ie,Ne.writers=Ve;var We=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).columnSubscribers={},n.registerTableOption("rowContextPopup",!1),n.registerTableOption("rowClickPopup",!1),n.registerTableOption("groupContextPopup",!1),n.registerTableOption("groupClickPopup",!1),n.registerColumnOption("headerContextPopup"),n.registerColumnOption("headerClickPopup"),n.registerColumnOption("headerPopup"),n.registerColumnOption("headerPopupIcon"),n.registerColumnOption("contextPopup"),n.registerColumnOption("clickPopup"),n}return n(a,[{key:"initialize",value:function(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"initializeRowWatchers",value:function(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}},{key:"initializeGroupWatchers",value:function(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}},{key:"initializeColumn",value:function(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}},{key:"initializeColumnHeaderPopup",value:function(e){var t,i=this,n=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),n?("function"==typeof n&&(n=n(e.getComponent())),n instanceof HTMLElement?t.appendChild(n):t.innerHTML=n):t.innerHTML="⋮",t.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault(),i.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}},{key:"loadPopupTableCellEvent",value:function(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}},{key:"loadPopupTableColumnEvent",value:function(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}},{key:"loadPopupEvent",value:function(e,t,i){var n;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){n=e})):e,this.loadPopup(t,i,e,n)}},{key:"loadPopup",value:function(e,t,i,n){var o,a,s=this,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(function(e){e.stopPropagation()})),r||e.preventDefault(),a=this.popup(o),"function"==typeof n&&a.renderCallback(n),a.show(e).hideOnBlur((function(){s.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}]),a}(N);We.moduleName="popup";var je=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).element=!1,n.manualBlock=!1,n.registerTableOption("printAsHtml",!1),n.registerTableOption("printFormatter",!1),n.registerTableOption("printHeader",!1),n.registerTableOption("printFooter",!1),n.registerTableOption("printStyled",!0),n.registerTableOption("printRowRange","visible"),n.registerTableOption("printConfig",{}),n.registerColumnOption("print"),n.registerColumnOption("titlePrint"),n}return n(a,[{key:"initialize",value:function(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}},{key:"replaceTable",value:function(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}},{key:"cleanup",value:function(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}},{key:"printFullscreen",value:function(e,t,i){var n,o,a=window.scrollX,s=window.scrollY,r=document.createElement("div"),l=document.createElement("div"),u=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(r.classList.add("tabulator-print-header"),"string"==typeof(n="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?r.innerHTML=n:r.appendChild(n),this.element.appendChild(r)),this.element.appendChild(u),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,u),window.print(),this.cleanup(),window.scrollTo(a,s),this.manualBlock=!1}}]),a}(N);je.moduleName="print";var Ge=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).data=!1,n.blocked=!1,n.origFuncs={},n.currentVersion=0,n.registerTableOption("reactiveData",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}},{key:"watchData",value:function(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((function(e){i.table.rowManager.addRowActual(e,!1)})),n=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),n}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var n,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((function(e){i.table.rowManager.addRowActual(e,!0)})),n=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),n}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var n,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[0]))&&n.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var n,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(n=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&n.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var n,o,a=Array.from(arguments),s=a[0]<0?e.length+a[0]:a[0],r=a[1],l=!!a[2]&&a.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((n=!!e[s]&&i.table.rowManager.getRowFromDataObject(e[s]))?l.forEach((function(e){i.table.rowManager.addRowActual(e,!0,n,!0)})):(l=l.slice().reverse()).forEach((function(e){i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==r){var u=e.slice(s,void 0===a[1]?a[1]:s+r);u.forEach((function(e,t){var n=i.table.rowManager.getRowFromDataObject(e);n&&n.deleteActual(t!==u.length-1)}))}(l||0!==r)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}},{key:"unwatchData",value:function(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}},{key:"watchRow",value:function(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}},{key:"watchTreeChildren",value:function(e){var t=arguments,i=this,n=this,o=e.getData()[this.table.options.dataTreeChildField],a={};o&&(a.push=o.push,Object.defineProperty(o,"push",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-push");var s=a.push.apply(o,t);i.rebuildTree(e),n.unblock("tree-push")}return s}}),a.unshift=o.unshift,Object.defineProperty(o,"unshift",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-unshift");var s=a.unshift.apply(o,t);i.rebuildTree(e),n.unblock("tree-unshift")}return s}}),a.shift=o.shift,Object.defineProperty(o,"shift",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-shift");var t=a.shift.call(o);i.rebuildTree(e),n.unblock("tree-shift")}return t}}),a.pop=o.pop,Object.defineProperty(o,"pop",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-pop");var t=a.pop.call(o);i.rebuildTree(e),n.unblock("tree-pop")}return t}}),a.splice=o.splice,Object.defineProperty(o,"splice",{enumerable:!1,configurable:!0,value:function(){if(!n.blocked){n.block("tree-splice");var s=a.splice.apply(o,t);i.rebuildTree(e),n.unblock("tree-splice")}return s}}))}},{key:"rebuildTree",value:function(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}},{key:"watchKey",value:function(e,t,i){var n=this,o=Object.getOwnPropertyDescriptor(t,i),a=t[i],s=this.currentVersion;Object.defineProperty(t,i,{set:function(t){if(a=t,!n.blocked&&s===n.currentVersion){n.block("key");var r={};r[i]=t,e.updateData(r),n.unblock("key")}o.set&&o.set(t)},get:function(){return o.get&&o.get(),a}})}},{key:"unwatchRow",value:function(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}},{key:"block",value:function(e){this.blocked||(this.blocked=e)}},{key:"unblock",value:function(e){this.blocked===e&&(this.blocked=!1)}}]),a}(N);Ge.moduleName="reactiveData";var Ue=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).startColumn=!1,n.startX=!1,n.startWidth=!1,n.latestX=!1,n.handle=null,n.initialNextColumn=null,n.nextColumn=null,n.initialized=!1,n.registerColumnOption("resizable",!0),n.registerTableOption("resizableColumnFit",!1),n}return n(a,[{key:"initialize",value:function(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}},{key:"initializeEventWatchers",value:function(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}},{key:"layoutCellHandles",value:function(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}},{key:"layoutColumnHeader",value:function(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}},{key:"columnLayoutUpdated",value:function(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}},{key:"columnWidthUpdated",value:function(e){var t=this;e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((function(e){t.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((function(e){t.reinitializeColumn(e)})))}},{key:"reinitializeColumn",value:function(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((function(e){e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}},{key:"initializeColumn",value:function(e,t,i,n){var o=this,a=i.definition.resizable,s={},r=i.getLastColumn();if("header"===e&&(s={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===a||a==e)&&this._checkResizability(r)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var u=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=r.nextColumn(),o._mouseDown(e,r,l)};l.addEventListener("mousedown",u),l.addEventListener("touchstart",u,{passive:!0}),l.addEventListener("dblclick",(function(e){var t=r.getWidth();e.stopPropagation(),r.reinitializeWidth(!0),t!==r.getWidth()&&(o.dispatch("column-resized",r),o.table.externalEvents.dispatch("columnResized",r.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),s.handleEl=l,n.parentNode&&i.visible&&n.after(l)}t.modules.resize=s}},{key:"deInitializeColumn",value:function(e){var t=this;this.deInitializeComponent(e),e.cells.forEach((function(e){t.deInitializeComponent(e)}))}},{key:"deInitializeComponent",value:function(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}},{key:"resizeHandle",value:function(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}},{key:"_checkResizability",value:function(e){return e.definition.resizable}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){var i,o,a=void 0===e.screenX?e.touches[0].screenX:e.screenX,s=a-n.startX,r=a-n.latestX;if(n.latestX=a,n.table.rtl&&(s=-s,r=-r),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(n.startWidth+s),o=t.width==t.minWidth||t.width==t.maxWidth,r<0&&(n.nextColumn=n.initialNextColumn),n.table.options.resizableColumnFit&&n.nextColumn&&(!i||!o)){var l=n.nextColumn.getWidth();r>0&&l<=n.nextColumn.minWidth&&(n.nextColumn=n.nextColumn.nextColumn()),n.nextColumn&&n.nextColumn.setWidth(n.nextColumn.getWidth()-r)}n.table.columnManager.rerenderColumns(!0),!n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function a(e){n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!1),n.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",a),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.startWidth!==t.getWidth()&&(n.dispatch("column-resized",t),n.table.externalEvents.dispatch("columnResized",t.getComponent()))}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startColumn.modules.edit&&(n.startColumn.modules.edit.blocked=!0),n.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,n.latestX=n.startX,n.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),a}(N);Ue.moduleName="resizeColumns";var Xe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).startColumn=!1,n.startY=!1,n.startHeight=!1,n.handle=null,n.prevHandle=null,n.registerTableOption("resizableRows",!1),n}return n(a,[{key:"initialize",value:function(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=document.createElement("div");n.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",n.addEventListener("click",(function(e){e.stopPropagation()}));var a=function(i){t.startRow=e,t._mouseDown(i,e,n)};n.addEventListener("mousedown",a),n.addEventListener("touchstart",a,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var s=function(i){var n=t.table.rowManager.prevDisplayRow(e);n&&(t.startRow=n,t._mouseDown(i,n,o))};o.addEventListener("mousedown",s),o.addEventListener("touchstart",s,{passive:!0}),i.appendChild(n),i.appendChild(o)}},{key:"_mouseDown",value:function(e,t,i){var n=this;function o(e){t.setHeight(n.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-n.startY))}function a(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",a),n.table.element.classList.remove("tabulator-block-select"),n.dispatchExternal("rowResized",t.getComponent())}n.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),n.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,n.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",a),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",a)}}]),a}(N);Xe.moduleName="resizeRows";var qe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).binding=!1,n.visibilityObserver=!1,n.resizeObserver=!1,n.containerObserver=!1,n.tableHeight=0,n.tableWidth=0,n.containerHeight=0,n.containerWidth=0,n.autoResize=!1,n.visible=!1,n.initialized=!1,n.initialRedraw=!1,n.registerTableOption("autoResize",!0),n}return n(a,[{key:"initialize",value:function(){var e=this;if(this.table.options.autoResize){var t,i=this.table;this.tableHeight=i.element.clientHeight,this.tableWidth=i.element.clientWidth,i.element.parentNode&&(this.containerHeight=i.element.parentNode.clientHeight,this.containerWidth=i.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===i.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.tableHeight==n&&e.tableWidth==o||(e.tableHeight=n,e.tableWidth=o,i.element.parentNode&&(e.containerHeight=i.element.parentNode.clientHeight,e.containerWidth=i.element.parentNode.clientWidth),e.redrawTable())}})),this.resizeObserver.observe(i.element),t=window.getComputedStyle(i.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(t.getPropertyValue("max-height")||t.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((function(t){if(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell){var n=Math.floor(t[0].contentRect.height),o=Math.floor(t[0].contentRect.width);e.containerHeight==n&&e.containerWidth==o||(e.containerHeight=n,e.containerWidth=o,e.tableHeight=i.element.clientHeight,e.tableWidth=i.element.clientWidth),e.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!i.browserMobile||i.browserMobile&&!i.modules.edit.currentCell)&&(i.columnManager.rerenderColumns(!0),i.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}},{key:"initializeVisibilityObserver",value:function(){var e=this;this.visibilityObserver=new IntersectionObserver((function(t){e.visible=t[0].isIntersecting,e.initialized||(e.initialized=!0,e.initialRedraw=!e.visible),e.visible&&(e.redrawTable(e.initialRedraw),e.initialRedraw=!1)})),this.visibilityObserver.observe(this.table.element)}},{key:"redrawTable",value:function(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}},{key:"tableResized",value:function(){this.table.rowManager.redraw()}},{key:"clearBindings",value:function(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}]),a}(N);qe.moduleName="resizeTable";var Ke=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).columns=[],n.hiddenColumns=[],n.mode="",n.index=0,n.collapseFormatter=[],n.collapseStartOpen=!0,n.collapseHandleColumn=!1,n.registerTableOption("responsiveLayout",!1),n.registerTableOption("responsiveLayoutCollapseStartOpen",!0),n.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),n.registerTableOption("responsiveLayoutCollapseFormatter",!1),n.registerColumnOption("responsive"),n}return n(a,[{key:"initialize",value:function(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}},{key:"tableRedraw",value:function(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}},{key:"initializeResponsivity",value:function(){var e=this,t=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach((function(i,n){i.modules.responsive&&i.modules.responsive.order&&i.modules.responsive.visible&&(i.modules.responsive.index=n,t.push(i),i.visible||"collapse"!==e.mode||e.hiddenColumns.push(i))})),t=(t=t.reverse()).sort((function(e,t){return t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index})),this.columns=t,"collapse"===this.mode&&this.generateCollapsedContent();var i,n=p(this.table.columnManager.columnsByIndex);try{for(n.s();!(i=n.n()).done;){var o=i.value;if("responsiveCollapse"==o.definition.formatter){this.collapseHandleColumn=o;break}}}catch(e){n.e(e)}finally{n.f()}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}},{key:"initializeColumn",value:function(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}},{key:"initializeRow",value:function(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}},{key:"layoutRow",value:function(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}},{key:"updateColumnVisibility",value:function(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}},{key:"hideColumn",value:function(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}},{key:"showColumn",value:function(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}},{key:"update",value:function(){for(var e=this,t=!0;t;){var i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),n=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(n<0){var o=e.columns[e.index];o?(e.hideColumn(o),e.index++):t=!1}else{var a=e.columns[e.index-1];a&&n>0&&n>=a.getWidth()?(e.showColumn(a),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}},{key:"generateCollapsedContent",value:function(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}},{key:"generateCollapsedRowContent",value:function(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}},{key:"generateCollapsedRowData",value:function(e){var t,i=this,n=e.getData(),o=[];return this.hiddenColumns.forEach((function(a){var s=a.getFieldValue(n);if(a.definition.title&&a.field)if(a.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return s},getData:function(){return n},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return a.getComponent()}},o.push({field:a.field,title:a.definition.title,value:a.modules.format.formatter.call(i.table.modules.format,t,a.modules.format.params,(function(e){e()}))})}else o.push({field:a.field,title:a.definition.title,value:s})})),o}},{key:"formatCollapsedData",value:function(e){var t=document.createElement("table");return e.forEach((function(e){var i,n=document.createElement("tr"),o=document.createElement("td"),a=document.createElement("td"),s=document.createElement("strong");o.appendChild(s),this.langBind("columns|"+e.field,(function(t){s.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),a.appendChild(i)):a.innerHTML=e.value,n.appendChild(o),n.appendChild(a),t.appendChild(n)}),this),Object.keys(e).length?t:""}}]),a}(N);Ke.moduleName="responsiveLayout";var Je=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).selecting=!1,i.lastClickedRow=!1,i.selectPrev=[],i.selectedRows=[],i.headerCheckboxElement=null,i.registerTableOption("selectable","highlight"),i.registerTableOption("selectableRangeMode","drag"),i.registerTableOption("selectableRollingSelection",!0),i.registerTableOption("selectablePersistence",!0),i.registerTableOption("selectableCheck",(function(e,t){return!0})),i.registerTableFunction("selectRow",i.selectRows.bind(r(i))),i.registerTableFunction("deselectRow",i.deselectRows.bind(r(i))),i.registerTableFunction("toggleSelectRow",i.toggleRow.bind(r(i))),i.registerTableFunction("getSelectedRows",i.getSelectedRows.bind(r(i))),i.registerTableFunction("getSelectedData",i.getSelectedData.bind(r(i))),i.registerComponentFunction("row","select",i.selectRows.bind(r(i))),i.registerComponentFunction("row","deselect",i.deselectRows.bind(r(i))),i.registerComponentFunction("row","toggleSelect",i.toggleRow.bind(r(i))),i.registerComponentFunction("row","isSelected",i.isRowSelected.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}},{key:"rowRetrieve",value:function(e,t){return"selected"===e?this.selectedRows:t}},{key:"rowDeleted",value:function(e){this._deselectRow(e,!0)}},{key:"clearSelectionData",value:function(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}},{key:"initializeRow",value:function(e){var t=this,i=e.getElement(),n=function e(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",e)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",n),document.body.addEventListener("keyup",n),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}},{key:"handleComplexRowClick",value:function(e,t){var i=this;if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var n=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),o=this.table.rowManager.getDisplayRowIndex(e),a=n<=o?n:o,s=n>=o?n:o,r=this.table.rowManager.getDisplayRows().slice(0).splice(a,s-a+1);t.ctrlKey||t.metaKey?(r.forEach((function(t){t!==i.lastClickedRow&&(!0===i.table.options.selectable||i.isRowSelected(e)||i.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}},{key:"toggleRow",value:function(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}},{key:"selectRows",value:function(t){var i,n=this;switch(e(t)){case"undefined":this.table.rowManager.rows.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(i=this.table.rowManager.findRow(t))?(this._selectRow(i,!0,!0),this._rowSelectionChanged()):((i=this.table.rowManager.getRows(t)).forEach((function(e){n._selectRow(e,!0,!0)})),i.length&&this._rowSelectionChanged());break;default:Array.isArray(t)?(t.forEach((function(e){n._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(t,!1,!0)}}},{key:"_selectRow",value:function(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var n=this.table.rowManager.findRow(e);n?-1==this.selectedRows.indexOf(n)&&(n.getElement().classList.add("tabulator-selected"),n.modules.select||(n.modules.select={}),n.modules.select.selected=!0,n.modules.select.checkboxEl&&(n.modules.select.checkboxEl.checked=!0),this.selectedRows.push(n),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(n,!0),this.dispatchExternal("rowSelected",n.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}},{key:"isRowSelected",value:function(e){return-1!==this.selectedRows.indexOf(e)}},{key:"deselectRows",value:function(e,t){var i,n=this;if(void 0===e){i=n.selectedRows.length;for(var o=0;o-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),n.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),n._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}},{key:"getSelectedData",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}},{key:"getSelectedRows",value:function(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}},{key:"_rowSelectionChanged",value:function(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}},{key:"registerRowSelectCheckbox",value:function(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}},{key:"registerHeaderSelectCheckbox",value:function(e){this.headerCheckboxElement=e}},{key:"childRowSelection",value:function(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t){var n,o=p(i);try{for(o.s();!(n=o.n()).done;){var a=n.value;this._selectRow(a,!0)}}catch(e){o.e(e)}finally{o.f()}}else{var s,r=p(i);try{for(r.s();!(s=r.n()).done;){var l=s.value;this._deselectRow(l,!0)}}catch(e){r.e(e)}finally{r.f()}}}}]),s}(N);function Ye(e,t,i,n,o,a,s){var r=window.DateTime||luxon.DateTime,l=s.format||"dd/MM/yyyy HH:mm:ss",u=s.alignEmptyValues,c=0;if(void 0!==r){if(r.isDateTime(e)||(e="iso"===l?r.fromISO(String(e)):r.fromFormat(String(e),l)),r.isDateTime(t)||(t="iso"===l?r.fromISO(String(t)):r.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;c=1}else c=t.isValid?-1:0;return("top"===u&&"desc"===a||"bottom"===u&&"asc"===a)&&(c*=-1),c}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}Je.moduleName="selectRow";var $e={number:function(e,t,i,n,o,a,s){var r=s.alignEmptyValues,l=s.decimalSeparator,u=s.thousandSeparator,c=0;if(e=String(e),t=String(t),u&&(e=e.split(u).join(""),t=t.split(u).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))c=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;c=1}return("top"===r&&"desc"===a||"bottom"===r&&"asc"===a)&&(c*=-1),c},string:function(t,i,n,o,a,s,r){var l,u=r.alignEmptyValues,c=0;if(t){if(i){switch(e(r.locale)){case"boolean":r.locale&&(l=this.langLocale());break;case"string":l=r.locale}return String(t).toLowerCase().localeCompare(String(i).toLowerCase(),l)}c=1}else c=i?-1:0;return("top"===u&&"desc"===s||"bottom"===u&&"asc"===s)&&(c*=-1),c},date:function(e,t,i,n,o,a,s){return s.format||(s.format="dd/MM/yyyy"),Ye.call(this,e,t,i,n,o,a,s)},time:function(e,t,i,n,o,a,s){return s.format||(s.format="HH:mm"),Ye.call(this,e,t,i,n,o,a,s)},datetime:Ye,boolean:function(e,t,i,n,o,a,s){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,n,o,a,s){var r=s.type||"length",l=s.alignEmptyValues,u=0;function c(e){var t;switch(r){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length}return t}if(Array.isArray(e)){if(Array.isArray(t))return c(t)-c(e);u=1}else u=Array.isArray(t)?-1:0;return("top"===l&&"desc"===a||"bottom"===l&&"asc"===a)&&(u*=-1),u},exists:function(e,t,i,n,o,a,s){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,n,o,a,s){var r,l,u,c,h,d=0,m=/(\d+)|(\D+)/g,p=/\d/,f=s.alignEmptyValues,g=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((r=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(r)||!p.test(l))return r>l?1:-1;for(r=r.match(m),l=l.match(m),h=r.length>l.length?l.length:r.length;dc?1:-1;return r.length>l.length}g=1}else g=t||0===t?-1:0;return("top"===f&&"desc"===a||"bottom"===f&&"asc"===a)&&(g*=-1),g}},Ze=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).sortList=[],i.changed=!1,i.registerTableOption("sortMode","local"),i.registerTableOption("initialSort",!1),i.registerTableOption("columnHeaderSortMulti",!0),i.registerTableOption("sortOrderReverse",!1),i.registerTableOption("headerSortElement","
"),i.registerColumnOption("sorter"),i.registerColumnOption("sorterParams"),i.registerColumnOption("headerSort",!0),i.registerColumnOption("headerSortStartingDir"),i.registerColumnOption("headerSortTristate"),i}return n(s,[{key:"initialize",value:function(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}},{key:"tableBuilt",value:function(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}},{key:"remoteSortParams",value:function(e,t,i,n){var o=this.getSort();return o.forEach((function(e){delete e.column})),n.sort=o,n}},{key:"userSetSort",value:function(e,t){this.setSort(e,t),this.refreshSort()}},{key:"clearSort",value:function(){this.clear(),this.refreshSort()}},{key:"initializeColumn",value:function(t){var i,n,o=this,a=!1;switch(e(t.definition.sorter)){case"string":s.sorters[t.definition.sorter]?a=s.sorters[t.definition.sorter]:console.warn("Sort Error - No such sorter found: ",t.definition.sorter);break;case"function":a=t.definition.sorter}if(t.modules.sort={sorter:a,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate},!1!==t.definition.headerSort){switch((i=t.getElement()).classList.add("tabulator-sortable"),(n=document.createElement("div")).classList.add("tabulator-col-sorter"),this.table.options.headerSortElement){case"function":break;case"object":n.appendChild(this.table.options.headerSortElement);break;default:n.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(n),t.modules.sort.element=n,this.setColumnHeaderSortIcon(t,"none"),i.addEventListener("click",(function(e){var i="",n=[],a=!1;if(t.modules.sort){if(t.modules.sort.tristate)i="none"==t.modules.sort.dir?t.modules.sort.startingDir:t.modules.sort.dir==t.modules.sort.startingDir?"asc"==t.modules.sort.dir?"desc":"asc":"none";else switch(t.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=t.modules.sort.startingDir}o.table.options.columnHeaderSortMulti&&(e.shiftKey||e.ctrlKey)?((a=(n=o.getSort()).findIndex((function(e){return e.field===t.getField()})))>-1?(n[a].dir=i,a=n.splice(a,1)[0],"none"!=i&&n.push(a)):"none"!=i&&n.push({column:t,dir:i}),o.setSort(n)):"none"==i?o.clear():o.setSort(t,i),o.refreshSort()}}))}}},{key:"refreshSort",value:function(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}},{key:"hasChanged",value:function(){var e=this.changed;return this.changed=!1,e}},{key:"getSort",value:function(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}},{key:"setSort",value:function(e,t){var i=this,n=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,n.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=n,this.dispatch("sort-changed")}},{key:"clear",value:function(){this.setSort([])}},{key:"findSorter",value:function(t){var i,n=this.table.rowManager.activeRows[0],o="string";if(n&&(n=n.getData(),t.getField()))switch(e(i=t.getFieldValue(n))){case"undefined":o="string";break;case"boolean":o="boolean";break;default:isNaN(i)||""===i?i.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(o="alphanum"):o="number"}return s.sorters[o]}},{key:"sort",value:function(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,n=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,n.push(e)),t.setColumnHeader(e.column,e.dir))})),n.length&&t._sortItems(e,n)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((function(e){o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}},{key:"clearColumnHeaders",value:function(){var e=this;this.table.columnManager.getRealColumns().forEach((function(t){t.modules.sort&&(t.modules.sort.dir="none",t.getElement().setAttribute("aria-sort","none"),e.setColumnHeaderSortIcon(t,"none"))}))}},{key:"setColumnHeader",value:function(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}},{key:"setColumnHeaderSortIcon",value:function(t,i){var n,o=t.modules.sort.element;if(t.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;o.firstChild;)o.removeChild(o.firstChild);"object"===e(n=this.table.options.headerSortElement.call(this.table,t.getComponent(),i))?o.appendChild(n):o.innerHTML=n}}},{key:"_sortItems",value:function(e,t){var i=this,n=t.length-1;e.sort((function(e,o){for(var a,s=n;s>=0;s--){var r=t[s];if(0!==(a=i._sortRow(e,o,r.column,r.dir,r.params)))break}return a}))}},{key:"_sortRow",value:function(e,t,i,n,o){var a,s,r="asc"==n?e:t,l="asc"==n?t:e;return e=void 0!==(e=i.getFieldValue(r.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",a=r.getComponent(),s=l.getComponent(),i.modules.sort.sorter.call(this,e,t,a,s,i.getComponent(),n,o)}}]),s}(N);Ze.moduleName="sort",Ze.sorters=$e;var Qe=function(e){o(a,e);var i=u(a);function a(e){var n;return t(this,a),(n=i.call(this,e)).tooltipSubscriber=null,n.headerSubscriber=null,n.timeout=null,n.popupInstance=null,n.registerTableOption("tooltipGenerationMode",void 0),n.registerTableOption("tooltipDelay",300),n.registerColumnOption("tooltip"),n.registerColumnOption("headerTooltip"),n}return n(a,[{key:"initialize",value:function(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}},{key:"deprecatedOptionsCheck",value:function(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}},{key:"initializeColumn",value:function(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}},{key:"mousemoveCheck",value:function(e,t,i){var n="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;n&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,n),this.table.options.tooltipDelay))}},{key:"mouseoutCheck",value:function(e,t,i){this.popupInstance||this.clearPopup()}},{key:"clearPopup",value:function(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}},{key:"loadTooltip",value:function(e,t,i){var n,o,a,s=this;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?n=i:(n=document.createElement("div"),!0===i&&(t instanceof y?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(function(e){n.innerHTML=i=e||t.definition.title})):i=t.definition.title),n.innerHTML=i),(i||0===i||!1===i)&&(n.classList.add("tabulator-tooltip"),n.addEventListener("mousemove",(function(e){return e.preventDefault()})),this.popupInstance=this.popup(n),"function"==typeof o&&this.popupInstance.renderCallback(o),a=this.popupInstance.containerEventCoords(e),this.popupInstance.show(a.x+15,a.y+15).hideOnBlur((function(){s.dispatchExternal("TooltipClosed",t.getComponent()),s.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}]),a}(N);Qe.moduleName="tooltip";var et={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var n=!0,o=e.getData(),a=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==a.getFieldValue(i)&&(n=!1)})),n},required:function(e,t,i){return""!==t&&null!=t}},tt=function(i){o(s,i);var a=u(s);function s(e){var i;return t(this,s),(i=a.call(this,e)).invalidCells=[],i.registerTableOption("validationMode","blocking"),i.registerColumnOption("validator"),i.registerTableFunction("getInvalidCells",i.getInvalidCells.bind(r(i))),i.registerTableFunction("clearCellValidation",i.userClearCellValidation.bind(r(i))),i.registerTableFunction("validate",i.userValidate.bind(r(i))),i.registerComponentFunction("cell","isValid",i.cellIsValid.bind(r(i))),i.registerComponentFunction("cell","clearValidation",i.clearValidation.bind(r(i))),i.registerComponentFunction("cell","validate",i.cellValidate.bind(r(i))),i.registerComponentFunction("column","validate",i.columnValidate.bind(r(i))),i.registerComponentFunction("row","validate",i.rowValidate.bind(r(i))),i}return n(s,[{key:"initialize",value:function(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}},{key:"editValidate",value:function(e,t,i){var n=this,o="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==o&&setTimeout((function(){e.getElement().classList.add("tabulator-validation-fail"),n.dispatchExternal("validationFailed",e.getComponent(),t,o)})),o}},{key:"editorClear",value:function(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}},{key:"editedClear",value:function(e){e.modules.validate&&(e.modules.validate.invalid=!1)}},{key:"cellIsValid",value:function(e){return e.modules.validate&&e.modules.validate.invalid||!0}},{key:"cellValidate",value:function(e){return this.validate(e.column.modules.validate,e,e.getValue())}},{key:"columnValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"rowValidate",value:function(e){var t=this,i=[];return e.cells.forEach((function(e){!0!==t.cellValidate(e)&&i.push(e.getComponent())})),!i.length||i}},{key:"userClearCellValidation",value:function(e){var t=this;e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((function(e){t.clearValidation(e._getSelf())}))}},{key:"userValidate",value:function(e){var t=[];return this.table.rowManager.rows.forEach((function(e){var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}},{key:"initializeColumnCheck",value:function(e){void 0!==e.definition.validator&&this.initializeColumn(e)}},{key:"initializeColumn",value:function(e){var t,i=this,n=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((function(e){(t=i._extractValidator(e))&&n.push(t)})):(t=this._extractValidator(e.definition.validator))&&n.push(t),e.modules.validate=!!n.length&&n)}},{key:"_extractValidator",value:function(t){var i,n,o;switch(e(t)){case"string":return(o=t.indexOf(":"))>-1?(i=t.substring(0,o),n=t.substring(o+1)):i=t,this._buildValidator(i,n);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}},{key:"_buildValidator",value:function(e,t){var i="function"==typeof e?e:s.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}},{key:"validate",value:function(e,t,i){var n=this,o=[],a=this.invalidCells.indexOf(t);return e&&e.forEach((function(e){e.func.call(n,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==a&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),a>-1&&this.invalidCells.splice(a,1)),!o.length||o}},{key:"getInvalidCells",value:function(){var e=[];return this.invalidCells.forEach((function(t){e.push(t.getComponent())})),e}},{key:"clearValidation",value:function(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}]),s}(N);tt.moduleName="validate",tt.validators=et;var it=Object.freeze({__proto__:null,AccessorModule:$,AjaxModule:ne,ClipboardModule:oe,ColumnCalcsModule:re,DataTreeModule:le,DownloadModule:ce,EditModule:pe,ExportModule:ve,FilterModule:ye,FormatModule:Ce,FrozenColumnsModule:ke,FrozenRowsModule:Ee,GroupRowsModule:Te,HistoryModule:Me,HtmlTableImportModule:Le,ImportModule:De,InteractionModule:Pe,KeybindingsModule:ze,MenuModule:Fe,MoveColumnsModule:He,MoveRowsModule:Oe,MutatorModule:Ae,PageModule:Be,PersistenceModule:Ne,PopupModule:We,PrintModule:je,ReactiveDataModule:Ge,ResizeColumnsModule:Ue,ResizeRowsModule:Xe,ResizeTableModule:qe,ResponsiveLayoutModule:Ke,SelectRowModule:Je,SortModule:Ze,TooltipModule:Qe,ValidateModule:tt}),nt=function(e){o(n,e);var i=u(n);function n(){return t(this,n),i.apply(this,arguments)}return n}(Y);return new K(nt,it),nt})); //# sourceMappingURL=tabulator.min.js.map diff --git a/dist/js/tabulator.min.js.map b/dist/js/tabulator.min.js.map index 3f7d989a3..00d497019 100644 --- a/dist/js/tabulator.min.js.map +++ b/dist/js/tabulator.min.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.element.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.element.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t\t\r\n\t\t\t// clear empty table placeholder min\r\n\t\t\tthis.tableElement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["CoreFeature","table","data","silent","columnsChanged","this","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","columns","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","height","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","style","textAlign","hozAlign","vertAlign","display","alignItems","top","bottom","middle","justifyContent","left","right","center","definition","cssClass","split","classList","add","val","_this2","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","changed","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","_this","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","el","columnHeaderVertAlign","defaults","columnDefaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","_this3","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","_this4","langBind","text","_formatColumnHeaderTitle","contents","_this5","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","traverse","concat","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","index","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","_this6","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","error","assign","addColumn","then","_this7","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","_typeof","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","scrollToRowIfVisible","elVisible","elOffset","scrollToRowPosition","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","ok","find","col","frozen","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","generateCells","colEnd","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","working","getCell","fitDataColActualWidthCheck","prepend","_this8","ex","message","_this9","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","redrawBlockUpdate","renderer","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","renderHorizontal","initialize","headerVisible","hozAdjust","scrollWidth","marginLeft","scrollColumns","sorter","definitions","autoColumnsDefinitions","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","toIndex","fromIndex","adjust","scrollToColumnPosition","scrollToColumnIfVisible","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getPosition","watchPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","positionWatchers","created","setData","create","deleteCells","renderRowCells","rowFormatter","rerenderRowCells","children","maxHeight","rowHeight","resizableRows","setHeight","clearHeight","updatedData","newRowData","tempData","attrname","JSON","parse","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","detachModules","deleteRow","includes","isDisplayed","group","BasicVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholder","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","autoColumns","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","addRowPos","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","destroyed","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","viewable","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","footerElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","debugInvalidComponentFuncs","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","dataSendParams","response","objectInvert","dataReceiveParams","rowData","clearAlert","alertError","setTimeout","dataLoaderErrorTimeout","map","alertManager","alert","dataLoaderLoading","langText","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","hideable","blurEvent","escEvent","_escapeCheck","destroyBinding","tableDestroyed","popupContainer","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","lookupIndex","append","menuEl","menuContainer","content","forced","responsiveLayout","modExists","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","responsive","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","mode","registerTableOption","registerColumnOption","modes","dataChanged","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","navigator","language","toLowerCase","prefix","traverseLang","trans","prop","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","Comms","receive","selectors","connections","con","action","connection","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","textDirection","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","stack","line","debugInitialization","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","debugDeprecation","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","Accessor","allowedTypes","initializeColumn","transformRow","accessor","charAt","toUpperCase","lookupAccessor","accessors","rowComponent","colComponent","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","method","headers","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","contentType","ajaxContentType","Accept","location","credentials","fetch","json","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","updateOrAddData","insert","addData","headerFindSuccess","columnMap","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","marginRight","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","formatter","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_this10","_this11","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","_this12","startVis","isVisible","_setListWidth","_this13","hideOnBlur","_this14","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","number","step","blurFunc","date","inputFormat","DT","DateTime","luxon","convertDate","isDateTime","fromISO","fromFormat","toFormat","time","newDatetime","datetime","deprecationMsg","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","link","urlPrefix","labelField","labelTraverse","urlField","image","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","datetimediff","suffix","humanize","now","toHuman","traffic","percentValue","colors","color","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","innerText","responsiveCollapse","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","pullGroupListData","rowCount","headerContent","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","getRowIndex","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","inQuote","nextChar","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retrievedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","nodeHeight","contentRect","nodeWidth","redrawTable","observe","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","colCount","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","langLocale","localeCompare","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";4sHAAqBA,wBAERC,kBACNA,MAAQA,+CAOHC,EAAMC,EAAQC,UACjBC,KAAKJ,MAAMK,WAAWC,KAAKL,OAAMM,OAAWA,OAAWA,EAAWL,EAAQC,0DAQrEH,MAAMQ,QAAQC,UAASC,gBAAWC,kEAIlCX,MAAMQ,QAAQC,UAASG,aAAQD,oEAI/BX,MAAMQ,QAAQC,UAASI,kBAAaF,0EASpCX,MAAMQ,QAAQM,OAAMC,uBAAkBJ,mEAItCX,MAAMQ,QAAQM,OAAME,aAAQL,uDAQjCP,KAAKJ,MAAMQ,QAAQS,OAAOC,gDAGpBC,UACNf,KAAKJ,MAAMQ,QAAQS,OAAOA,OAAOE,2DAS5BnB,MAAMoB,UAASC,kBAAaV,qEAI5BX,MAAMoB,UAASE,oBAAeX,8CAGhCY,UACHnB,KAAKJ,MAAMoB,SAASI,WAAWD,oEAI1BvB,MAAM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s7C,EAAOj9C,KACXsiF,EAAmB,GACnBC,EAAeviF,KAAKkhF,aAAan1E,QAAQ3I,UAEtCi/E,GACFA,EAAWl/E,SAAQ,SAAC4P,GACfA,EAAK6e,KAAK9oB,KAAKm0C,EAAM75C,EAAKE,eAAgB3B,EAAOoR,EAAKuZ,SACzDg2D,EAAiBj/E,KAAK,CACrBf,KAAKyQ,EAAKzQ,KACVk+E,WAAWztE,EAAKuZ,YAMhBlpB,EAAKhD,QAAQ2hF,WAChB3+E,EAAKhD,QAAQ2hF,SAAW,IAGrBO,EAAiBz+E,QAQpBT,EAAKhD,QAAQ2hF,SAASz0B,QAAUg1B,EAES,WAAtCtiF,KAAKJ,MAAM8B,QAAQ6gD,gBACrBn/C,EAAKN,aAAakF,UAAUC,IAAI,8BAGb,GAAjBs6E,QACGrB,aAAa79E,KAAKD,KAdxBA,EAAKhD,QAAQ2hF,SAASz0B,SAAU,EAChClqD,EAAKN,aAAakF,UAAUqM,OAAO,6BAEhCkuE,GAAgB,QACbrB,aAAa3xE,OAAOgzE,EAAc,KAclCD,EAAiBz+E,QAASy+E,gDAI7B1+E,EAAS,eAERs9E,aAAa/9E,SAAQ,SAACC,GAC1BQ,EAAOP,KAAKD,EAAKE,mBAGXM,0CAGQR,OACXm/E,EAEDn/E,EAAKhD,QAAQ2hF,UAAY3+E,EAAKhD,QAAQ2hF,SAASz0B,UAEjDlqD,EAAKN,aAAakF,UAAUqM,OAAO,6BACnCjR,EAAKhD,QAAQ2hF,SAASz0B,SAAU,GAEhCi1B,EAAeviF,KAAKkhF,aAAan1E,QAAQ3I,KAEtB,QACb89E,aAAa3xE,OAAOgzE,EAAc,WAjSpB9wD,GAuSvBwvD,GAASjsD,WAAa,WAGtBisD,GAASoB,WAAaG,grBCzShBC,iGAAsBnzD,UAG5B,IAAIgI,EAAamrD,GAAeriF"} \ No newline at end of file +{"version":3,"file":"tabulator.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/Column.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/TabulatorFull.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.headersElement.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.headersElement.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type || type === true){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ? this.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;"],"names":["CoreFeature","table","data","silent","columnsChanged","this","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","ColumnComponent","column","_column","type","Proxy","get","target","name","receiver","componentFunctionBinder","handle","getElement","getDefinition","getField","getTitleDownload","cells","forEach","cell","push","getComponent","visible","isGroup","columns","show","hide","output","length","parent","Column","columnManager","scrollToColumn","to","after","toColumn","findColumn","moveColumn","console","warn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","width","result","reinitializeWidth","setWidth","rerenderColumns","CellComponent","_cell","getValue","getOldValue","initialValue","row","getData","mutate","setValue","setValueActual","checkHeight","Cell","element","oldValue","height","minWidth","component","loaded","build","generateElement","_configureCell","getFieldValue","document","createElement","className","setAttribute","field","style","textAlign","hozAlign","vertAlign","display","alignItems","top","bottom","middle","justifyContent","left","right","center","definition","cssClass","split","classList","add","val","_this2","innerHTML","Node","firstChild","removeChild","appendChild","containerOnly","layoutElement","setValueProcessData","cellRendered","cellEdited","call","dispatchExternal","subscribedExternal","rowManager","changed","setFieldValue","_generateContents","widthStyled","offsetWidth","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","offsetHeight","redrawBlock","parentNode","deleteCell","calcs","getCellIndex","def","_this","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","maxInitialWidth","widthFixed","i","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","el","columnHeaderVertAlign","defaults","columnDefaults","optionsList","generate","defaultOptionList","Object","keys","indexOf","title","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","headerVertical","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","_this3","setMinWidth","parseInt","setMaxWidth","headerHozAlign","_buildColumnHeaderTitle","editableTitle","addEventListener","e","stopPropagation","focus","_this4","langBind","text","_formatColumnHeaderTitle","contents","_this5","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","traverse","concat","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","index","splice","setWidthActual","isNaN","Math","floor","clientWidth","max","min","rows","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","getBoundingClientRect","Promise","resolve","reject","_this6","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","error","assign","addColumn","then","_this7","defaultOptions","Helpers","box","window","pageYOffset","documentElement","clientTop","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","Array","isArray","subject","match","copy","_typeof","findIndex","item","unshift","deepClone","OptionsList","msgType","registeredDefaults","option","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","tableElement","verticalFillMode","callback","update","blockRedraw","dir","includingBuffer","getDisplayRows","rowEl","remove","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","position","ifVisible","rowIndex","offset","scrollToRowIfVisible","elVisible","elOffset","scrollToRowPosition","scrollToRowNearestTop","scrollToRow","scrollHeight","scrollTop","offsetTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","scrollLeft","vDomScrollPosLeft","vDomScrollPosRight","vDomPadLeft","vDomPadRight","fitDataColAvg","windowBuffer","visibleRows","initialized","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","ok","find","col","frozen","startsWith","clearVisRowCache","dataChange","scroll","buffer","columnsByIndex","old","cols","colPos","clear","calcWindowBuffer","config","leftPos","rightPos","fitDataCheck","vdomHoz","paddingLeft","paddingRight","reinitChanged","reinitializeRows","initializeRow","reinitializeRow","change","generateCells","colEnd","layoutRefresh","getVisibleRows","diff","abs","addColRight","removeColLeft","addColLeft","removeColRight","start","end","changes","working","getCell","fitDataColActualWidthCheck","prepend","_this8","ex","message","_this9","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","headersElement","columnsByField","defaultColumnOptions","redrawBlockUpdate","renderer","initializeRenderer","createHeadersElement","createHeaderElement","insertBefore","scrollHorizontal","renderClass","renderers","RendererVirtualDomHorizontal","RendererBasicHorizontal","renderHorizontal","initialize","headerVisible","hozAdjust","scrollWidth","marginLeft","scrollColumns","sorter","definitions","autoColumnsDefinitions","setColumns","_addColumn","_reIndexColumns","redraw","before","nextToColumn","colEl","topColumn","parentIndex","nextEl","nextSibling","getHeight","adjustTableSize","_getSelf","HTMLElement","root","matches","active","structured","from","moveColumnActual","reinitialize","_moveColumnInArray","getComponents","updateRows","toIndex","fromIndex","adjust","scrollToColumnPosition","scrollToColumnIfVisible","offsetLeft","generateCell","totalWidth","fixedWidth","colWidth","layoutMode","resetScroll","footerManager","RowComponent","_row","transform","getCells","getPosition","watchPosition","moveToRow","updateData","normalizeHeight","nextRow","prevRow","Row","manualHeight","outerHeight","positionWatchers","created","setData","create","deleteCells","renderRowCells","rowFormatter","rerenderRowCells","children","maxHeight","rowHeight","resizableRows","setHeight","clearHeight","updatedData","newRowData","tempData","attrname","JSON","parse","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","toRow","findRow","moveRowActual","refreshActiveData","deleteActual","detachModules","deleteRow","includes","isDisplayed","group","BasicVertical","visibility","onlyGroupHeaders","styleRow","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topRow","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","margin","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topEdge","bottomEdge","topFound","bottomRow","slice","forceMove","holder","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","containerHeight","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholder","placeholderContents","firstRender","renderMode","fixedHeight","activeRowsPipeline","activeRows","activeRowsCount","displayRows","displayRowsCount","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","displayPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","renderInPosition","pagination","_setDataActual","reRenderInPosition","autoColumns","generateColumnsFromRowData","_wipeElements","wipe","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","pos","addRowActual","findAddRowPos","reverse","addRow","_clearPlaceholder","addRowPos","chainResult","moveRowInArray","findRowIndex","rowOnly","getDisplayRowIndex","getRows","handler","priority","sort","a","b","skipStage","stage","cascadeOrder","destroyed","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","viewable","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","renderEmptyScroll","initialHeight","otherHeight","external","resize","tableWidth","browser","event","createEvent","initEvent","dispatchEvent","Event","FooterManager","containerElement","createContainerElement","initializeElement","footerElement","querySelector","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","filter","links","values","comp","subscriptionChanged","clearWatchers","added","bindPseudoEvents","updateEventListeners","track","removeEventListener","path","composedPath","targets","findTargets","bindComponents","triggerEvents","targetMatches","previousTarget","closest","ComponentFunctionBinder","bindings","funcName","debugInvalidComponentFuncs","DataLoader","requestOrder","loading","params","replace","requestNo","alertLoader","mapParams","dataSendParams","response","objectInvert","dataReceiveParams","rowData","clearAlert","alertError","setTimeout","dataLoaderErrorTimeout","map","alertManager","alert","dataLoaderLoading","langText","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","args","shift","callResult","apply","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","query","results","querySelectorAll","matchElement","Tabulator","lookupTable","Popup","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","hideable","blurEvent","escEvent","_escapeCheck","destroyBinding","tableDestroyed","popupContainer","_checkContainerIsParent","body","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","containerOffset","origin","parentEl","coords","elementPositionCoords","containerEventCoords","_fitToScreen","keyCode","Module","_handler","register","func","initGuard","registerDataPipelineHandler","registerDisplayPipelineHandler","lookupIndex","append","menuEl","menuContainer","content","forced","responsiveLayout","modExists","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","responsive","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","nextColWidth","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","mode","registerTableOption","registerColumnOption","modes","dataChanged","moduleName","defaultModes","Localize","locale","lang","langList","langs","headerFilterPlaceholder","setHeaderFilterPlaceholder","installLang","setLocale","registerTableFunction","getLang","headerFilters","_setLangProp","desiredLocale","navigator","language","toLowerCase","prefix","traverseLang","trans","prop","_executeBindings","pathArray","_getLangElement","level","rootPath","binding","Comms","receive","selectors","connections","con","action","connection","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","prototype","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","moduleInitOrder","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","browserSlow","browserMobile","rtl","originalElement","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","getSelection","empty","removeAllRanges","selection","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","getComputedStyle","textDirection","direction","reactiveData","newElement","tagName","attributes","replaceChild","_detectBrowser","deregister","ua","userAgent","vendor","opera","test","stack","line","debugInitialization","Error","trim","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","addRows","newRows","getRowFromPosition","foundRows","fromRow","getDefinitionTree","fromColumn","plugin","required","debugDeprecation","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","Accessor","allowedTypes","initializeColumn","transformRow","accessor","charAt","toUpperCase","lookupAccessor","accessors","rowComponent","colComponent","generateParamsList","serializeParams","encoded","encodeURIComponent","join","url","method","headers","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","ajaxResponse","contentType","ajaxContentType","Accept","location","credentials","fetch","json","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","originalEvent","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","getKey","range","internal","sel","textRange","createRange","selectNodeContents","toString","addRange","createTextRange","moveToElementText","select","execCommand","pasteActions","parser","pasteParsers","checkPaseOrigin","getPasteData","mutateData","mutator","valid","edit","currentCell","updateOrAddData","insert","addData","headerFindSuccess","columnMap","CalcComponent","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","getResults","userRecalc","recalc","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","footerPrepend","marginRight","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","disable","enable","format","formatter","getFormatter","paramKey","getGroups","getGroupResults","groupObj","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","getPropertyValue","oldControl","getChildren","allChildren","generateChildren","dataTreeFilter","dataTreeSort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","_parseListItem","_parseListGroup","itemParams","selected","original","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","_defaultFilterFunc","_filterItem","_this10","_this11","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","_this12","startVis","isVisible","_setListWidth","_this13","hideOnBlur","_this14","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","number","step","blurFunc","date","inputFormat","DT","DateTime","luxon","convertDate","isDateTime","fromISO","fromFormat","toFormat","time","newDatetime","datetime","deprecationMsg","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","variableHeight","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","leftEdge","rightEdge","leftMargin","rightMargin","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","selectRow","selectedRows","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","htmlOutputConfig","props","lookup","fromStyle","filterVal","rowVal","filterParams","RegExp","keywords","separator","keyword","matchAll","endsWith","Filter","filterList","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","link","urlPrefix","labelField","labelTraverse","urlField","image","src","urlSuffix","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","datetimediff","suffix","humanize","now","toHuman","traffic","percentValue","colors","color","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","innerText","responsiveCollapse","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","edge","frozenCheck","calcMargins","layoutColumnPosition","layoutCalcRows","_calcSpace","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","elementContents","arrowElement","createElements","addBindings","createValueGroups","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","count","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","pullGroupListData","rowCount","headerContent","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","getRowIndex","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","optionsArr","attrib","_attribValue","exists","_findCol","textContent","inQuote","nextChar","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","mousemove","which","startMove","bindTouchEvents","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","generatePageSizeSelectList","setPageSize","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","last_page","last_row","progressiveLoadDelay","footer","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retrievedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","excludedKeys","defStore","colDef","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","getRowFromDataObject","pop","startRow","oldRows","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","nodeHeight","contentRect","nodeWidth","redrawTable","observe","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","order","generateCollapsedContent","colCount","getFlexBaseWidth","hideColumn","showColumn","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","langLocale","localeCompare","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","numeric","starts","ends","minLength","maxLength","regex","unique","cellData","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","TabulatorFull"],"mappings":";4sHAAqBA,wBAERC,kBACNA,MAAQA,+CAOHC,EAAMC,EAAQC,UACjBC,KAAKJ,MAAMK,WAAWC,KAAKL,OAAMM,OAAWA,OAAWA,EAAWL,EAAQC,0DAQrEH,MAAMQ,QAAQC,UAASC,gBAAWC,kEAIlCX,MAAMQ,QAAQC,UAASG,aAAQD,oEAI/BX,MAAMQ,QAAQC,UAASI,kBAAaF,0EASpCX,MAAMQ,QAAQM,OAAMC,uBAAkBJ,mEAItCX,MAAMQ,QAAQM,OAAME,aAAQL,uDAQjCP,KAAKJ,MAAMQ,QAAQS,OAAOC,gDAGpBC,UACNf,KAAKJ,MAAMQ,QAAQS,OAAOA,OAAOE,2DAS5BnB,MAAMoB,UAASC,kBAAaV,qEAI5BX,MAAMoB,UAASE,oBAAeX,8CAGhCY,UACHnB,KAAKJ,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.js b/dist/js/tabulator_esm.js index d06379acc..6bc882b02 100644 --- a/dist/js/tabulator_esm.js +++ b/dist/js/tabulator_esm.js @@ -1,4 +1,4 @@ -/* Tabulator v5.3.0 (c) Oliver Folkerd 2022 */ +/* Tabulator v5.3.4 (c) Oliver Folkerd 2022 */ class CoreFeature{ constructor(table){ diff --git a/dist/js/tabulator_esm.min.js b/dist/js/tabulator_esm.min.js index 0a9331a5e..05ac994e8 100644 --- a/dist/js/tabulator_esm.min.js +++ b/dist/js/tabulator_esm.min.js @@ -1,3 +1,3 @@ -/* Tabulator v5.3.3 (c) Oliver Folkerd 2022 */ -class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t){return this.table.deprecationAdvisor.check(e,t)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}class i extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed,this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(e=>{e.stopPropagation()}))),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new i(this.table,e,this),this.childPopup}}class s extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((e=>e.handler===this._handler)))>-1&&(i=t),e&&(i+=e),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new i(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}class o extends s{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":o.accessors[e]?t=o.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,i){var s="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),o=e.getComponent(),n=t.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var t,r,a,l;e.modules.accessor&&(r=e.modules.accessor[s]||e.modules.accessor.accessor||!1)&&"undefined"!=(t=e.getFieldValue(n))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(t,n,i,l,o):r.params,e.setFieldValue(n,r.accessor(t,n,i,a,l,o)))})),n}}o.moduleName="accessor",o.accessors={};function n(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(n(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(n(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function r(e){var t=n(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function a(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+r(i))),e}function l(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(l(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(l(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var h={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=l(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class d extends s{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=d.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||d.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||d.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(s,o)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},d.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}d.moduleName="ajax",d.defaultConfig={method:"GET"},d.defaultURLGenerator=a,d.defaultLoaderPromise=function(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))},d.contentTypeFormatters=h;class c extends s{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),t=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=c.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=c.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPaseOrigin(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}c.moduleName="clipboard",c.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},c.pasteParsers={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}};class u{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class m{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(){return this._cell.row.getData()}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class p extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new m(this)),this.component}}class g{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.parent instanceof f&&this._column.parent.getComponent()}_getSelf(){return this._column}scrollTo(){return this._column.table.columnManager.scrollToColumn(this._column)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var b={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0};class f extends e{constructor(e,t){super(t.table),this.definition=e,this.parent=t,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.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new f(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(f.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===f.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.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":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(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((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e{t.push(e),t=t.concat(e.getColumns(!0))})):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach((function(e){t.push(e.getDefinition(!0))})),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach((function(t){t.visible&&(e=!0)})),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.show()})),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.hide()})),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})),this.contentElement.style.maxWidth=e-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new g(this)),this.component}}f.defaultOptionList=b;class v{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(){return this._row.table.rowManager.scrollToRow(this._row)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class w extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var i,s=this.element&&t.elVisible(this.element),o={};return new Promise(((t,n)=>{"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(o=Object.assign(o,this.data),o=Object.assign(o,e)),i=this.chain("row-data-changing",[this,o,e],null,e);for(let e in i)this.data[e]=i[e];this.dispatch("row-data-save-after",this);for(let t in e){this.table.columnManager.getColumnsByFieldRoot(t).forEach((e=>{let t=this.getCell(e.getField());if(t){let o=e.getFieldValue(i);t.getValue()!=o&&(t.setValueProcessData(o),s&&t.cellRendered())}}))}s?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,s,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),t()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{e(this.position)})))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new v(this)),this.component}}var C={avg:function(e,t,i){var s=0,o=void 0!==i.precision?i.precision:2;return e.length&&(s=e.reduce((function(e,t){return Number(e)+Number(t)})),s/=e.length,s=!1!==o?s.toFixed(o):s),parseFloat(s).toString()},max:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>s||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e)){this.recalcGroup(e)})))}recalcGroup(e){var t,i;e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach((e=>{if(t.push(e.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&e.modules.dataTree&&e.modules.dataTree.open){var i=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(e));t=t.concat(i)}})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new w(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new u(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var o=new p(this.genColumn,i);o.getElement(),o.column=s,o.setWidth(),s.cells.push(o),t.push(o),s.visible||o.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}}E.moduleName="columnCalcs",E.calculations=C;class y extends s{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof w&&(e.create(),(s=e.modules.dataTree.children).index||!1===s.children||this.getChildren(e).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t){var i=e.modules.dataTree,s=[],o=[];return!1!==i.children&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s),s.forEach((e=>{o.push(e),this.getChildren(e).forEach((e=>{o.push(e)}))}))),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new w(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof w&&i.push(e)}))),i}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof w?i=e.data:e instanceof v?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof w&&t.element===e)))&&(i=i.data):null===e&&(i=!1):i=void 0!==e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof w&&(o.push(t?e.getComponent():e),i&&(o=o.concat(this.getTreeChildren(e,t,i))))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}y.moduleName="dataTree";var R={csv:function(e,t={},i){var s=t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t={},i){var s=[],o=[],n={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=t.jsPDF||{},h=t.title?t.title:"";function d(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}l.orientation||(l.orientation=t.orientation||"landscape"),l.unit||(l.unit="pt"),e.forEach((e=>{switch(e.type){case"header":s.push(d(e));break;case"group":o.push(d(e,r));break;case"calc":o.push(d(e,a));break;case"row":o.push(d(e))}}));var c=new jspdf.jsPDF(l);t.autoTable&&(n="function"==typeof t.autoTable?t.autoTable(c)||{}:t.autoTable),h&&(n.didDrawPage=function(e){c.text(h,40,30)}),n.head=s,n.body=o,c.autoTable(n),t.documentProcessing&&t.documentProcessing(c),i(c.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new e(this);function a(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),XLSX.utils.sheet_add_aoa(s,e),s["!ref"]=XLSX.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(n.SheetNames=[],n.Sheets={},i.sheetOnly)s(a());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(n.SheetNames.push(l),n.Sheets[l]=a()):(n.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){n.Sheets[l]=e}}));else n.SheetNames.push(o),n.Sheets[o]=a();i.documentProcessing&&(n=i.documentProcessing(n)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(XLSX.write(n,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}};class x extends s{constructor(e){super(e),this.registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),this.registerTableOption("downloadReady",void 0),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("downloadReady","downloadEncoder")}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:x.downloaders[e]?n=x.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=this.table.options.downloadEncoder(e,t);r&&(o?window.open(window.URL.createObjectURL(r)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}function T(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}x.moduleName="download",x.downloaders=R;class M{constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!t._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.blurable=!0,this.actions={success:s,cancel:o},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&T(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout((()=>{this.popup&&this.popup.restoreHide()}),10)}_preventBlur(){this.blurable=!1,setTimeout((()=>{this.blurable=!0}),10)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=a(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);null!=s&&""!==s&&(i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;an?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout((()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}),10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}}var L={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select()})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&o.shiftEnterSubmit&&d();break;case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},date:function(e,t,i,s,o){var n=o.format,r=n?window.DateTime||luxon.DateTime:null,a=e.getValue(),l=document.createElement("input");function h(e){return(r.isDateTime(e)?e:"iso"===n?r.fromISO(String(e)):r.fromFormat(String(e),n)).toFormat("yyyy-MM-dd")}if(l.type="date",l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.max&&l.setAttribute("max",n?h(o.max):o.max),o.min&&l.setAttribute("min",n?h(o.min):o.min),o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(e){var t=l.value;null==a&&""!==t||t!==a?(t&&n&&(t=r.fromFormat(String(t),"yyyy-MM-dd").toFormat(n)),i(t)&&(a=l.value)):s()}return a=void 0!==a?a:"",n&&(r?a=h(a):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),l},time:function(e,t,i,s,o){var n,r=o.format,a=r?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");if(h.type="time",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function d(e){var t=h.value;null==l&&""!==t||t!==l?(t&&r&&(t=a.fromFormat(String(t),"hh:mm").toFormat(r)),i(t)&&(l=h.value)):s()}return l=void 0!==l?l:"",r&&(a?(n=a.isDateTime(l)?l:"iso"===r?a.fromISO(String(l)):a.fromFormat(String(l),r),l=n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),h.value=l,t((function(){h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select()})),h.addEventListener("change",d),h.addEventListener("blur",d),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),h},datetime:function(e,t,i,s,o){var n,r=o.format,a=r?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");if(h.type="datetime-local",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function d(e){var t=h.value;null==l&&""!==t||t!==l?(t&&r&&(t=a.fromISO(String(t)).toFormat(r)),i(t)&&(l=h.value)):s()}return l=void 0!==l?l:"",r&&(a?(n=a.isDateTime(l)?l:"iso"===r?a.fromISO(String(l)):a.fromFormat(String(l),r),l=n.toFormat("yyyy-MM-dd")+"T"+n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),h.value=l,t((function(){h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select()})),h.addEventListener("change",d),h.addEventListener("blur",d),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),h},select:function(e,t,i,s,o){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new M(this,e,t,i,s,o).input},list:function(e,t,i,s,o){return new M(this,e,t,i,s,o).input},autocomplete:function(e,t,i,s,o){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new M(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(e){d.forEach((function(t,i){i'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function p(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,m(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)p(b);return m(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){m(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),m=document.createElement("div");function p(){var e=window.getComputedStyle(a,null),t=d*Math.round(m.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),m.setAttribute(e,m.getAttribute(e)+o.elementAttributes["+"+e])):m.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),m.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=m.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(m.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,p())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),m},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return d&&t?t=o.trueValue:c&&!t&&(t=o.falseValue),a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,t((function(){r.focus()})),r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r}};class k extends s{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=k.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,i){var s=!1;if(i0)for(var o=i-1;o>=0;o--){let i=e.cells[o];if(i.column.modules.edit&&t.elVisible(i.getElement())){if(this.allowEdit(i)){s=i;break}}}return s}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}initializeColumn(e){var t={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?t.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":t.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?this.editors[e.definition.formatter]?t.editor=this.editors[e.definition.formatter]:t.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}t.editor&&(e.modules.edit=t)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),n-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeftn&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":t=e.column.modules.edit.check(e.getComponent());break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check}return t}edit(e,t,i){var s,o,n,r=this,a=function(){},l=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(s=e.column.modules.edit.editor.call(r,o,(function(e){a=e}),(function(t){if(r.currentCell===e){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),e.setValue(t,!0),!0===i):(r.invalidEdit=!0,r.focusCellNoEvent(e,!0),a(),!1)}}),(function(){r.currentCell===e&&r.cancelEdit()}),n)))return l.blur(),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),l.blur(),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),a();for(var h=l.children,d=0;d{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}k.moduleName="edit",k.editors=L;class S{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class D{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}class P extends s{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],n=this.bodyToExportRows(this.rowLookup(i));return o.concat(n)}generateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.generateTableElement(o)}rowLookup(e){var t=[];if("function"==typeof e)e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&t.push(e)}));else switch(e){case!0:case"visible":t=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":t=this.table.rowManager.rows;break;case"selected":t=this.table.modules.selectRow.selectedRows;break;case"active":default:t=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],t)}generateColumnGroupHeaders(){var e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((t=>{var i=this.processColumnGroup(t);i&&e.push(i)})),e}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){var t=e.definition[this.colVisProp];return"function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1!==t&&(e.visible||!e.visible&&t)}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i1)for(let i=1;ii&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new D(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new S("header",t))})),s}bodyToExportRows(e){var t=[],i=[];return this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new D(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new D(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new S(e.type,n,e.getComponent(),r))})),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(((e,t)=>{let n;switch(e.type){case"header":i.appendChild(this.generateHeaderElement(e,r,o));break;case"group":s.appendChild(this.generateGroupElement(e,r,o));break;case"calc":s.appendChild(this.generateCalcElement(e,r,o));break;case"row":n=this.generateRowElement(e,r,o),this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),s.appendChild(t)}})),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach(((o,n)=>{if(o){var r,a=document.createElement("td"),l=o.component._column,h=this.table.columnManager.findColumnIndex(l),d=o.value,c={modules:{},getValue:function(){return d},getField:function(){return l.definition.field},getElement:function(){return a},getColumn:function(){return l.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getComponent:function(){return c},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach((function(e){a.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)d=this.table.modules.format.formatExportValue(c,this.colVisProp);else switch(typeof d){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?a.appendChild(d):a.innerHTML=d,(r=i.styleCells&&i.styleCells[h]?i.styleCells[h]:i.firstCell)&&(this.mapElementStyles(r,a,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),l.definition.align&&(a.style.textAlign=l.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==n)&&(e.component._row.modules.dataTree.controlEl&&a.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),e.component._row.modules.dataTree.branchEl&&a.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),s.appendChild(a),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback(),t.rowFormatter&&!1!==this.config.formatCells&&t.rowFormatter(e.component)}})),s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]=o.getPropertyValue(e)}))}}}}P.moduleName="export";var z={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class F extends s{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":F.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,F.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)switch(n){case"partial":o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(i){return e.getFieldValue(i)==t},r="="}i.headerFilters[s]={value:t,func:o,type:r}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d=this,c=e.modules.filter.success,u=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),u){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":d.table.modules.edit.editors[e.definition.headerFilter]?(o=d.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&d.table.modules.edit.editors[e.definition.formatter]?(o=d.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):o=d.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(d.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(){}),c,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor should return an instance of Node, the editor returned:",n);d.langBind("headerFilters|columns|"+e.definition.field,(function(e){n.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.element.scrollLeft;t!==this.table.rowManager.element.scrollLeft+parseInt(this.table.columnManager.element.style.marginLeft)&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){c(n.value)}),d.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){c(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||d.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:F.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return F.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return F.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}F.moduleName="filter",F.filters=z;var H={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a=parseFloat(e.getValue()),l="",h=t.decimal||".",d=t.thousand||",",c=t.negativeSign||"-",u=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(a<0&&(a=Math.abs(a),l=c),s=!1!==p?a.toFixed(p):a,o=(s=String(s).split("."))[0],n=s.length>1?h+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+d+"$2");return m?l+o+n+u:l+u+o+n},link:function(e,t,i){var s,o=e.getValue(),n=t.urlPrefix||"",r=t.download,a=o,l=document.createElement("a");if(t.labelField&&(s=e.getData(),a=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(o=(s=e.getData())[t.urlField]),t.url)switch(typeof t.url){case"string":o=t.url;break;case"function":o=t.url(e)}return l.setAttribute("href",n+o),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',h=void 0!==t.crossElement?t.crossElement:'';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'':'',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t={},i){var s,o,n,r,a,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),d=t.max?t.max:100,c=t.min?t.min:0,u=t.legendAlign?t.legendAlign:"center";switch(o=parseFloat(l)<=d?parseFloat(l):d,o=parseFloat(o)>=c?parseFloat(o):c,s=(d-c)/100,o=Math.round((o-c)/s),typeof t.color){case"string":n=t.color;break;case"function":n=t.color(l);break;case"object":if(Array.isArray(t.color)){let e=100/t.color.length,i=Math.floor(o/e);i=Math.min(i,t.color.length-1),i=Math.max(i,0),n=t.color[i];break}default:n="#2DC214"}switch(typeof t.legend){case"string":r=t.legend;break;case"function":r=t.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof t.legendColor){case"string":a=t.legendColor;break;case"function":a=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){let e=100/t.legendColor.length,i=Math.floor(o/e);i=Math.min(i,t.legendColor.length-1),i=Math.max(i,0),a=t.legendColor[i]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",o);var p=document.createElement("div");p.style.display="inline-block",p.style.width=o+"%",p.style.backgroundColor=n,p.style.height="100%",p.setAttribute("data-max",d),p.setAttribute("data-min",c);var g=document.createElement("div");if(g.style.position="relative",g.style.width="100%",g.style.height="100%",r){var b=document.createElement("div");b.style.position="absolute",b.style.top=0,b.style.left=0,b.style.textAlign=u,b.style.width="100%",b.style.color=a,b.innerHTML=r}return i((function(){if(!(e instanceof m)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",h.appendChild(t),h=t}h.appendChild(g),g.appendChild(p),r&&g.appendChild(b)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){var s=document.createElement("span");return e.getRow().watchPosition((e=>{s.innerText=e})),s},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(t){t.stopImmediatePropagation(),n(!o.open),e.getTable().rowManager.adjustTableSize()})),n(o.open),s},rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof v?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}};class A extends s{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":A.formatters[s]?i.formatter=A.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=A.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=A.formatters.plaintext}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){return i="function"==typeof s.params?s.params(e.getComponent()):s.params,s.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}getFormatter(e){switch(typeof e){case"string":A.formatters[e]?e=A.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=A.formatters.plaintext);break;case"function":break;default:e=A.formatters.plaintext}return e}}A.moduleName="format",A.formatters=H;class _ extends s{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)}))}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}scrollHorizontal(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}calcMargins(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i+this.table.columnManager.scrollLeft,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),s.modules.frozen.edge&&n.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.visible&&(s+=t.getWidth()),t.modules.frozen.marginValue=this.rightPadding-s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}_calcSpace(e,t){var i=0;for(let s=0;s{this.initializeRow(e)}))}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;"number"===i?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):"function"===i?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){return this.rows.indexOf(e)>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.table.rowManager.adjustTableSize(),this.rows.push(e),this.refreshData(!1,"display"),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}O.moduleName="frozenRows";class B{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group._visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class I{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i{e.modules&&delete e.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.toggleVisibility()}))}_createGroup(e,t){var i=t+"_"+e,s=new I(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}generateGroupHeaderContents(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"("+s+" "+(1===s?e:t.groups.items)+")"})),this.groupIDLookups=[],Array.isArray(e))this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof I&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof I?t:t.modules.group,o=e instanceof I?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.table.options.groupBy&&this.groupList.forEach((function(e){e.wipe()}))}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new I(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}scrollHeaders(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)})))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach(((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}}V.moduleName="groupRows";class N extends s{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return N.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return N.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof w)i.component===e&&(i.component=t);else if(i.component instanceof p&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}N.moduleName="history",N.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},N.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};class W extends s{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?G.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t){var i=this.lookupImporter(e);if(i)return this.pickFile(t).then(this.importData.bind(this,i)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import file"),Promise.reject(e))))}pickFile(e){return new Promise(((t,i)=>{var s=document.createElement("input");s.type="file",s.accept=e,s.addEventListener("change",(e=>{var o=s.files[0],n=new FileReader;switch(this.table.options.importReader){case"buffer":n.readAsArrayBuffer(o);break;case"binary":n.readAsBinaryString(o);break;case"url":n.readAsDataURL(o);break;case"text":default:n.readAsText(o)}n.onload=e=>{t(n.result)},n.onerror=e=>{console.warn("File Load Error - Unable to read file"),i()}})),s.click()}))}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}structureArrayToObject(e){var t=e.shift();return e.map((e=>{var i={};return t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach((e=>{var s={};e.forEach(((e,t)=>{var o=i[t];o&&(s[o.getField()]=e)})),t.push(s)})),t}setData(e){return this.table.setData(e)}}G.moduleName="import",G.importers=j;class U extends s{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this))}cellContentsSelectionFixer(e,t){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==t){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(t.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,o=i.getComponent();this.columnSubscribers[e]&&(i instanceof p?s=i.column.definition[e]:i instanceof f&&(s=i.definition[e]),s&&s(t,o)),this.dispatchExternal(e,t,o)}}U.moduleName="interaction";class X extends s{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,X.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)X.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:X.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}X.moduleName="keybindings",X.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},X.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class q extends s{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}q.moduleName="menu";class K extends s{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){var i,s=this,o={};e.modules.frozen||e.isGroup||(i=e.getElement(),o.mousemove=function(o){e.parent===s.moving.parent&&((s.touchMove?o.touches[0].pageX:o.pageX)-t.elOffset(i).left+s.table.columnManager.element.scrollLeft>e.getWidth()/2?s.toCol===e&&s.toColAfter||(i.parentNode.insertBefore(s.placeholderElement,i.nextSibling),s.moveColumn(e,!0)):(s.toCol!==e||s.toColAfter)&&(i.parentNode.insertBefore(s.placeholderElement,i),s.moveColumn(e,!1)))}.bind(s),i.addEventListener("mousedown",(function(t){s.touchMove=!1,1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),s.bindTouchEvents(e)),e.modules.moveColumn=o}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,i){var s=i.getElement(),o=this.table.columnManager.getElement(),n=this.table.columnManager.getHeadersElement();this.moving=i,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=i.getWidth()+"px",this.placeholderElement.style.height=i.getHeight()+"px",s.parentNode.insertBefore(this.placeholderElement,s),s.parentNode.removeChild(s),this.hoverElement=s.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=o.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var i,s=this.table.columnManager.getElement(),o=s.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left+o;this.hoverElement.style.left=n-this.startX+"px",n-o{i=Math.max(0,o-5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1))),o+s.clientWidth-n{i=Math.min(s.clientWidth,o+5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1)))}}K.moduleName="moveColumn";class J extends s{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var i=this,s={};s.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),s.mousemove=function(s){var o;s.pageY-t.elOffset(e.element).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||((o=e.getElement()).parentNode.insertBefore(i.placeholderElement,o.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(o=e.getElement()).previousSibling&&(o.parentNode.insertBefore(i.placeholderElement,o),i.moveRow(e,!1))}.bind(i),e.modules.moveRow=s}initializeRow(e){var i,s=this,o={};o.mouseup=function(t){s.tableRowDrop(t,e)}.bind(s),o.mousemove=function(i){var o=e.getElement();i.pageY-t.elOffset(o).top+s.table.rowManager.element.scrollTop>e.getHeight()/2?s.toRow===e&&s.toRowAfter||(o.parentNode.insertBefore(s.placeholderElement,o.nextSibling),s.moveRow(e,!0)):(s.toRow!==e||s.toRowAfter)&&(o.parentNode.insertBefore(s.placeholderElement,o),s.moveRow(e,!1))}.bind(s),this.hasHandle||((i=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=o}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}J.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},J.prototype.senders={delete:function(e,t,i){e.delete()}},J.moduleName="moveRow";class Y extends s{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Y.mutators[e]?t=Y.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===s||(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}Y.moduleName="mutator",Y.mutators={};var $={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class Z extends s{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Z.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()}))}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}Z.moduleName="page",Z.pageCounters=$;var Q={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},ee={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class te extends s{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:te.readers[this.table.options.persistenceReaderFunc]?this.readFunc=te.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):te.readers[this.mode]?this.readFunc=te.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:te.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=te.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):te.writers[this.mode]?this.writeFunc=te.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:e=>{s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:()=>(i.get&&i.get(),s)})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t){var i=[];return(t=t||[]).forEach(((t,s)=>{var o,n=this._findColumn(e,t);n&&(!0===this.config.columns||null==this.config.columns?(o=Object.keys(n)).push("width"):o=this.config.columns,o.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(n[e]=t[e])})),n.columns&&(n.columns=this.mergeDefinition(n.columns,t.columns)),i.push(n))})),e.forEach(((e,s)=>{this._findColumn(t,e)||(i.length>s?i.splice(s,0,e):i.push(e))})),i}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}te.moduleName="persistence",te.moduleInitOrder=-10,te.readers=Q,te.writers=ee;class ie extends s{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup")}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i){var s;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){s=e})):e,this.loadPopup(t,i,e,s)}loadPopup(e,t,i,s){var o,n,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(e=>{e.stopPropagation()})),r||e.preventDefault(),n=this.popup(o),"function"==typeof s&&n.renderCallback(s),n.show(e).hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}ie.moduleName="popup";class se extends s{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}se.moduleName="print";class oe extends s{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),s=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),s=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o,n=Array.from(arguments),r=n[0]<0?e.length+n[0]:n[0],a=n[1],l=!!n[2]&&n.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((s=!!e[r]&&i.table.rowManager.getRowFromDataObject(e[r]))?l.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(l=l.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==a){var h=e.slice(r,void 0===n[1]?n[1]:r+a);h.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==h.length-1)}))}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var o=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return o}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var o=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return o}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var o=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return o}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var o=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return o}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var o=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return o}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,o=Object.getOwnPropertyDescriptor(t,i),n=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(n=t,!s.blocked&&r===s.currentVersion){s.block("key");var a={};a[i]=t,e.updateData(a),s.unblock("key")}o.set&&o.set(t)},get:()=>(o.get&&o.get(),n)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}oe.moduleName="reactiveData";class ne extends s{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}reinitializeColumn(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((e=>{e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.table.externalEvents.dispatch("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this;function o(e){var i,o,n=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=n-s.startX,a=n-s.latestX;if(s.latestX=n,s.table.rtl&&(r=-r,a=-a),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(s.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(s.nextColumn=s.initialNextColumn),s.table.options.resizableColumnFit&&s.nextColumn&&(!i||!o)){let e=s.nextColumn.getWidth();a>0&&e<=s.nextColumn.minWidth&&(s.nextColumn=s.nextColumn.nextColumn()),s.nextColumn&&s.nextColumn.setWidth(s.nextColumn.getWidth()-a)}s.table.columnManager.rerenderColumns(!0),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.dispatch("column-resized",t),s.table.externalEvents.dispatch("columnResized",t.getComponent()))}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}ne.moduleName="resizeColumns";class re extends s{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}_mouseDown(e,t,i){var s=this;function o(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}re.moduleName="resizeRows";class ae extends s{constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.redrawTable())}})),this.resizeObserver.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),this.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell)&&(t.columnManager.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver((e=>{this.visible=e[0].isIntersecting,this.initialized||(this.initialized=!0,this.initialRedraw=!this.visible),this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1)})),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}ae.moduleName="resizeTable";class le extends s{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=this,t=!0;t;){let i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(s<0){let i=e.columns[e.index];i?(e.hideColumn(i),e.index++):t=!1}else{let i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}generateCollapsedRowData(e){var t,i=this,s=e.getData(),o=[];return this.hiddenColumns.forEach((function(n){var r=n.getFieldValue(s);if(n.definition.title&&n.field)if(n.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()}},o.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(i.table.modules.format,t,n.modules.format.params,(function(e){e()}))})}else o.push({field:n.field,title:n.definition.title,value:r})})),o}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((function(e){var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)}),this),Object.keys(e).length?t:""}}le.moduleName="responsiveLayout";class he extends s{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectable","highlight"),this.registerTableOption("selectableRangeMode","drag"),this.registerTableOption("selectableRollingSelection",!0),this.registerTableOption("selectablePersistence",!0),this.registerTableOption("selectableCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=e.getElement(),s=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",s)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectable||this.isRowSelected(e)||this.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}toggleRow(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t;switch(typeof e){case"undefined":this.table.rowManager.rows.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(t=this.table.rowManager.findRow(e))?(this._selectRow(t,!0,!0),this._rowSelectionChanged()):((t=this.table.rowManager.getRows(e)).forEach((e=>{this._selectRow(e,!0,!0)})),t.length&&this._rowSelectionChanged());break;default:Array.isArray(e)?(e.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}}_selectRow(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);s?-1==this.selectedRows.indexOf(s)&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s=this;if(void 0===e){i=s.selectedRows.length;for(let e=0;e-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),s.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),s._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}function de(e,t,i,s,o,n,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l)),a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}he.moduleName="selectRow";var ce={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),de.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),de.call(this,e,t,i,s,o,n,r)},datetime:de,boolean:function(e,t,i,s,o,n,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,o,n,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function d(e){var t;switch(a){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length}return t}if(Array.isArray(e)){if(Array.isArray(t))return d(t)-d(e);h=1}else h=Array.isArray(t)?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,m=/(\d+)|(\D+)/g,p=/\d/,g=r.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((a=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(m),l=l.match(m),c=a.length>l.length?l.length:a.length;ud?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class ue extends s{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":ue.sorters[e.definition.sorter]?s=ue.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}if(e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort){switch((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(i),e.modules.sort.element=i,this.setColumnHeaderSortIcon(e,"none"),t.addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?((o=(s=this.getSort()).findIndex((t=>t.field===e.getField())))>-1?(s[o].dir=i,o=s.splice(o,1)[0],"none"!=i&&s.push(o)):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}}))}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return ue.sorters[s]}sort(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,s.push(e)),t.setColumnHeader(e.column,e.dir))})),s.length&&t._sortItems(e,s)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i,s=e.modules.sort.element;if(e.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,e.getComponent(),t))?s.appendChild(i):s.innerHTML=i}}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}ue.moduleName="sort",ue.sorters=ce;class me extends s{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,o,n;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof p?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof o&&this.popupInstance.renderCallback(o),n=this.popupInstance.containerEventCoords(e),this.popupInstance.show(n.x+15,n.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}me.moduleName="tooltip";var pe={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class ge extends s{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:ge.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}ge.moduleName="validate",ge.validators=pe;var be=Object.freeze({__proto__:null,AccessorModule:o,AjaxModule:d,ClipboardModule:c,ColumnCalcsModule:E,DataTreeModule:y,DownloadModule:x,EditModule:k,ExportModule:P,FilterModule:F,FormatModule:A,FrozenColumnsModule:_,FrozenRowsModule:O,GroupRowsModule:V,HistoryModule:N,HtmlTableImportModule:W,ImportModule:G,InteractionModule:U,KeybindingsModule:X,MenuModule:q,MoveColumnsModule:K,MoveRowsModule:J,MutatorModule:Y,PageModule:Z,PersistenceModule:te,PopupModule:ie,PrintModule:se,ReactiveDataModule:oe,ResizeColumnsModule:ne,ResizeRowsModule:re,ResizeTableModule:ae,ResponsiveLayoutModule:le,SelectRowModule:he,SortModule:ue,TooltipModule:me,ValidateModule:ge});class fe{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults);if(Object.assign(i,e),!1!==t.debugInvalidOptions||this.table.options.debugInvalidOptions)for(let e in t)i.hasOwnProperty(e)||console.warn("Invalid "+this.msgType+" option:",e);for(let e in i)e in t?i[e]=t[e]:Array.isArray(i[e])?i[e]=Object.assign([],i[e]):"object"==typeof i[e]&&null!==i[e]?i[e]=Object.assign({},i[e]):void 0===i[e]&&delete i[e];return i}}class ve extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,i,s){var o=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise(((a,l)=>{if(o>-1){if(void 0===s&&(s=this.table.options.scrollToRowIfVisible),!s&&t.elVisible(n)&&(r=t.elOffset(n).top-t.elOffset(this.elementVertical).top)>0&&r{e.element.appendChild(t.getElement()),t.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class Ce extends ve{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){var e=this.options("columns"),t=!0;return"fitDataTable"==this.options("layout")&&(console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),t=!1),this.options("responsiveLayout")&&(console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),t=!1),this.options("rtl")&&(console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction"),t=!1),e&&e.find((e=>e.frozen))&&(console.warn("Horizontal Virtual DOM is not compatible with frozen columns"),t=!1),t}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t={};if(e.visible){var i=e.getWidth();t.leftPos=s,t.rightPos=s+i,t.width=i,this.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+i>this.vDomScrollPosLeft&&s{e.element.appendChild(t.getElement()),t.cellRendered()}))}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++)this.columns[e].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,e=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){t=e.getElement(),e.generateCells(),this.tableElement.appendChild(t);for(let i=0;i{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){this.getVisibleRows().forEach((e=>{this.reinitializeRow(e,!0)}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if("group"!==e.type){var t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}})),this.fitDataColActualWidthCheck(i),this.rightCol++,this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().prepend(t.getElement()),t.cellRendered()}})),this.leftCol--,this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let t=this.fitDataColActualWidthCheck(i);t&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+t,this.vDomPadRight-=t)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=i.getWidth(),this.rightCol--):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=i.getWidth(),this.leftCol++):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};for(let t=this.leftCol;t<=this.rightCol;t++){let i=this.columns[t];if(i&&i.visible){let t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}}}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class Ee extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new fe(this.table,"column definition",b),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.element.insertBefore(this.headersElement,this.element.firstChild),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this))}initializeRenderer(){var e,t={virtual:Ce,basic:we};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getHeadersElement(){return this.headersElement}scrollHorizontal(e){var t=0,i=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=e,e>i?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}generateColumnsFromRowData(e){var t,i,s=[],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){for(var n in t=e[0]){let e={field:n,title:n},o=t[n];switch(typeof o){case"undefined":i="string";break;case"boolean":i="boolean";break;case"object":i=Array.isArray(o)?"array":"string";break;default:i=isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}e.sorter=i,s.push(e)}if(o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,s);break;case"object":Array.isArray(o)?s.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):s.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=s}else this.table.options.columns=s;this.setColumns(this.table.options.columns)}}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new f(e,this),o=s.getElement(),n=i?this.findColumnIndex(i):i;if(i&&n>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(a,0,s),l.parentNode.insertBefore(o,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.element.style.height="",this.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),this.element.style.height=e+"px",this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize())}findColumn(e){var t;if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof f)return e;if(e instanceof g)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t=[],this.columns.forEach((e=>{t.push(e),t=t.concat(e.getColumns(!0))})),t.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{i.split(".")[0]===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex((e=>e.visible));return e>-1&&this.columnsByIndex[e]}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=0,n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&(o=r.offsetLeft)>0&&o+r.offsetWidth{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){t.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class ye extends ve{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0;this.rows().forEach(((i,s)=>{this.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),this.renderRows(),e&&e()}scrollToRowNearestTop(e){var i=t.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(e){var i=e.getElement();this.elementVertical.scrollTop=t.elOffset(i).top-t.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class Re extends ve{constructor(e){super(e),this.verticalFillMode="fill",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=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a){e.deinitializeHeight()})),e&&e(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager._showPlaceholder()),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,i,s){var o=this.tableElement,n=this.elementVertical,r=0,a=0,l=0,h=0,d=0,c=this.rows(),u=c.length,m=this.elementVertical.clientHeight;if(s=s||0,e=e||0){for(;o.firstChild;)o.removeChild(o.firstChild);(l=(u-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*p),this.vDomBottom++,d++}e?(this.vDomTopPad=i?this.vDomRowHeight*this.vDomTop+s:this.scrollTop-h,this.vDomBottomPad=this.vDomBottom==u-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-h,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+h)/d),this.vDomBottomPad=this.vDomRowHeight*(u-this.vDomBottom-1),this.vDomScrollHeight=h+a+this.vDomBottomPad-m),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",i&&(this.scrollTop=this.vDomTopPad+h+s-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-m:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-m),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&i&&(this.scrollTop+=this.elementVertical.offsetHeight-m),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.insertBefore(d.getElement(),i.firstChild),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomTop--,n--,r++):a=!1):a=!1}else a=!1;for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomTop];a&&o=r?(this.vDomTop++,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0,a=!0;a;){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.appendChild(d.getElement()),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomBottom++,n++,r++):a=!1):a=!1}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomBottom];a&&o=r?(this.vDomBottom--,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class xe extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){if("string"==typeof this.table.options.placeholder){let e=document.createElement("div");e.classList.add("tabulator-placeholder");let t=document.createElement("div");t.classList.add("tabulator-placeholder-contents"),t.innerHTML=this.table.options.placeholder,e.appendChild(t),this.placeholderContents=t,this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(void 0===e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof w)return e;if(e instanceof v)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e){return this.getDisplayRows().find((t=>t.getPosition()===e&&t.isDisplayed()))}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new w(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i){var s=[];return new Promise(((o,n)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((o,n)=>{var r=this.addRow(o,t,i,!0);s.push(r),this.dispatch("row-added",r,e,t,i)})),this.refreshActiveData(!1,!1,!0),this.regenerateRowPositions(),s.length&&this._clearPlaceholder(),o(s)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof w?e:new w(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,i,s){var o=this.table,n="",r=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((r=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)n="dataPipeline",i&&(r==this.dataPipeline.length-1?n="display":r++);else{if(!((r=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",i&&(r==this.displayPipeline.length-1?n="end":r++)}else n=e||"all",r=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{"row"===e.type&&(e.setPosition(t),t++)}))}setActiveRows(e){this.activeRows=e,this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];if(e)switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0)}else t=this.chain("rows-retrieve",e,null,this.rows)||this.rows;return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.dispatchExternal("renderComplete"))}initializeRenderer(){var e,t={virtual:Re,basic:ye};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),this.table.element.clientHeight||this.table.options.height?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}_showPlaceholder(){this.placeholder&&(this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth="")}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(e){e.normalizeHeight()}))}adjustTableSize(){var e,t=this.element.clientHeight;if("fill"===this.renderer.verticalFillMode){let i=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px",this.element.style.minHeight=e||"calc(100% - "+i+"px)",this.element.style.height="calc(100% - "+i+"px)",this.element.style.maxHeight="calc(100% - "+i+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-i+"px",this.element.scrollTop=this.scrollTop),this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw())}this._positionPlaceholder()}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(t))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Te extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Me extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]||(t[this.componentMap[e]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={},n={};for(let e of i){let i,r=t[e],a=this.previousTargets[e];if(a&&a.target===r)i=a.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===r)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(r));break;case"cell":s.components.includes("cell")&&(o.row instanceof w?i=o.row.findCell(r):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(o[e]=i,n[e]={target:r,component:i})}return this.previousTargets=n,o}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Le{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class ke extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",e,null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve())}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Se{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class De{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Pe extends e{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t){var i="";return void 0===this.options(e)||(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(e){this._warnUser(e)}}class ze{static register(e){ze.tables.push(e)}static deregister(e){var t=ze.tables.indexOf(e);t>-1&&ze.tables.splice(t,1)}static lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;n{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(n=e),e.visible&&(i+=e.getWidth())})),n?(o=s-i+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?n.setWidth(o):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,s,o=this.table.rowManager.element.getBoundingClientRect().width,n=0,r=0,a=0,l=[],h=[],d=0,c=0;function u(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function m(e,t,i,s){var o=[],n=0,r=0,l=0,h=a,d=0,c=0,p=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return u(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=u(t),n+=s>i?s:i,e.definition.widthShrink&&(h.push({column:e,width:s>i?s:i}),d+=e.definition.widthShrink)):(l.push({column:e,width:0}),a+=e.definition.widthGrow||1))})),r=o-n,i=Math.floor(r/a),c=m(l,r,i,!1),l.length&&c>0&&(l[l.length-1].width+=c),l.forEach((function(e){r-=e.width})),(s=Math.abs(c)+r)>0&&d&&(c=m(h,s,Math.floor(s/d),!0)),c&&h.length&&(h[h.length-1].width-=c),l.forEach((function(e){e.column.setWidth(e.width)})),h.forEach((function(e){e.column.setWidth(e.width)}))}};class Ae extends s{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;Ae.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),Ae.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}Ae.moduleName="layout",Ae.modes=He;class _e extends s{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=t.deepClone(_e.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}setHeaderFilterColumnPlaceholder(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=t.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}_e.moduleName="localize",_e.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class Oe extends s{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return ze.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}Oe.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:Ae,LocalizeModule:_e,CommsModule:Oe});class Ie{constructor(e,t){this.bindStaticFunctionality(e),this.bindModules(e,Be,!0),t&&this.bindModules(e,t)}bindStaticFunctionality(e){e.moduleBindings={},e.extendModule=function(t,i,s){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if("object"==typeof s)for(let e in s)o[e]=s[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{e.registerModuleBinding(t)}))},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(e){var t=ze.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},e.prototype.bindModules=function(){var t=[],i=[],s=[];for(var o in this.modules={},e.moduleBindings){let n=e.moduleBindings[o],r=new n(this);this.modules[o]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?t.push(r):i.push(r):s.push(r)}t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),i.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=t.concat(s.concat(i))}}bindModules(e,t,i){var s=Object.values(t);i&&s.forEach((e=>{e.prototype.moduleCore=!0})),e.registerModule(s)}}class Ve extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Ne{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Le(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Pe(this),this.optionsList=new fe(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),ze.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new Ee(this),this.rowManager=new xe(this),this.footerManager=new Te(this),this.dataLoader=new ke(this),this.alertManager=new Ve(this),this.bindModules(),this.options=this.optionsList.generate(Ne.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Se(this,this.options,this.options.debugEventsExternal),this.eventBus=new De(this.options.debugEventsInternal),this.interactionMonitor=new Me(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(this.destroyed=!0,ze.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var s=this.rowManager.findRow(e[this.options.index]);s&&(t++,s.updateData(e).then((()=>{--t||i()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}Ne.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new Ie(Ne);class We extends Ne{}new Ie(We,be);class je{constructor(e){this.type=e,this.element=this._createElement()}_createElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}}export{o as AccessorModule,d as AjaxModule,u as CalcComponent,m as CellComponent,c as ClipboardModule,E as ColumnCalcsModule,g as ColumnComponent,y as DataTreeModule,x as DownloadModule,k as EditModule,P as ExportModule,F as FilterModule,A as FormatModule,_ as FrozenColumnsModule,O as FrozenRowsModule,B as GroupComponent,V as GroupRowsModule,N as HistoryModule,W as HtmlTableImportModule,G as ImportModule,U as InteractionModule,X as KeybindingsModule,q as MenuModule,s as Module,K as MoveColumnsModule,J as MoveRowsModule,Y as MutatorModule,Z as PageModule,te as PersistenceModule,ie as PopupModule,se as PrintModule,je as PseudoRow,oe as ReactiveDataModule,ve as Renderer,ne as ResizeColumnsModule,re as ResizeRowsModule,ae as ResizeTableModule,le as ResponsiveLayoutModule,v as RowComponent,he as SelectRowModule,ue as SortModule,Ne as Tabulator,We as TabulatorFull,me as TooltipModule,ge as ValidateModule}; +/* Tabulator v5.3.4 (c) Oliver Folkerd 2022 */ +class e{constructor(e){this.table=e}reloadData(e,t,i){return this.table.dataLoader.load(e,void 0,void 0,void 0,t,i)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(e){return this.table.modules.layout.layout(e)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(e){return this.table.eventBus.subscribed(e)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(e){return this.table.externalEvents.subscribed(e)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(e){return this.table.options[e]}setOption(e,t){return void 0!==t&&(this.table.options[e]=t),this.table.options[e]}deprecationCheck(e,t){return this.table.deprecationAdvisor.check(e,t)}deprecationCheckMsg(e,t){return this.table.deprecationAdvisor.checkMsg(e,t)}deprecationMsg(e){return this.table.deprecationAdvisor.msg(e)}module(e){return this.table.module(e)}}class t{static elVisible(e){return!(e.offsetWidth<=0&&e.offsetHeight<=0)}static elOffset(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset-document.documentElement.clientTop,left:t.left+window.pageXOffset-document.documentElement.clientLeft}}static deepClone(e,t,i=[]){var s={}.__proto__,o=[].__proto__;for(var n in t||(t=Object.assign(Array.isArray(e)?[]:{},e)),e){let r,a,l=e[n];null==l||"object"!=typeof l||l.__proto__!==s&&l.__proto__!==o||(r=i.findIndex((e=>e.subject===l)),r>-1?t[n]=i[r].copy:(a=Object.assign(Array.isArray(l)?[]:{},l),i.unshift({subject:l,copy:a}),t[n]=this.deepClone(l,a,i)))}return t}}class i extends e{constructor(e,t,i){super(e),this.element=t,this.container=this._lookupContainer(),this.parent=i,this.reversedX=!1,this.childPopup=null,this.blurable=!1,this.blurCallback=null,this.renderedCallback=null,this.visible=!1,this.hideable=!0,this.element.classList.add("tabulator-popup-container"),this.blurEvent=this.hide.bind(this,!1),this.escEvent=this._escapeCheck.bind(this),this.destroyBinding=this.tableDestroyed,this.destroyed=!1}tableDestroyed(){this.destroyed=!0,this.hide(!0)}_lookupContainer(){var e=this.table.options.popupContainer;return"string"==typeof e?(e=document.querySelector(e))||console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)"):!0===e&&(e=this.table.element),e&&!this._checkContainerIsParent(e)&&(e=!1,console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")),e||(e=document.body),e}_checkContainerIsParent(e,t=this.table.element){return e===t||!!t.parentNode&&this._checkContainerIsParent(e,t.parentNode)}renderCallback(e){this.renderedCallback=e}containerEventCoords(e){var i=!(e instanceof MouseEvent),s=i?e.touches[0].pageX:e.pageX,o=i?e.touches[0].pageY:e.pageY;if(this.container!==document.body){let e=t.elOffset(this.container);s-=e.left,o-=e.top}return{x:s,y:o}}elementPositionCoords(e,i="right"){var s,o,n,r=t.elOffset(e);switch(this.container!==document.body&&(s=t.elOffset(this.container),r.left-=s.left,r.top-=s.top),i){case"right":o=r.left+e.offsetWidth,n=r.top-1;break;case"bottom":o=r.left,n=r.top+e.offsetHeight}return{x:o,y:n,offset:r}}show(e,t){var i,s,o,n,r;return this.destroyed||this.table.destroyed||(e instanceof HTMLElement?(o=e,n=(r=this.elementPositionCoords(e,t)).offset,i=r.x,s=r.y):"number"==typeof e?(n={top:0,left:0},i=e,s=t):(i=(r=this.containerEventCoords(e)).x,s=r.y,this.reversedX=!1),this.element.style.top=s+"px",this.element.style.left=i+"px",this.container.appendChild(this.element),"function"==typeof this.renderedCallback&&this.renderedCallback(),this._fitToScreen(i,s,o,n,t),this.visible=!0,this.subscribe("table-destroy",this.destroyBinding),this.element.addEventListener("mousedown",(e=>{e.stopPropagation()}))),this}_fitToScreen(e,t,i,s,o){var n=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if((e+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX)&&(this.element.style.left="",this.element.style.right=i?this.container.offsetWidth-s.left+"px":this.container.offsetWidth-e+"px",this.reversedX=!0),t+this.element.offsetHeight>Math.max(this.container.offsetHeight,n?this.container.scrollHeight:0))if(i)switch(o){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-i.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+i.offsetHeight+1+"px"}else this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+"px"}isVisible(){return this.visible}hideOnBlur(e){return this.blurable=!0,this.visible&&(setTimeout((()=>{this.table.rowManager.element.addEventListener("scroll",this.blurEvent),this.subscribe("cell-editing",this.blurEvent),document.body.addEventListener("click",this.blurEvent),document.body.addEventListener("contextmenu",this.blurEvent),document.body.addEventListener("mousedown",this.blurEvent),window.addEventListener("resize",this.blurEvent),document.body.addEventListener("keydown",this.escEvent)}),100),this.blurCallback=e),this}_escapeCheck(e){27==e.keyCode&&this.hide()}blockHide(){this.hideable=!1}restoreHide(){this.hideable=!0}hide(e=!1){return this.visible&&this.hideable&&(this.blurable&&(document.body.removeEventListener("keydown",this.escEvent),document.body.removeEventListener("click",this.blurEvent),document.body.removeEventListener("contextmenu",this.blurEvent),document.body.removeEventListener("mousedown",this.blurEvent),window.removeEventListener("resize",this.blurEvent),this.table.rowManager.element.removeEventListener("scroll",this.blurEvent),this.unsubscribe("cell-editing",this.blurEvent)),this.childPopup&&this.childPopup.hide(),this.parent&&(this.parent.childPopup=null),this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.visible=!1,this.blurCallback&&!e&&this.blurCallback(),this.unsubscribe("table-destroy",this.destroyBinding)),this}child(e){return this.childPopup&&this.childPopup.hide(),this.childPopup=new i(this.table,e,this),this.childPopup}}class s extends e{constructor(e,t){super(e),this._handler=null}initialize(){}registerTableOption(e,t){this.table.optionsList.register(e,t)}registerColumnOption(e,t){this.table.columnManager.optionsList.register(e,t)}registerTableFunction(e,t){void 0===this.table[e]?this.table[e]=(...i)=>(this.table.initGuard(e),t(...i)):console.warn("Unable to bind table function, name already in use",e)}registerComponentFunction(e,t,i){return this.table.componentFunctionBinder.bind(e,t,i)}registerDataHandler(e,t){this.table.rowManager.registerDataPipelineHandler(e,t),this._handler=e}registerDisplayHandler(e,t){this.table.rowManager.registerDisplayPipelineHandler(e,t),this._handler=e}displayRows(e){var t,i=this.table.rowManager.displayRows.length-1;if(this._handler&&(t=this.table.rowManager.displayPipeline.findIndex((e=>e.handler===this._handler)))>-1&&(i=t),e&&(i+=e),this._handler)return i>-1?this.table.rowManager.getDisplayRows(i):this.activeRows()}activeRows(){return this.table.rowManager.activeRows}refreshData(e,t){t||(t=this._handler),t&&this.table.rowManager.refreshActiveData(t,!1,e)}footerAppend(e){return this.table.footerManager.append(e)}footerPrepend(e){return this.table.footerManager.prepend(e)}footerRemove(e){return this.table.footerManager.remove(e)}popup(e,t){return new i(this.table,e,t)}alert(e,t){return this.table.alertManager.alert(e,t)}clearAlert(){return this.table.alertManager.clear()}}class o extends s{constructor(e){super(e),this.allowedTypes=["","data","download","clipboard","print","htmlOutput"],this.registerColumnOption("accessor"),this.registerColumnOption("accessorParams"),this.registerColumnOption("accessorData"),this.registerColumnOption("accessorDataParams"),this.registerColumnOption("accessorDownload"),this.registerColumnOption("accessorDownloadParams"),this.registerColumnOption("accessorClipboard"),this.registerColumnOption("accessorClipboardParams"),this.registerColumnOption("accessorPrint"),this.registerColumnOption("accessorPrintParams"),this.registerColumnOption("accessorHtmlOutput"),this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="accessor"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupAccessor(e.definition[n]))&&(t=!0,i[n]={accessor:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.accessor=i)}lookupAccessor(e){var t=!1;switch(typeof e){case"string":o.accessors[e]?t=o.accessors[e]:console.warn("Accessor Error - No such accessor found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,i){var s="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),o=e.getComponent(),n=t.deepClone(e.data||{});return this.table.columnManager.traverse((function(e){var t,r,a,l;e.modules.accessor&&(r=e.modules.accessor[s]||e.modules.accessor.accessor||!1)&&"undefined"!=(t=e.getFieldValue(n))&&(l=e.getComponent(),a="function"==typeof r.params?r.params(t,n,i,l,o):r.params,e.setFieldValue(n,r.accessor(t,n,i,a,l,o)))})),n}}o.moduleName="accessor",o.accessors={};function n(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(n(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(n(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}function r(e){var t=n(e),i=[];return t.forEach((function(e){i.push(encodeURIComponent(e.key)+"="+encodeURIComponent(e.value))})),i.join("&")}function a(e,t,i){return e&&i&&Object.keys(i).length&&(t.method&&"get"!=t.method.toLowerCase()||(t.method="get",e+=(e.includes("?")?"&":"?")+r(i))),e}function l(e,t){var i=[];if(t=t||"",Array.isArray(e))e.forEach(((e,s)=>{i=i.concat(l(e,t?t+"["+s+"]":s))}));else if("object"==typeof e)for(var s in e)i=i.concat(l(e[s],t?t+"["+s+"]":s));else i.push({key:t,value:e});return i}var h={json:{headers:{"Content-Type":"application/json"},body:function(e,t,i){return JSON.stringify(i)}},form:{headers:{},body:function(e,t,i){var s=l(i),o=new FormData;return s.forEach((function(e){o.append(e.key,e.value)})),o}}};class d extends s{constructor(e){super(e),this.config={},this.url="",this.urlGenerator=!1,this.params=!1,this.loaderPromise=!1,this.registerTableOption("ajaxURL",!1),this.registerTableOption("ajaxURLGenerator",!1),this.registerTableOption("ajaxParams",{}),this.registerTableOption("ajaxConfig","get"),this.registerTableOption("ajaxContentType","form"),this.registerTableOption("ajaxRequestFunc",!1),this.registerTableOption("ajaxRequesting",(function(){})),this.registerTableOption("ajaxResponse",!1),this.contentTypeFormatters=d.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||d.defaultLoaderPromise,this.urlGenerator=this.table.options.ajaxURLGenerator||d.defaultURLGenerator,this.table.options.ajaxURL&&this.setUrl(this.table.options.ajaxURL),this.setDefaultConfig(this.table.options.ajaxConfig),this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this)),this.subscribe("data-loading",this.requestDataCheck.bind(this)),this.subscribe("data-params",this.requestParams.bind(this)),this.subscribe("data-load",this.requestData.bind(this))}requestParams(e,t,i,s){var o=this.table.options.ajaxParams;return o&&("function"==typeof o&&(o=o.call(this.table)),s=Object.assign(s,o)),s}requestDataCheck(e,t,i,s){return!((e||!this.url)&&"string"!=typeof e)}requestData(e,t,i,s,o){var n;return!o&&this.requestDataCheck(e)?(e&&this.setUrl(e),n=this.generateConfig(i),this.sendRequest(this.url,t,n)):o}setDefaultConfig(e={}){this.config=Object.assign({},d.defaultConfig),"string"==typeof e?this.config.method=e:Object.assign(this.config,e)}generateConfig(e={}){var t=Object.assign({},this.config);return"string"==typeof e?t.method=e:Object.assign(t,e),t}setUrl(e){this.url=e}getUrl(){return this.url}sendRequest(e,t,i){return!1!==this.table.options.ajaxRequesting.call(this.table,e,t)?this.loaderPromise(e,i,t).then((i=>(this.table.options.ajaxResponse&&(i=this.table.options.ajaxResponse.call(this.table,e,t,i)),i))):Promise.reject()}}d.moduleName="ajax",d.defaultConfig={method:"GET"},d.defaultURLGenerator=a,d.defaultLoaderPromise=function(e,t,i){var s;return new Promise(((o,n)=>{if(e=this.urlGenerator.call(this.table,e,t,i),"GET"!=t.method.toUpperCase())if(s="object"==typeof this.table.options.ajaxContentType?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType]){for(var r in s.headers)t.headers||(t.headers={}),void 0===t.headers[r]&&(t.headers[r]=s.headers[r]);t.body=s.body.call(this,e,t,i)}else console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType);e?(void 0===t.headers&&(t.headers={}),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),void 0===t.headers["X-Requested-With"]&&(t.headers["X-Requested-With"]="XMLHttpRequest"),void 0===t.mode&&(t.mode="cors"),"cors"==t.mode?(void 0===t.headers.Origin&&(t.headers.Origin=window.location.origin),void 0===t.credentials&&(t.credentials="same-origin")):void 0===t.credentials&&(t.credentials="include"),fetch(e,t).then((e=>{e.ok?e.json().then((e=>{o(e)})).catch((e=>{n(e),console.warn("Ajax Load Error - Invalid JSON returned",e)})):(console.error("Ajax Load Error - Connection Error: "+e.status,e.statusText),n(e))})).catch((e=>{console.error("Ajax Load Error - Connection Error: ",e),n(e)}))):(console.warn("Ajax Load Error - No URL Set"),o([]))}))},d.contentTypeFormatters=h;class c extends s{constructor(e){super(e),this.mode=!0,this.pasteParser=function(){},this.pasteAction=function(){},this.customSelection=!1,this.rowRange=!1,this.blocked=!0,this.registerTableOption("clipboard",!1),this.registerTableOption("clipboardCopyStyled",!0),this.registerTableOption("clipboardCopyConfig",!1),this.registerTableOption("clipboardCopyFormatter",!1),this.registerTableOption("clipboardCopyRowRange","active"),this.registerTableOption("clipboardPasteParser","table"),this.registerTableOption("clipboardPasteAction","insert"),this.registerColumnOption("clipboard"),this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard,this.rowRange=this.table.options.clipboardCopyRowRange,!0!==this.mode&&"copy"!==this.mode||this.table.element.addEventListener("copy",(e=>{var t,i,s;this.blocked||(e.preventDefault(),this.customSelection?(t=this.customSelection,this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t))):(s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard"),t=(i=this.table.modules.export.generateHTMLTable(s))?this.generatePlainContent(s):"",this.table.options.clipboardCopyFormatter&&(t=this.table.options.clipboardCopyFormatter("plain",t),i=this.table.options.clipboardCopyFormatter("html",i))),window.clipboardData&&window.clipboardData.setData?window.clipboardData.setData("Text",t):e.clipboardData&&e.clipboardData.setData?(e.clipboardData.setData("text/plain",t),i&&e.clipboardData.setData("text/html",i)):e.originalEvent&&e.originalEvent.clipboardData.setData&&(e.originalEvent.clipboardData.setData("text/plain",t),i&&e.originalEvent.clipboardData.setData("text/html",i)),this.dispatchExternal("clipboardCopied",t,i),this.reset())})),!0!==this.mode&&"paste"!==this.mode||this.table.element.addEventListener("paste",(e=>{this.paste(e)})),this.setPasteParser(this.table.options.clipboardPasteParser),this.setPasteAction(this.table.options.clipboardPasteAction),this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=!0,this.customSelection=!1}generatePlainContent(e){var t=[];return e.forEach((e=>{var i=[];e.columns.forEach((t=>{var s="";if(t)if("group"===e.type&&(t.value=t.component.getKey()),null===t.value)s="";else switch(typeof t.value){case"object":s=JSON.stringify(t.value);break;case"undefined":s="";break;default:s=t.value}i.push(s)})),t.push(i.join("\t"))})),t.join("\n")}copy(e,t){var i,s;this.blocked=!1,this.customSelection=!1,!0!==this.mode&&"copy"!==this.mode||(this.rowRange=e||this.table.options.clipboardCopyRowRange,void 0!==window.getSelection&&void 0!==document.createRange?((e=document.createRange()).selectNodeContents(this.table.element),(i=window.getSelection()).toString()&&t&&(this.customSelection=i.toString()),i.removeAllRanges(),i.addRange(e)):void 0!==document.selection&&void 0!==document.body.createTextRange&&((s=document.body.createTextRange()).moveToElementText(this.table.element),s.select()),document.execCommand("copy"),i&&i.removeAllRanges())}setPasteAction(e){switch(typeof e){case"string":this.pasteAction=c.pasteActions[e],this.pasteAction||console.warn("Clipboard Error - No such paste action found:",e);break;case"function":this.pasteAction=e}}setPasteParser(e){switch(typeof e){case"string":this.pasteParser=c.pasteParsers[e],this.pasteParser||console.warn("Clipboard Error - No such paste parser found:",e);break;case"function":this.pasteParser=e}}paste(e){var t,i,s;this.checkPaseOrigin(e)&&(t=this.getPasteData(e),(i=this.pasteParser.call(this,t))?(e.preventDefault(),this.table.modExists("mutator")&&(i=this.mutateData(i)),s=this.pasteAction.call(this,i),this.dispatchExternal("clipboardPasted",t,i,s)):this.dispatchExternal("clipboardPasteError",t))}mutateData(e){var t=[];return Array.isArray(e)?e.forEach((e=>{t.push(this.table.modules.mutator.transformRow(e,"clipboard"))})):t=e,t}checkPaseOrigin(e){var t=!0;return("DIV"!=e.target.tagName||this.table.modules.edit.currentCell)&&(t=!1),t}getPasteData(e){var t;return window.clipboardData&&window.clipboardData.getData?t=window.clipboardData.getData("Text"):e.clipboardData&&e.clipboardData.getData?t=e.clipboardData.getData("text/plain"):e.originalEvent&&e.originalEvent.clipboardData.getData&&(t=e.originalEvent.clipboardData.getData("text/plain")),t}}c.moduleName="clipboard",c.pasteActions={replace:function(e){return this.table.setData(e)},update:function(e){return this.table.updateOrAddData(e)},insert:function(e){return this.table.addData(e)}},c.pasteParsers={table:function(e){var t=[],i=!0,s=this.table.columnManager.columns,o=[],n=[];return(e=e.split("\n")).forEach((function(e){t.push(e.split("\t"))})),!(!t.length||1===t.length&&t[0].length<2)&&(t[0].forEach((function(e){var t=s.find((function(t){return e&&t.definition.title&&e.trim()&&t.definition.title.trim()===e.trim()}));t?o.push(t):i=!1})),i||(i=!0,o=[],t[0].forEach((function(e){var t=s.find((function(t){return e&&t.field&&e.trim()&&t.field.trim()===e.trim()}));t?o.push(t):i=!1})),i||(o=this.table.columnManager.columnsByIndex)),i&&t.shift(),t.forEach((function(e){var t={};e.forEach((function(e,i){o[i]&&(t[o[i].field]=e)})),n.push(t)})),n)}};class u{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}_getSelf(){return this._row}}class m{constructor(e){return this._cell=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._cell.table.componentFunctionBinder.handle("cell",e._cell,t)}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(){return this._cell.row.getData()}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(e,t){void 0===t&&(t=!0),this._cell.setValue(e,t)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class p extends e{constructor(e,t){super(e.table),this.table=e.table,this.column=e,this.row=t,this.element=null,this.value=null,this.initialValue,this.oldValue=null,this.modules={},this.height=null,this.width=null,this.minWidth=null,this.component=null,this.loaded=!1,this.build()}build(){this.generateElement(),this.setWidth(),this._configureCell(),this.setValueActual(this.column.getFieldValue(this.row.data)),this.initialValue=this.value}generateElement(){this.element=document.createElement("div"),this.element.className="tabulator-cell",this.element.setAttribute("role","gridcell")}_configureCell(){var e=this.element,t=this.column.getField();(e.style.textAlign=this.column.hozAlign,this.column.vertAlign&&(e.style.display="inline-flex",e.style.alignItems={top:"flex-start",bottom:"flex-end",middle:"center"}[this.column.vertAlign]||"",this.column.hozAlign&&(e.style.justifyContent={left:"flex-start",right:"flex-end",center:"center"}[this.column.hozAlign]||"")),t&&e.setAttribute("tabulator-field",t),this.column.definition.cssClass)&&this.column.definition.cssClass.split(" ").forEach((t=>{e.classList.add(t)}));this.dispatch("cell-init",this),this.column.visible||this.hide()}_generateContents(){var e;switch(typeof(e=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value)))){case"object":if(e instanceof Node){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.element.appendChild(e)}else this.element.innerHTML="",null!=e&&console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e);break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=e}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(e){return this.loaded||(this.loaded=!0,e||this.layoutElement()),this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(e,t,i){this.setValueProcessData(e,t,i)&&(this.dispatch("cell-value-updated",this),this.cellRendered(),this.column.definition.cellEdited&&this.column.definition.cellEdited.call(this.table,this.getComponent()),this.dispatchExternal("cellEdited",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()))}setValueProcessData(e,t,i){var s=!1;return(this.value!==e||i)&&(s=!0,t&&(e=this.chain("cell-value-changing",[this,e],null,e))),this.setValueActual(e),s&&this.dispatch("cell-value-changed",this),s}setValueActual(e){this.oldValue=this.value,this.value=e,this.dispatch("cell-value-save-before",this),this.column.setFieldValue(this.row.data,e),this.dispatch("cell-value-save-after",this),this.loaded&&this.layoutElement()}layoutElement(){this._generateContents(),this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width,this.element.style.width=this.column.widthStyled}clearWidth(){this.width="",this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth,this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth,this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="",this.height=null,this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height,this.element.style.height=this.row.heightStyled,this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this),!this.table.rowManager.redrawBlock&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=!1,this.column.deleteCell(this),this.row.deleteCell(this),this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){return this.component||(this.component=new m(this)),this.component}}class g{constructor(e){return this._column=e,this.type="ColumnComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._column.table.componentFunctionBinder.handle("column",e._column,t)}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var e=[];return this._column.cells.forEach((function(t){e.push(t.getComponent())})),e}isVisible(){return this._column.visible}show(){this._column.isGroup?this._column.columns.forEach((function(e){e.show()})):this._column.show()}hide(){this._column.isGroup?this._column.columns.forEach((function(e){e.hide()})):this._column.hide()}toggle(){this._column.visible?this.hide():this.show()}delete(){return this._column.delete()}getSubColumns(){var e=[];return this._column.columns.length&&this._column.columns.forEach((function(t){e.push(t.getComponent())})),e}getParentColumn(){return this._column.parent instanceof f&&this._column.parent.getComponent()}_getSelf(){return this._column}scrollTo(){return this._column.table.columnManager.scrollToColumn(this._column)}getTable(){return this._column.table}move(e,t){var i=this._column.table.columnManager.findColumn(e);i?this._column.table.columnManager.moveColumn(this._column,i,t):console.warn("Move Error - No matching column found:",i)}getNextColumn(){var e=this._column.nextColumn();return!!e&&e.getComponent()}getPrevColumn(){var e=this._column.prevColumn();return!!e&&e.getComponent()}updateDefinition(e){return this._column.updateDefinition(e)}getWidth(){return this._column.getWidth()}setWidth(e){var t;return t=!0===e?this._column.reinitializeWidth(!0):this._column.setWidth(e),this._column.table.columnManager.rerenderColumns(!0),t}}var b={title:void 0,field:void 0,columns:void 0,visible:void 0,hozAlign:void 0,vertAlign:void 0,width:void 0,minWidth:40,maxWidth:void 0,maxInitialWidth:void 0,cssClass:void 0,variableHeight:void 0,headerVertical:void 0,headerHozAlign:void 0,editableTitle:void 0};class f extends e{constructor(e,t){super(t.table),this.definition=e,this.parent=t,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.hozAlign="",this.vertAlign="",this.field="",this.fieldStructure="",this.getFieldValue="",this.setFieldValue="",this.titleDownload=null,this.titleFormatterRendered=!1,this.mapDefinitions(),this.setField(this.definition.field),this.modules={},this.width=null,this.widthStyled="",this.maxWidth=null,this.maxWidthStyled="",this.maxInitialWidth=null,this.minWidth=null,this.minWidthStyled="",this.widthFixed=!1,this.visible=!0,this.component=null,this.definition.columns?(this.isGroup=!0,this.definition.columns.forEach(((e,t)=>{var i=new f(e,this);this.attachColumn(i)})),this.checkColumnVisibility()):t.registerColumnField(this),this._initialize()}createElement(){var e=document.createElement("div");switch(e.classList.add("tabulator-col"),e.setAttribute("role","columnheader"),e.setAttribute("aria-sort","none"),this.table.options.columnHeaderVertAlign){case"middle":e.style.justifyContent="center";break;case"bottom":e.style.justifyContent="flex-end"}return e}createGroupElement(){var e=document.createElement("div");return e.classList.add("tabulator-col-group-cols"),e}mapDefinitions(){var e=this.table.options.columnDefaults;if(e)for(let t in e)void 0===this.definition[t]&&(this.definition[t]=e[t]);this.definition=this.table.columnManager.optionsList.generate(f.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((e=>{-1===f.defaultOptionList.indexOf(e)&&console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",e)}))}setField(e){this.field=e,this.fieldStructure=e?this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator):[e]:[],this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData,this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(e){this.parent.registerColumnPosition(e)}registerColumnField(e){this.parent.registerColumnField(e)}reRegisterPosition(){this.isGroup?this.columns.forEach((function(e){e.reRegisterPosition()})):this.registerColumnPosition(this)}_initialize(){for(var e=this.definition;this.element.firstChild;)this.element.removeChild(this.element.firstChild);e.headerVertical&&(this.element.classList.add("tabulator-col-vertical"),"flip"===e.headerVertical&&this.element.classList.add("tabulator-col-vertical-flip")),this.contentElement=this._buildColumnHeaderContent(),this.element.appendChild(this.contentElement),this.isGroup?this._buildGroupHeader():this._buildColumnHeader(),this.dispatch("column-init",this)}_buildColumnHeader(){var e=this.definition;(this.dispatch("column-layout",this),void 0!==e.visible&&(e.visible?this.show(!0):this.hide(!0)),e.cssClass)&&e.cssClass.split(" ").forEach((e=>{this.element.classList.add(e)}));e.field&&this.element.setAttribute("tabulator-field",e.field),this.setMinWidth(parseInt(e.minWidth)),e.maxInitialWidth&&(this.maxInitialWidth=parseInt(e.maxInitialWidth)),e.maxWidth&&this.setMaxWidth(parseInt(e.maxWidth)),this.reinitializeWidth(),this.hozAlign=this.definition.hozAlign,this.vertAlign=this.definition.vertAlign,this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var e=document.createElement("div");return e.classList.add("tabulator-col-content"),this.titleHolderElement=document.createElement("div"),this.titleHolderElement.classList.add("tabulator-col-title-holder"),e.appendChild(this.titleHolderElement),this.titleElement=this._buildColumnHeaderTitle(),this.titleHolderElement.appendChild(this.titleElement),e}_buildColumnHeaderTitle(){var e=this.definition,t=document.createElement("div");if(t.classList.add("tabulator-col-title"),e.editableTitle){var i=document.createElement("input");i.classList.add("tabulator-title-editor"),i.addEventListener("click",(e=>{e.stopPropagation(),i.focus()})),i.addEventListener("change",(()=>{e.title=i.value,this.dispatchExternal("columnTitleChanged",this.getComponent())})),t.appendChild(i),e.field?this.langBind("columns|"+e.field,(t=>{i.value=t||e.title||" "})):i.value=e.title||" "}else e.field?this.langBind("columns|"+e.field,(i=>{this._formatColumnHeaderTitle(t,i||e.title||" ")})):this._formatColumnHeaderTitle(t,e.title||" ");return t}_formatColumnHeaderTitle(e,t){var i=this.chain("column-format",[this,t,e],null,(()=>t));switch(typeof i){case"object":i instanceof Node?e.appendChild(i):(e.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":e.innerHTML="";break;default:e.innerHTML=i}}_buildGroupHeader(){(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((e=>{this.element.classList.add(e)}));this.titleElement.style.textAlign=this.definition.headerHozAlign,this.element.appendChild(this.groupElement)}_getFlatData(e){return e[this.field]}_getNestedData(e){var t,i=e,s=this.fieldStructure,o=s.length;for(let e=0;e{t.push(e),t=t.concat(e.getColumns(!0))})):t=this.columns,t}getCells(){return this.cells}getTopColumn(){return this.parent.isGroup?this.parent.getTopColumn():this}getDefinition(e){var t=[];return this.isGroup&&e&&(this.columns.forEach((function(e){t.push(e.getDefinition(!0))})),this.definition.columns=t),this.definition}checkColumnVisibility(){var e=!1;this.columns.forEach((function(t){t.visible&&(e=!0)})),e?(this.show(),this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1)):this.hide()}show(e,t){this.visible||(this.visible=!0,this.element.style.display="",this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.show()})),this.isGroup||null!==this.width||this.reinitializeWidth(),this.table.columnManager.verticalAlignHeaders(),this.dispatch("column-show",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!0),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}hide(e,t){this.visible&&(this.visible=!1,this.element.style.display="none",this.table.columnManager.verticalAlignHeaders(),this.parent.isGroup&&this.parent.checkColumnVisibility(),this.cells.forEach((function(e){e.hide()})),this.dispatch("column-hide",this,t),e||this.dispatchExternal("columnVisibilityChanged",this.getComponent(),!1),this.parent.isGroup&&this.parent.matchChildWidths(),this.silent||this.table.columnManager.rerenderColumns())}matchChildWidths(){var e=0;this.contentElement&&this.columns.length&&(this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})),this.contentElement.style.maxWidth=e-1+"px",this.parent.isGroup&&this.parent.matchChildWidths())}removeChild(e){var t=this.columns.indexOf(e);t>-1&&this.columns.splice(t,1),this.columns.length||this.delete()}setWidth(e){this.widthFixed=!0,this.setWidthActual(e)}setWidthActual(e){isNaN(e)&&(e=Math.floor(this.table.element.clientWidth/100*parseInt(e))),e=Math.max(this.minWidth,e),this.maxWidth&&(e=Math.min(this.maxWidth,e)),this.width=e,this.widthStyled=e?e+"px":"",this.element.style.width=this.widthStyled,this.isGroup||this.cells.forEach((function(e){e.setWidth()})),this.parent.isGroup&&this.parent.matchChildWidths(),this.dispatch("column-width",this)}checkCellHeights(){var e=[];this.cells.forEach((function(t){t.row.heightInitialized&&(null!==t.row.getElement().offsetParent?(e.push(t.row),t.row.clearCellHeight()):t.row.heightInitialized=!1)})),e.forEach((function(e){e.calcHeight()})),e.forEach((function(e){e.setCellHeight()}))}getWidth(){var e=0;return this.isGroup?this.columns.forEach((function(t){t.visible&&(e+=t.getWidth())})):e=this.width,e}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(e){this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,console.warn("the minWidth ("+e+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")),this.minWidth=e,this.minWidthStyled=e?e+"px":"",this.element.style.minWidth=this.minWidthStyled,this.cells.forEach((function(e){e.setMinWidth()}))}setMaxWidth(e){this.minWidth&&e{this.isGroup&&this.columns.forEach((function(e){e.delete()})),this.dispatch("column-delete",this);var i=this.cells.length;for(let e=0;e-1&&this._nextVisibleColumn(e+1)}_nextVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._nextVisibleColumn(e+1)}prevColumn(){var e=this.table.columnManager.findColumnIndex(this);return e>-1&&this._prevVisibleColumn(e-1)}_prevVisibleColumn(e){var t=this.table.columnManager.getColumnByIndex(e);return!t||t.visible?t:this._prevVisibleColumn(e-1)}reinitializeWidth(e){this.widthFixed=!1,void 0===this.definition.width||e||this.setWidth(this.definition.width),this.dispatch("column-width-fit-before",this),this.fitToData(e),this.dispatch("column-width-fit-after",this)}fitToData(e){if(!this.isGroup){this.widthFixed||(this.element.style.width="",this.cells.forEach((e=>{e.clearWidth()})));var t=this.element.offsetWidth;if((!this.width||!this.widthFixed)&&(this.cells.forEach((e=>{var i=e.getWidth();i>t&&(t=i)})),t)){var i=t+1;this.maxInitialWidth&&!e&&(i=Math.min(i,this.maxInitialWidth)),this.setWidthActual(i)}}}updateDefinition(e){var t;return this.isGroup||this.parent.isGroup?(console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns"),Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")):(t=Object.assign({},this.getDefinition()),t=Object.assign(t,e),this.table.columnManager.addColumn(t,!1,this).then((e=>(t.field==this.field&&(this.field=!1),this.delete().then((()=>e.getComponent()))))))}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}getComponent(){return this.component||(this.component=new g(this)),this.component}}f.defaultOptionList=b;class v{constructor(e){return this._row=e,new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._row.table.componentFunctionBinder.handle("row",e._row,t)}})}getData(e){return this._row.getData(e)}getElement(){return this._row.getElement()}getCells(){var e=[];return this._row.getCells().forEach((function(t){e.push(t.getComponent())})),e}getCell(e){var t=this._row.getCell(e);return!!t&&t.getComponent()}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(e){return this._row.watchPosition(e)}delete(){return this._row.delete()}scrollTo(){return this._row.table.rowManager.scrollToRow(this._row)}move(e,t){this._row.moveToRow(e,t)}update(e){return this._row.updateData(e)}normalizeHeight(){this._row.normalizeHeight(!0)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var e=this._row.nextRow();return e?e.getComponent():e}getPrevRow(){var e=this._row.prevRow();return e?e.getComponent():e}}class w extends e{constructor(e,t,i="row"){super(t.table),this.parent=t,this.data={},this.type=i,this.element=!1,this.modules={},this.cells=[],this.height=0,this.heightStyled="",this.manualHeight=!1,this.outerHeight=0,this.initialized=!1,this.heightInitialized=!1,this.position=0,this.positionWatchers=[],this.component=null,this.created=!1,this.setData(e)}create(){this.created||(this.created=!0,this.generateElement())}createElement(){var e=document.createElement("div");e.classList.add("tabulator-row"),e.setAttribute("role","row"),this.element=e}getElement(){return this.create(),this.element}detachElement(){this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}generateElement(){this.createElement(),this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(e){if(this.create(),!this.initialized||e){for(this.deleteCells();this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this),this.generateCells(),this.initialized=!0,this.table.columnManager.renderer.renderRowCells(this),e&&this.normalizeHeight(),this.dispatch("row-layout",this),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent()),this.dispatch("row-layout-after",this)}else this.table.columnManager.renderer.rerenderRowCells(this)}reinitializeHeight(){this.heightInitialized=!1,this.element&&null!==this.element.offsetParent&&this.normalizeHeight(!0)}deinitialize(){this.initialized=!1}deinitializeHeight(){this.heightInitialized=!1}reinitialize(e){this.initialized=!1,this.heightInitialized=!1,this.manualHeight||(this.height=0,this.heightStyled=""),this.element&&null!==this.element.offsetParent&&this.initialize(!0),this.dispatch("row-relayout",this)}calcHeight(e){var t,i=0;this.table.options.rowHeight?this.height=this.table.options.rowHeight:(t=this.table.options.resizableRows?this.element.clientHeight:0,this.cells.forEach((function(e){var t=e.getHeight();t>i&&(i=t)})),this.height=e?Math.max(i,t):this.manualHeight?this.height:Math.max(i,t)),this.heightStyled=this.height?this.height+"px":"",this.outerHeight=this.element.offsetHeight}setCellHeight(){this.cells.forEach((function(e){e.setHeight()})),this.heightInitialized=!0}clearCellHeight(){this.cells.forEach((function(e){e.clearHeight()}))}normalizeHeight(e){e&&!this.table.options.rowHeight&&this.clearCellHeight(),this.calcHeight(e),this.setCellHeight()}setHeight(e,t){(this.height!=e||t)&&(this.manualHeight=!0,this.height=e,this.heightStyled=e?e+"px":"",this.setCellHeight(),this.outerHeight=this.element.offsetHeight)}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(e){var t=this.cells.indexOf(e);t>-1&&this.cells.splice(t,1)}setData(e){this.data=this.chain("row-data-init-before",[this,e],void 0,e),this.dispatch("row-data-init-after",this)}updateData(e){var i,s=this.element&&t.elVisible(this.element),o={};return new Promise(((t,n)=>{"string"==typeof e&&(e=JSON.parse(e)),this.dispatch("row-data-save-before",this),this.subscribed("row-data-changing")&&(o=Object.assign(o,this.data),o=Object.assign(o,e)),i=this.chain("row-data-changing",[this,o,e],null,e);for(let e in i)this.data[e]=i[e];this.dispatch("row-data-save-after",this);for(let t in e){this.table.columnManager.getColumnsByFieldRoot(t).forEach((e=>{let t=this.getCell(e.getField());if(t){let o=e.getFieldValue(i);t.getValue()!=o&&(t.setValueProcessData(o),s&&t.cellRendered())}}))}s?(this.normalizeHeight(!0),this.table.options.rowFormatter&&this.table.options.rowFormatter(this.getComponent())):(this.initialized=!1,this.height=0,this.heightStyled=""),this.dispatch("row-data-changed",this,s,e),this.dispatchExternal("rowUpdated",this.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),t()}))}getData(e){return e?this.chain("row-data-retrieve",[this,e],null,this.data):this.data}getCell(e){return e=this.table.columnManager.findColumn(e),this.initialized||this.generateCells(),this.cells.find((function(t){return t.column===e}))}getCellIndex(e){return this.cells.findIndex((function(t){return t===e}))}findCell(e){return this.cells.find((t=>t.element===e))}getCells(){return this.initialized||this.generateCells(),this.cells}nextRow(){return this.table.rowManager.nextDisplayRow(this,!0)||!1}prevRow(){return this.table.rowManager.prevDisplayRow(this,!0)||!1}moveToRow(e,t){var i=this.table.rowManager.findRow(e);i?(this.table.rowManager.moveRowActual(this,i,!t),this.table.rowManager.refreshActiveData("display",!1,!0)):console.warn("Move Error - No matching row found:",e)}delete(){return this.dispatch("row-delete",this),this.deleteActual(),Promise.resolve()}deleteActual(e){this.detachModules(),this.table.rowManager.deleteRow(this,e),this.deleteCells(),this.initialized=!1,this.heightInitialized=!1,this.element=!1,this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var e=this.cells.length;for(let t=0;t{e(this.position)})))}watchPosition(e){this.positionWatchers.push(e),e(this.position)}getGroup(){return this.modules.group||!1}getComponent(){return this.component||(this.component=new v(this)),this.component}}var C={avg:function(e,t,i){var s=0,o=void 0!==i.precision?i.precision:2;return e.length&&(s=e.reduce((function(e,t){return Number(e)+Number(t)})),s/=e.length,s=!1!==o?s.toFixed(o):s),parseFloat(s).toString()},max:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e))>s||null===s)&&(s=e)})),null!==s?!1!==o?s.toFixed(o):s:""},min:function(e,t,i){var s=null,o=void 0!==i.precision&&i.precision;return e.forEach((function(e){((e=Number(e)){this.recalcGroup(e)})))}recalcGroup(e){var t,i;e&&e.calcs&&(e.calcs.bottom&&(t=this.rowsToData(e.rows),i=this.generateRowData("bottom",t),e.calcs.bottom.updateData(i),e.calcs.bottom.reinitialize()),e.calcs.top&&(t=this.rowsToData(e.rows),i=this.generateRowData("top",t),e.calcs.top.updateData(i),e.calcs.top.reinitialize()))}generateTopRow(e){return this.generateRow("top",this.rowsToData(e))}generateBottomRow(e){return this.generateRow("bottom",this.rowsToData(e))}rowsToData(e){var t=[];return e.forEach((e=>{if(t.push(e.getData()),this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs&&e.modules.dataTree&&e.modules.dataTree.open){var i=this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(e));t=t.concat(i)}})),t}generateRow(e,t){var i,s=this.generateRowData(e,t);return this.table.modExists("mutator")&&this.table.modules.mutator.disable(),i=new w(s,this,"calc"),this.table.modExists("mutator")&&this.table.modules.mutator.enable(),i.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+e),i.component=!1,i.getComponent=()=>(i.component||(i.component=new u(i)),i.component),i.generateCells=()=>{var t=[];this.table.columnManager.columnsByIndex.forEach((s=>{this.genColumn.setField(s.getField()),this.genColumn.hozAlign=s.hozAlign,s.definition[e+"CalcFormatter"]&&this.table.modExists("format")?this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter(s.definition[e+"CalcFormatter"]),params:s.definition[e+"CalcFormatterParams"]||{}}:this.genColumn.modules.format={formatter:this.table.modules.format.getFormatter("plaintext"),params:{}},this.genColumn.definition.cssClass=s.definition.cssClass;var o=new p(this.genColumn,i);o.getElement(),o.column=s,o.setWidth(),s.cells.push(o),t.push(o),s.visible||o.hide()})),i.cells=t},i}generateRowData(e,t){var i,s,o={},n="top"==e?this.topCalcs:this.botCalcs,r="top"==e?"topCalc":"botCalc";return n.forEach((function(e){var n=[];e.modules.columnCalcs&&e.modules.columnCalcs[r]&&(t.forEach((function(t){n.push(e.getFieldValue(t))})),s=r+"Params",i="function"==typeof e.modules.columnCalcs[s]?e.modules.columnCalcs[s](n,t):e.modules.columnCalcs[s],e.setFieldValue(o,e.modules.columnCalcs[r](n,t,i)))})),o}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){this.topRow&&this.topRow.normalizeHeight(!0),this.botRow&&this.botRow.normalizeHeight(!0)}getResults(){var e={};return this.table.options.groupBy&&this.table.modExists("groupRows")?this.table.modules.groupRows.getGroups(!0).forEach((t=>{e[t.getKey()]=this.getGroupResults(t)})):e={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}},e}getGroupResults(e){var t=e._getSelf(),i=e.getSubGroups(),s={};return i.forEach((e=>{s[e.getKey()]=this.getGroupResults(e)})),{top:t.calcs.top?t.calcs.top.getData():{},bottom:t.calcs.bottom?t.calcs.bottom.getData():{},groups:s}}}E.moduleName="columnCalcs",E.calculations=C;class y extends s{constructor(e){super(e),this.indent=10,this.field="",this.collapseEl=null,this.expandEl=null,this.branchEl=null,this.elementField=!1,this.startOpen=function(){},this.registerTableOption("dataTree",!1),this.registerTableOption("dataTreeFilter",!0),this.registerTableOption("dataTreeSort",!0),this.registerTableOption("dataTreeElementColumn",!1),this.registerTableOption("dataTreeBranchElement",!0),this.registerTableOption("dataTreeChildIndent",9),this.registerTableOption("dataTreeChildField","_children"),this.registerTableOption("dataTreeCollapseElement",!1),this.registerTableOption("dataTreeExpandElement",!1),this.registerTableOption("dataTreeStartExpanded",!1),this.registerTableOption("dataTreeChildColumnCalcs",!1),this.registerTableOption("dataTreeSelectPropagate",!1),this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this)),this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this)),this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this)),this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this)),this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this)),this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this)),this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var e=null,t=this.table.options;switch(this.field=t.dataTreeChildField,this.indent=t.dataTreeChildIndent,this.options("movableRows")&&console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior"),t.dataTreeBranchElement&&(!0===t.dataTreeBranchElement?(this.branchEl=document.createElement("div"),this.branchEl.classList.add("tabulator-data-tree-branch")):"string"==typeof t.dataTreeBranchElement?((e=document.createElement("div")).innerHTML=t.dataTreeBranchElement,this.branchEl=e.firstChild):this.branchEl=t.dataTreeBranchElement),t.dataTreeCollapseElement?"string"==typeof t.dataTreeCollapseElement?((e=document.createElement("div")).innerHTML=t.dataTreeCollapseElement,this.collapseEl=e.firstChild):this.collapseEl=t.dataTreeCollapseElement:(this.collapseEl=document.createElement("div"),this.collapseEl.classList.add("tabulator-data-tree-control"),this.collapseEl.tabIndex=0,this.collapseEl.innerHTML="
"),t.dataTreeExpandElement?"string"==typeof t.dataTreeExpandElement?((e=document.createElement("div")).innerHTML=t.dataTreeExpandElement,this.expandEl=e.firstChild):this.expandEl=t.dataTreeExpandElement:(this.expandEl=document.createElement("div"),this.expandEl.classList.add("tabulator-data-tree-control"),this.expandEl.tabIndex=0,this.expandEl.innerHTML="
"),typeof t.dataTreeStartExpanded){case"boolean":this.startOpen=function(e,i){return t.dataTreeStartExpanded};break;case"function":this.startOpen=t.dataTreeStartExpanded;break;default:this.startOpen=function(e,i){return t.dataTreeStartExpanded[i]}}this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("row-deleted",this.rowDelete.bind(this),0),this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10),this.subscribe("cell-value-updated",this.cellValueChanged.bind(this)),this.subscribe("edit-cancelled",this.cellValueChanged.bind(this)),this.subscribe("column-moving-rows",this.columnMoving.bind(this)),this.subscribe("table-built",this.initializeElementField.bind(this)),this.subscribe("table-redrawing",this.tableRedrawing.bind(this)),this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(e){e&&this.table.rowManager.getRows().forEach((e=>{this.reinitializeRowChildren(e)}))}initializeElementField(){var e=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||!!e&&e.field}getRowChildren(e){return this.getTreeChildren(e,!0)}columnMoving(){var e=[];return this.table.rowManager.rows.forEach((t=>{e=e.concat(this.getTreeChildren(t,!1,!0))})),e}rowDataChanged(e,t,i){this.redrawNeeded(i)&&(this.initializeRow(e),t&&(this.layoutRow(e),this.refreshData(!0)))}cellValueChanged(e){e.column.getField()===this.elementField&&this.layoutRow(e.row)}initializeRow(e){var t=e.getData()[this.field],i=Array.isArray(t),s=i||!i&&"object"==typeof t&&null!==t;!s&&e.modules.dataTree&&e.modules.dataTree.branchEl&&e.modules.dataTree.branchEl.parentNode.removeChild(e.modules.dataTree.branchEl),!s&&e.modules.dataTree&&e.modules.dataTree.controlEl&&e.modules.dataTree.controlEl.parentNode.removeChild(e.modules.dataTree.controlEl),e.modules.dataTree={index:e.modules.dataTree?e.modules.dataTree.index:0,open:!!s&&(e.modules.dataTree?e.modules.dataTree.open:this.startOpen(e.getComponent(),0)),controlEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.controlEl,branchEl:!(!e.modules.dataTree||!s)&&e.modules.dataTree.branchEl,parent:!!e.modules.dataTree&&e.modules.dataTree.parent,children:s}}reinitializeRowChildren(e){this.getTreeChildren(e,!1,!0).forEach((function(e){e.reinitialize(!0)}))}layoutRow(e){var t=(this.elementField?e.getCell(this.elementField):e.getCells()[0]).getElement(),i=e.modules.dataTree;i.branchEl&&(i.branchEl.parentNode&&i.branchEl.parentNode.removeChild(i.branchEl),i.branchEl=!1),i.controlEl&&(i.controlEl.parentNode&&i.controlEl.parentNode.removeChild(i.controlEl),i.controlEl=!1),this.generateControlElement(e,t),e.getElement().classList.add("tabulator-tree-level-"+i.index),i.index&&(this.branchEl?(i.branchEl=this.branchEl.cloneNode(!0),t.insertBefore(i.branchEl,t.firstChild),this.table.rtl?i.branchEl.style.marginRight=(i.branchEl.offsetWidth+i.branchEl.style.marginLeft)*(i.index-1)+i.index*this.indent+"px":i.branchEl.style.marginLeft=(i.branchEl.offsetWidth+i.branchEl.style.marginRight)*(i.index-1)+i.index*this.indent+"px"):this.table.rtl?t.style.paddingRight=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-right"))+i.index*this.indent+"px":t.style.paddingLeft=parseInt(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+i.index*this.indent+"px")}generateControlElement(e,t){var i=e.modules.dataTree,s=i.controlEl;t=t||e.getCells()[0].getElement(),!1!==i.children&&(i.open?(i.controlEl=this.collapseEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.collapseRow(e)}))):(i.controlEl=this.expandEl.cloneNode(!0),i.controlEl.addEventListener("click",(t=>{t.stopPropagation(),this.expandRow(e)}))),i.controlEl.addEventListener("mousedown",(e=>{e.stopPropagation()})),s&&s.parentNode===t?s.parentNode.replaceChild(i.controlEl,s):t.insertBefore(i.controlEl,t.firstChild))}getRows(e){var t=[];return e.forEach(((e,i)=>{var s;t.push(e),e instanceof w&&(e.create(),(s=e.modules.dataTree.children).index||!1===s.children||this.getChildren(e).forEach((e=>{e.create(),t.push(e)})))})),t}getChildren(e,t){var i=e.modules.dataTree,s=[],o=[];return!1!==i.children&&(i.open||t)&&(Array.isArray(i.children)||(i.children=this.generateChildren(e)),s=this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(i.children):i.children,this.table.modExists("sort")&&this.table.options.dataTreeSort&&this.table.modules.sort.sort(s),s.forEach((e=>{o.push(e),this.getChildren(e).forEach((e=>{o.push(e)}))}))),o}generateChildren(e){var t=[],i=e.getData()[this.field];return Array.isArray(i)||(i=[i]),i.forEach((i=>{var s=new w(i||{},this.table.rowManager);s.create(),s.modules.dataTree.index=e.modules.dataTree.index+1,s.modules.dataTree.parent=e,s.modules.dataTree.children&&(s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)),t.push(s)})),t}expandRow(e,t){var i=e.modules.dataTree;!1!==i.children&&(i.open=!0,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowExpanded",e.getComponent(),e.modules.dataTree.index))}collapseRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open=!1,e.reinitialize(),this.refreshData(!0),this.dispatchExternal("dataTreeRowCollapsed",e.getComponent(),e.modules.dataTree.index))}toggleRow(e){var t=e.modules.dataTree;!1!==t.children&&(t.open?this.collapseRow(e):this.expandRow(e))}isRowExpanded(e){return e.modules.dataTree.open}getTreeParent(e){return!!e.modules.dataTree.parent&&e.modules.dataTree.parent.getComponent()}getTreeParentRoot(e){return e.modules.dataTree&&e.modules.dataTree.parent?this.getTreeParentRoot(e.modules.dataTree.parent):e}getFilteredTreeChildren(e){var t=e.modules.dataTree,i=[];return t.children&&(Array.isArray(t.children)||(t.children=this.generateChildren(e)),(this.table.modExists("filter")&&this.table.options.dataTreeFilter?this.table.modules.filter.filter(t.children):t.children).forEach((e=>{e instanceof w&&i.push(e)}))),i}rowDelete(e){var t,i=e.modules.dataTree.parent;i&&(!1!==(t=this.findChildIndex(e,i))&&i.data[this.field].splice(t,1),i.data[this.field].length||delete i.data[this.field],this.initializeRow(i),this.layoutRow(i)),this.refreshData(!0)}addTreeChildRow(e,t,i,s){var o=!1;"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e.data[this.field])||(e.data[this.field]=[],e.modules.dataTree.open=this.startOpen(e.getComponent(),e.modules.dataTree.index)),void 0!==s&&!1!==(o=this.findChildIndex(s,e))&&e.data[this.field].splice(i?o:o+1,0,t),!1===o&&(i?e.data[this.field].unshift(t):e.data[this.field].push(t)),this.initializeRow(e),this.layoutRow(e),this.refreshData(!0)}findChildIndex(e,t){var i=!1;return"object"==typeof e?e instanceof w?i=e.data:e instanceof v?i=e._getSelf().data:"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?t.modules.dataTree&&(i=t.modules.dataTree.children.find((t=>t instanceof w&&t.element===e)))&&(i=i.data):null===e&&(i=!1):i=void 0!==e&&t.data[this.field].find((t=>t.data[this.table.options.index]==e)),i&&(Array.isArray(t.data[this.field])&&(i=t.data[this.field].indexOf(i)),-1==i&&(i=!1)),i}getTreeChildren(e,t,i){var s=e.modules.dataTree,o=[];return s.children&&(Array.isArray(s.children)||(s.children=this.generateChildren(e)),s.children.forEach((e=>{e instanceof w&&(o.push(t?e.getComponent():e),i&&(o=o.concat(this.getTreeChildren(e,t,i))))}))),o}getChildField(){return this.field}redrawNeeded(e){return!!this.field&&void 0!==e[this.field]||!!this.elementField&&void 0!==e[this.elementField]}}y.moduleName="dataTree";var R={csv:function(e,t={},i){var s=t.delimiter?t.delimiter:",",o=[],n=[];e.forEach((e=>{var t=[];switch(e.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":e.columns.forEach(((e,t)=>{e&&1===e.depth&&(n[t]=void 0===e.value||null===e.value?"":'"'+String(e.value).split('"').join('""')+'"')}));break;case"row":e.columns.forEach((e=>{if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}t.push('"'+String(e.value).split('"').join('""')+'"')}})),o.push(t.join(s))}})),n.length&&o.unshift(n.join(s)),o=o.join("\n"),t.bom&&(o="\ufeff"+o),i(o,"text/csv")},json:function(e,t,i){var s=[];e.forEach((e=>{var t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(t)}})),i(s=JSON.stringify(s,null,"\t"),"application/json")},jsonLines:function(e,t,i){const s=[];e.forEach((e=>{const t={};switch(e.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":e.columns.forEach((e=>{e&&(t[e.component.getTitleDownload()||e.component.getField()]=e.value)})),s.push(JSON.stringify(t))}})),i(s.join("\n"),"application/x-ndjson")},pdf:function(e,t={},i){var s=[],o=[],n={},r=t.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},a=t.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=t.jsPDF||{},h=t.title?t.title:"";function d(e,t){var i=[];return e.columns.forEach((e=>{var s;if(e){switch(typeof e.value){case"object":e.value=null!==e.value?JSON.stringify(e.value):"";break;case"undefined":e.value=""}s={content:e.value,colSpan:e.width,rowSpan:e.height},t&&(s.styles=t),i.push(s)}})),i}l.orientation||(l.orientation=t.orientation||"landscape"),l.unit||(l.unit="pt"),e.forEach((e=>{switch(e.type){case"header":s.push(d(e));break;case"group":o.push(d(e,r));break;case"calc":o.push(d(e,a));break;case"row":o.push(d(e))}}));var c=new jspdf.jsPDF(l);t.autoTable&&(n="function"==typeof t.autoTable?t.autoTable(c)||{}:t.autoTable),h&&(n.didDrawPage=function(e){c.text(h,40,30)}),n.head=s,n.body=o,c.autoTable(n),t.documentProcessing&&t.documentProcessing(c),i(c.output("arraybuffer"),"application/pdf")},xlsx:function(t,i,s){var o=i.sheetName||"Sheet1",n=XLSX.utils.book_new(),r=new e(this);function a(){var e=[],i=[],s={},o={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((e,t)=>e+(t&&t.width?t.width:1)),0):0,r:t.length}};return t.forEach(((t,s)=>{var o=[];t.columns.forEach((function(e,t){e?(o.push(e.value instanceof Date||"object"!=typeof e.value?e.value:JSON.stringify(e.value)),(e.width>1||e.height>-1)&&(e.height>1||e.width>1)&&i.push({s:{r:s,c:t},e:{r:s+e.height-1,c:t+e.width-1}})):o.push("")})),e.push(o)})),XLSX.utils.sheet_add_aoa(s,e),s["!ref"]=XLSX.utils.encode_range(o),i.length&&(s["!merges"]=i),s}if(n.SheetNames=[],n.Sheets={},i.sheetOnly)s(a());else{if(i.sheets)for(var l in i.sheets)!0===i.sheets[l]?(n.SheetNames.push(l),n.Sheets[l]=a()):(n.SheetNames.push(l),r.commsSend(i.sheets[l],"download","intercept",{type:"xlsx",options:{sheetOnly:!0},active:this.active,intercept:function(e){n.Sheets[l]=e}}));else n.SheetNames.push(o),n.Sheets[o]=a();i.documentProcessing&&(n=i.documentProcessing(n)),s(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),s=0;s!=e.length;++s)i[s]=255&e.charCodeAt(s);return t}(XLSX.write(n,{bookType:"xlsx",bookSST:!0,type:"binary"})),"application/octet-stream")}},html:function(e,t,i){this.modExists("export",!0)&&i(this.modules.export.generateHTMLTable(e),"text/html")}};class x extends s{constructor(e){super(e),this.registerTableOption("downloadEncoder",(function(e,t){return new Blob([e],{type:t})})),this.registerTableOption("downloadReady",void 0),this.registerTableOption("downloadConfig",{}),this.registerTableOption("downloadRowRange","active"),this.registerColumnOption("download"),this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck(),this.registerTableFunction("download",this.download.bind(this)),this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("downloadReady","downloadEncoder")}downloadToTab(e,t,i,s){this.download(e,t,i,s,!0)}download(e,t,i,s,o){var n=!1;if("function"==typeof e?n=e:x.downloaders[e]?n=x.downloaders[e]:console.warn("Download Error - No such download type found: ",e),n){var r=this.generateExportList(s);n.call(this.table,r,i||{},function(i,s){o?!0===o?this.triggerDownload(i,s,e,t,!0):o(i):this.triggerDownload(i,s,e,t)}.bind(this))}}generateExportList(e){var t=this.table.modules.export.generateExportList(this.table.options.downloadConfig,!1,e||this.table.options.downloadRowRange,"download"),i=this.table.options.groupHeaderDownload;return i&&!Array.isArray(i)&&(i=[i]),t.forEach((e=>{var t;"group"===e.type&&(t=e.columns[0],i&&i[e.indent]&&(t.value=i[e.indent](t.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)))})),t}triggerDownload(e,t,i,s,o){var n=document.createElement("a"),r=this.table.options.downloadEncoder(e,t);r&&(o?window.open(window.URL.createObjectURL(r)):(s=s||"Tabulator."+("function"==typeof i?"txt":i),navigator.msSaveOrOpenBlob?navigator.msSaveOrOpenBlob(r,s):(n.setAttribute("href",window.URL.createObjectURL(r)),n.setAttribute("download",s),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n))),this.dispatchExternal("downloadComplete"))}commsReceived(e,t,i){switch(t){case"intercept":this.download(i.type,"",i.options,i.active,i.intercept)}}}function T(e,t){var i=t.mask,s=void 0!==t.maskLetterChar?t.maskLetterChar:"A",o=void 0!==t.maskNumberChar?t.maskNumberChar:"9",n=void 0!==t.maskWildcardChar?t.maskWildcardChar:"*";function r(t){var a=i[t];void 0!==a&&a!==n&&a!==s&&a!==o&&(e.value=e.value+""+a,r(t+1))}e.addEventListener("keydown",(t=>{var r=e.value.length,a=t.key;if(t.keyCode>46){if(r>=i.length)return t.preventDefault(),t.stopPropagation(),!1;switch(i[r]){case s:if(a.toUpperCase()==a.toLowerCase())return t.preventDefault(),t.stopPropagation(),!1;break;case o:if(isNaN(a))return t.preventDefault(),t.stopPropagation(),!1;break;case n:break;default:if(a!==i[r])return t.preventDefault(),t.stopPropagation(),!1}}})),e.addEventListener("keyup",(i=>{i.keyCode>46&&t.maskAutoFill&&r(e.value.length)})),e.placeholder||(e.placeholder=i),t.maskAutoFill&&r(e.value.length)}x.moduleName="download",x.downloaders=R;class M{constructor(e,t,i,s,o,n){this.edit=e,this.table=e.table,this.cell=t,this.params=this._initializeParams(n),this.data=[],this.displayItems=[],this.currentItems=[],this.focusedItem=null,this.input=this._createInputElement(),this.listEl=this._createListElement(),this.initialValues=null,this.isFilter=!t._getSelf,this.filterTimeout=null,this.filtered=!1,this.typing=!1,this.values=[],this.popup=null,this.listIteration=0,this.lastAction="",this.blurable=!0,this.actions={success:s,cancel:o},this._deprecatedOptionsCheck(),this._initializeValue(),i(this._onRendered.bind(this))}_deprecatedOptionsCheck(){this.params.listItemFormatter&&this.cell.getTable().deprecationAdvisor.msg("The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.sortValuesList&&this.cell.getTable().deprecationAdvisor.msg("The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchFunc&&this.cell.getTable().deprecationAdvisor.msg("The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options"),this.params.searchingPlaceholder&&this.cell.getTable().deprecationAdvisor.msg("The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options")}_initializeValue(){var e=this.cell.getValue();void 0===e&&void 0!==this.params.defaultValue&&(e=this.params.defaultValue),this.initialValues=this.params.multiselect?e:[e],this.isFilter&&(this.input.value=this.initialValues?this.initialValues.join(","):"",this.headerFilterInitialListGen())}_onRendered(){var e=this.cell.getElement();function t(e){e.stopPropagation()}this.input.style.height="100%",this.input.focus({preventScroll:!0}),e.addEventListener("click",t),setTimeout((()=>{e.removeEventListener("click",t)}),1e3),this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var e=document.createElement("div");return e.classList.add("tabulator-edit-list"),e.addEventListener("mousedown",this._preventBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e}_setListWidth(){var e=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=e.offsetWidth+"px",this.params.maxWidth&&(!0===this.params.maxWidth?this.listEl.style.maxWidth=e.offsetWidth+"px":"number"==typeof this.params.maxWidth?this.listEl.style.maxWidth=this.params.maxWidth+"px":this.listEl.style.maxWidth=this.params.maxWidth)}_createInputElement(){var e=this.params.elementAttributes,t=document.createElement("input");if(t.setAttribute("type",this.params.clearable?"search":"text"),t.style.padding="4px",t.style.width="100%",t.style.boxSizing="border-box",this.params.autocomplete||(t.style.cursor="default",t.style.caretColor="transparent"),e&&"object"==typeof e)for(let i in e)"+"==i.charAt(0)?(i=i.slice(1),t.setAttribute(i,t.getAttribute(i)+e["+"+i])):t.setAttribute(i,e[i]);return this.params.mask&&T(t,this.params),this._bindInputEvents(t),t}_initializeParams(e){var t,i=["values","valuesURL","valuesLookup"];return(e=Object.assign({},e)).verticalNavigation=e.verticalNavigation||"editor",e.placeholderLoading=void 0===e.placeholderLoading?"Searching ...":e.placeholderLoading,e.placeholderEmpty=void 0===e.placeholderEmpty?"No Results Found":e.placeholderEmpty,e.filterDelay=void 0===e.filterDelay?300:e.filterDelay,e.emptyValue=Object.keys(e).includes("emptyValue")?e.emptyValue:"",(t=Object.keys(e).filter((e=>i.includes(e))).length)?t>1&&console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor"):console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set"),e.autocomplete?e.multiselect&&(e.multiselect=!1,console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")):(e.freetext&&(e.freetext=!1,console.warn("list editor config error - freetext option is only available when autocomplete is enabled")),e.filterFunc&&(e.filterFunc=!1,console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")),e.filterRemote&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")),e.mask&&(e.mask=!1,console.warn("list editor config error - mask option is only available when autocomplete is enabled")),e.allowEmpty&&(e.allowEmpty=!1,console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")),e.listOnEmpty&&(e.listOnEmpty=!1,console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled"))),e.filterRemote&&"function"!=typeof e.valuesLookup&&!e.valuesURL&&(e.filterRemote=!1,console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")),e}_bindInputEvents(e){e.addEventListener("focus",this._inputFocus.bind(this)),e.addEventListener("click",this._inputClick.bind(this)),e.addEventListener("blur",this._inputBlur.bind(this)),e.addEventListener("keydown",this._inputKeyDown.bind(this)),e.addEventListener("search",this._inputSearch.bind(this)),this.params.autocomplete&&e.addEventListener("keyup",this._inputKeyUp.bind(this))}_inputFocus(e){this.rebuildOptionsList()}_filter(){this.params.filterRemote?(clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)):this._filterList()}_inputClick(e){e.stopPropagation()}_inputBlur(e){this.blurable&&(this.popup?this.popup.hide():this._resolveValue(!0))}_inputSearch(){this._clearChoices()}_inputKeyDown(e){switch(e.keyCode){case 38:this._keyUp(e);break;case 40:this._keyDown(e);break;case 37:case 39:this._keySide(e);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(e);break;case 9:break;default:this._keySelectLetter(e)}}_inputKeyUp(e){switch(e.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(e)}}_preventPopupBlur(){this.popup&&this.popup.blockHide(),setTimeout((()=>{this.popup&&this.popup.restoreHide()}),10)}_preventBlur(){this.blurable=!1,setTimeout((()=>{this.blurable=!0}),10)}_keyUp(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t)&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t>0&&this._focusItem(this.displayItems[t-1]))}_keyDown(e){var t=this.displayItems.indexOf(this.focusedItem);("editor"==this.params.verticalNavigation||"hybrid"==this.params.verticalNavigation&&t=38&&e.keyCode<=90&&this._scrollToValue(e.keyCode))}_keyAutoCompLetter(e){this._filter(),this.lastAction="typing",this.typing=!0}_scrollToValue(e){clearTimeout(this.filterTimeout);var t=String.fromCharCode(e).toLowerCase();this.filterTerm+=t.toLowerCase();var i=this.displayItems.find((e=>void 0!==e.label&&e.label.toLowerCase().startsWith(this.filterTerm)));i&&this._focusItem(i),this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(e){this.lastAction="focus",this.focusedItem&&this.focusedItem.element&&this.focusedItem.element.classList.remove("focused"),this.focusedItem=e,e&&e.element&&(e.element.classList.add("focused"),e.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"}))}headerFilterInitialListGen(){this._generateOptions(!0)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((e=>{Number.isInteger(e)||console.error("List generation error",e)}))}_filterList(){this._buildList(this._filterOptions()),this._showList()}_generateOptions(e){var t=[],i=++this.listIteration;return this.filtered=!1,this.params.values?t=this.params.values:this.params.valuesURL?t=this._ajaxRequest(this.params.valuesURL,this.input.value):"function"==typeof this.params.valuesLookup?t=this.params.valuesLookup(this.cell,this.input.value):this.params.valuesLookup&&(t=this._uniqueColumnValues(this.params.valuesLookupField)),t instanceof Promise?(e||this._addPlaceholder(this.params.placeholderLoading),t.then().then((e=>this.listIteration===i?this._parseList(e):Promise.reject(i)))):Promise.resolve(this._parseList(t))}_addPlaceholder(e){var t=document.createElement("div");"function"==typeof e&&(e=e(this.cell.getComponent(),this.listEl)),e&&(this._clearList(),e instanceof HTMLElement?t=e:(t.classList.add("tabulator-edit-list-placeholder"),t.innerHTML=e),this.listEl.appendChild(t),this._showList())}_ajaxRequest(e,t){return e=a(e,{},this.params.filterRemote?{term:t}:{}),fetch(e).then((e=>e.ok?e.json().catch((e=>(console.warn("List Ajax Load Error - Invalid JSON returned",e),Promise.reject(e)))):(console.error("List Ajax Load Error - Connection Error: "+e.status,e.statusText),Promise.reject(e)))).catch((e=>(console.error("List Ajax Load Error - Connection Error: ",e),Promise.reject(e))))}_uniqueColumnValues(e){var t,i={},s=this.table.getData(this.params.valuesLookup);return(t=e?this.table.columnManager.getColumnByField(e):this.cell.getColumn()._getSelf())?s.forEach((e=>{var s=t.getFieldValue(e);null!=s&&""!==s&&(i[s]=!0)})):(console.warn("unable to find matching column to create select lookup list:",e),i=[]),Object.keys(i)}_parseList(e){var t=[];return Array.isArray(e)||(e=Object.entries(e).map((([e,t])=>({label:t,value:e})))),e.forEach((e=>{"object"!=typeof e&&(e={label:e,value:e}),this._parseListItem(e,t,0)})),!this.currentItems.length&&this.params.freetext&&(this.input.value=this.initialValues,this.typing=!0,this.lastAction="typing"),this.data=t,t}_parseListItem(e,t,i){var s={};e.options?s=this._parseListGroup(e,i+1):(s={label:e.label,value:e.value,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,selected:!1,visible:!0,level:i,original:e},this.initialValues&&this.initialValues.indexOf(e.value)>-1&&this._chooseItem(s,!0)),t.push(s)}_parseListGroup(e,t){var i={label:e.label,group:!0,itemParams:e.itemParams,elementAttributes:e.elementAttributes,element:!1,visible:!0,level:t,options:[],original:e};return e.options.forEach((e=>{this._parseListItem(e,i.options,t)})),i}_sortOptions(e){var t;return this.params.sort&&(t="function"==typeof this.params.sort?this.params.sort:this._defaultSortFunction.bind(this),this._sortGroup(t,e)),e}_sortGroup(e,t){t.sort(((t,i)=>e(t.label,i.label,t.value,i.value,t.original,i.original))),t.forEach((t=>{t.group&&this._sortGroup(e,t.options)}))}_defaultSortFunction(e,t){var i,s,o,n,r,a=0,l=/(\d+)|(\D+)/g,h=/\d/,d=0;if("desc"===this.params.sort&&([e,t]=[t,e]),e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((i=String(e).toLowerCase())===(s=String(t).toLowerCase()))return 0;if(!h.test(i)||!h.test(s))return i>s?1:-1;for(i=i.match(l),s=s.match(l),r=i.length>s.length?s.length:i.length;an?1:-1;return i.length>s.length}d=1}else d=t||0===t?-1:0;return d}_filterOptions(){var e=this.params.filterFunc||this._defaultFilterFunc,t=this.input.value;return t?(this.filtered=!0,this.data.forEach((i=>{this._filterItem(e,t,i)}))):this.filtered=!1,this.data}_filterItem(e,t,i){var s=!1;return i.group?(i.options.forEach((i=>{this._filterItem(e,t,i)&&(s=!0)})),i.visible=s):i.visible=e(t,i.label,i.value,i.original),i.visible}_defaultFilterFunc(e,t,i,s){return e=String(e).toLowerCase(),null!=t&&(String(t).toLowerCase().indexOf(e)>-1||String(i).toLowerCase().indexOf(e)>-1)}_clearList(){for(;this.listEl.firstChild;)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(e){this._clearList(),e.forEach((e=>{this._buildItem(e)})),this.displayItems.length||this._addPlaceholder(this.params.placeholderEmpty)}_buildItem(e){var t,i=e.element;if(!this.filtered||e.visible){if(!i){if((i=document.createElement("div")).tabIndex=0,(t=this.params.itemFormatter?this.params.itemFormatter(e.label,e.value,e.original,i):e.label)instanceof HTMLElement?i.appendChild(t):i.innerHTML=t,e.group?i.classList.add("tabulator-edit-list-group"):i.classList.add("tabulator-edit-list-item"),i.classList.add("tabulator-edit-list-group-level-"+e.level),e.elementAttributes&&"object"==typeof e.elementAttributes)for(let t in e.elementAttributes)"+"==t.charAt(0)?(t=t.slice(1),i.setAttribute(t,this.input.getAttribute(t)+e.elementAttributes["+"+t])):i.setAttribute(t,e.elementAttributes[t]);e.group?i.addEventListener("click",this._groupClick.bind(this,e)):i.addEventListener("click",this._itemClick.bind(this,e)),i.addEventListener("mousedown",this._preventBlur.bind(this)),e.element=i}this._styleItem(e),this.listEl.appendChild(i),e.group?e.options.forEach((e=>{this._buildItem(e)})):this.displayItems.push(e)}}_showList(){var e=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&""===this.input.value&&!this.params.listOnEmpty)return void(this.popup&&this.popup.hide(!0));this._setListWidth(),this.popup||(this.popup=this.edit.popup(this.listEl)),this.popup.show(this.cell.getElement(),"bottom"),e||setTimeout((()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,!0))}),10)}}_styleItem(e){e&&e.element&&(e.selected?e.element.classList.add("active"):e.element.classList.remove("active"))}_itemClick(e,t){t.stopPropagation(),this._chooseItem(e)}_groupClick(e,t){t.stopPropagation()}_cancel(){this.popup.hide(!0),this.actions.cancel()}_clearChoices(){this.typing=!0,this.currentItems.forEach((e=>{e.selected=!1,this._styleItem(e)})),this.currentItems=[],this.focusedItem=null}_chooseItem(e,t){var i;this.typing=!1,this.params.multiselect?((i=this.currentItems.indexOf(e))>-1?(this.currentItems.splice(i,1),e.selected=!1):(this.currentItems.push(e),e.selected=!0),this.input.value=this.currentItems.map((e=>e.label)).join(","),this._styleItem(e)):(this.currentItems=[e],e.selected=!0,this.input.value=e.label,this._styleItem(e),t||this._resolveValue()),this._focusItem(e)}_resolveValue(e){var t,i;if(this.popup&&this.popup.hide(!0),this.params.multiselect)t=this.currentItems.map((e=>e.value));else if(e&&this.params.autocomplete&&this.typing){if(!(this.params.freetext||this.params.allowEmpty&&""===this.input.value))return void this.actions.cancel();t=this.input.value}else t=this.currentItems[0]?this.currentItems[0].value:null==(i=this.initialValues[0])||""===i?i:this.params.emptyValue;""===t&&(t=this.params.emptyValue),this.actions.success(t),this.isFilter&&(this.initialValues=t&&!Array.isArray(t)?[t]:t,this.currentItems=[])}}var L={input:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type",o.search?"search":"text"),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(e){null==n&&""!==r.value||r.value!==n?i(r.value)&&(n=r.value):s()}return r.value=void 0!==n?n:"",t((function(){r.focus({preventScroll:!0}),r.style.height="100%",o.selectContents&&r.select()})),r.addEventListener("change",a),r.addEventListener("blur",a),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(r,o),r},textarea:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"hybrid",a=String(null!=n?n:""),l=document.createElement("textarea"),h=0;if(l.style.display="block",l.style.padding="2px",l.style.height="100%",l.style.width="100%",l.style.boxSizing="border-box",l.style.whiteSpace="pre-wrap",l.style.resize="none",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(t){null==n&&""!==l.value||l.value!==n?(i(l.value)&&(n=l.value),setTimeout((function(){e.getRow().normalizeHeight()}),300)):s()}return l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",l.scrollHeight,l.style.height=l.scrollHeight+"px",e.getRow().normalizeHeight(),o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keyup",(function(){l.style.height="";var t=l.scrollHeight;l.style.height=t+"px",t!=h&&(h=t,e.getRow().normalizeHeight())})),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:e.shiftKey&&o.shiftEnterSubmit&&d();break;case 27:s();break;case 38:("editor"==r||"hybrid"==r&&l.selectionStart)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 40:("editor"==r||"hybrid"==r&&l.selectionStart!==l.value.length)&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(l,o),l},number:function(e,t,i,s,o){var n=e.getValue(),r=o.verticalNavigation||"editor",a=document.createElement("input");if(a.setAttribute("type","number"),void 0!==o.max&&a.setAttribute("max",o.max),void 0!==o.min&&a.setAttribute("min",o.min),void 0!==o.step&&a.setAttribute("step",o.step),a.style.padding="4px",a.style.width="100%",a.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),a.setAttribute(e,a.getAttribute(e)+o.elementAttributes["+"+e])):a.setAttribute(e,o.elementAttributes[e]);a.value=n;var l=function(e){h()};function h(){var e=a.value;isNaN(e)||""===e||(e=Number(e)),e!==n?i(e)&&(n=e):s()}return t((function(){a.removeEventListener("blur",l),a.focus({preventScroll:!0}),a.style.height="100%",a.addEventListener("blur",l),o.selectContents&&a.select()})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:h();break;case 27:s();break;case 38:case 40:"editor"==r&&(e.stopImmediatePropagation(),e.stopPropagation());break;case 35:case 36:e.stopPropagation()}})),o.mask&&T(a,o),a},range:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input");if(r.setAttribute("type","range"),void 0!==o.max&&r.setAttribute("max",o.max),void 0!==o.min&&r.setAttribute("min",o.min),void 0!==o.step&&r.setAttribute("step",o.step),r.style.padding="4px",r.style.width="100%",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function a(){var e=r.value;isNaN(e)||""===e||(e=Number(e)),e!=n?i(e)&&(n=e):s()}return r.value=n,t((function(){r.focus({preventScroll:!0}),r.style.height="100%"})),r.addEventListener("blur",(function(e){a()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:a();break;case 27:s()}})),r},date:function(e,t,i,s,o){var n=o.format,r=n?window.DateTime||luxon.DateTime:null,a=e.getValue(),l=document.createElement("input");function h(e){return(r.isDateTime(e)?e:"iso"===n?r.fromISO(String(e)):r.fromFormat(String(e),n)).toFormat("yyyy-MM-dd")}if(l.type="date",l.style.padding="4px",l.style.width="100%",l.style.boxSizing="border-box",o.max&&l.setAttribute("max",n?h(o.max):o.max),o.min&&l.setAttribute("min",n?h(o.min):o.min),o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),l.setAttribute(e,l.getAttribute(e)+o.elementAttributes["+"+e])):l.setAttribute(e,o.elementAttributes[e]);function d(e){var t=l.value;null==a&&""!==t||t!==a?(t&&n&&(t=r.fromFormat(String(t),"yyyy-MM-dd").toFormat(n)),i(t)&&(a=l.value)):s()}return a=void 0!==a?a:"",n&&(r?a=h(a):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),l.value=a,t((function(){l.focus({preventScroll:!0}),l.style.height="100%",o.selectContents&&l.select()})),l.addEventListener("change",d),l.addEventListener("blur",d),l.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),l},time:function(e,t,i,s,o){var n,r=o.format,a=r?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");if(h.type="time",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function d(e){var t=h.value;null==l&&""!==t||t!==l?(t&&r&&(t=a.fromFormat(String(t),"hh:mm").toFormat(r)),i(t)&&(l=h.value)):s()}return l=void 0!==l?l:"",r&&(a?(n=a.isDateTime(l)?l:"iso"===r?a.fromISO(String(l)):a.fromFormat(String(l),r),l=n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),h.value=l,t((function(){h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select()})),h.addEventListener("change",d),h.addEventListener("blur",d),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),h},datetime:function(e,t,i,s,o){var n,r=o.format,a=r?window.DateTime||luxon.DateTime:null,l=e.getValue(),h=document.createElement("input");if(h.type="datetime-local",h.style.padding="4px",h.style.width="100%",h.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),h.setAttribute(e,h.getAttribute(e)+o.elementAttributes["+"+e])):h.setAttribute(e,o.elementAttributes[e]);function d(e){var t=h.value;null==l&&""!==t||t!==l?(t&&r&&(t=a.fromISO(String(t)).toFormat(r)),i(t)&&(l=h.value)):s()}return l=void 0!==l?l:"",r&&(a?(n=a.isDateTime(l)?l:"iso"===r?a.fromISO(String(l)):a.fromFormat(String(l),r),l=n.toFormat("yyyy-MM-dd")+"T"+n.toFormat("hh:mm")):console.error("Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js")),h.value=l,t((function(){h.focus({preventScroll:!0}),h.style.height="100%",o.selectContents&&h.select()})),h.addEventListener("change",d),h.addEventListener("blur",d),h.addEventListener("keydown",(function(e){switch(e.keyCode){case 13:d();break;case 27:s();break;case 35:case 36:e.stopPropagation()}})),h},select:function(e,t,i,s,o){return this.deprecationMsg("The select editor has been deprecated, please use the new list editor"),new M(this,e,t,i,s,o).input},list:function(e,t,i,s,o){return new M(this,e,t,i,s,o).input},autocomplete:function(e,t,i,s,o){return this.deprecationMsg("The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam"),o.autocomplete=!0,new M(this,e,t,i,s,o).input},star:function(e,t,i,s,o){var n=this,r=e.getElement(),a=e.getValue(),l=r.getElementsByTagName("svg").length||5,h=r.getElementsByTagName("svg")[0]?r.getElementsByTagName("svg")[0].getAttribute("width"):14,d=[],c=document.createElement("div"),u=document.createElementNS("http://www.w3.org/2000/svg","svg");function m(e){d.forEach((function(t,i){i'):("ie"==n.table.browser?t.setAttribute("class","tabulator-star-inactive"):t.classList.replace("tabulator-star-active","tabulator-star-inactive"),t.innerHTML='')}))}function p(e){var t=document.createElement("span"),s=u.cloneNode(!0);d.push(s),t.addEventListener("mouseenter",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),m(e)})),t.addEventListener("mousemove",(function(e){e.stopPropagation(),e.stopImmediatePropagation()})),t.addEventListener("click",(function(t){t.stopPropagation(),t.stopImmediatePropagation(),i(e),r.blur()})),t.appendChild(s),c.appendChild(t)}function g(e){a=e,m(e)}if(r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",c.style.verticalAlign="middle",c.style.display="inline-block",c.style.padding="4px",u.setAttribute("width",h),u.setAttribute("height",h),u.setAttribute("viewBox","0 0 512 512"),u.setAttribute("xml:space","preserve"),u.style.padding="0 1px",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),c.setAttribute(e,c.getAttribute(e)+o.elementAttributes["+"+e])):c.setAttribute(e,o.elementAttributes[e]);for(var b=1;b<=l;b++)p(b);return m(a=Math.min(parseInt(a),l)),c.addEventListener("mousemove",(function(e){m(0)})),c.addEventListener("click",(function(e){i(0)})),r.addEventListener("blur",(function(e){s()})),r.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:g(a+1);break;case 37:g(a-1);break;case 13:i(a);break;case 27:s()}})),c},progress:function(e,t,i,s,o){var n,r,a=e.getElement(),l=void 0===o.max?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:o.max,h=void 0===o.min?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:o.min,d=(l-h)/100,c=e.getValue()||0,u=document.createElement("div"),m=document.createElement("div");function p(){var e=window.getComputedStyle(a,null),t=d*Math.round(m.offsetWidth/((a.clientWidth-parseInt(e.getPropertyValue("padding-left"))-parseInt(e.getPropertyValue("padding-right")))/100))+h;i(t),a.setAttribute("aria-valuenow",t),a.setAttribute("aria-label",c)}if(u.style.position="absolute",u.style.right="0",u.style.top="0",u.style.bottom="0",u.style.width="5px",u.classList.add("tabulator-progress-handle"),m.style.display="inline-block",m.style.position="relative",m.style.height="100%",m.style.backgroundColor="#488CE9",m.style.maxWidth="100%",m.style.minWidth="0%",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),m.setAttribute(e,m.getAttribute(e)+o.elementAttributes["+"+e])):m.setAttribute(e,o.elementAttributes[e]);return a.style.padding="4px 4px",c=Math.min(parseFloat(c),l),c=Math.max(parseFloat(c),h),c=Math.round((c-h)/d),m.style.width=c+"%",a.setAttribute("aria-valuemin",h),a.setAttribute("aria-valuemax",l),m.appendChild(u),u.addEventListener("mousedown",(function(e){n=e.screenX,r=m.offsetWidth})),u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"})),a.addEventListener("mousemove",(function(e){n&&(m.style.width=r+e.screenX-n+"px")})),a.addEventListener("mouseup",(function(e){n&&(e.stopPropagation(),e.stopImmediatePropagation(),n=!1,r=!1,p())})),a.addEventListener("keydown",(function(e){switch(e.keyCode){case 39:e.preventDefault(),m.style.width=m.clientWidth+a.clientWidth/100+"px";break;case 37:e.preventDefault(),m.style.width=m.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:p();break;case 27:s()}})),a.addEventListener("blur",(function(){s()})),m},tickCross:function(e,t,i,s,o){var n=e.getValue(),r=document.createElement("input"),a=o.tristate,l=void 0===o.indeterminateValue?null:o.indeterminateValue,h=!1,d=Object.keys(o).includes("trueValue"),c=Object.keys(o).includes("falseValue");if(r.setAttribute("type","checkbox"),r.style.marginTop="5px",r.style.boxSizing="border-box",o.elementAttributes&&"object"==typeof o.elementAttributes)for(let e in o.elementAttributes)"+"==e.charAt(0)?(e=e.slice(1),r.setAttribute(e,r.getAttribute(e)+o.elementAttributes["+"+e])):r.setAttribute(e,o.elementAttributes[e]);function u(e){var t=r.checked;return d&&t?t=o.trueValue:c&&!t&&(t=o.falseValue),a?e?h?l:t:r.checked&&!h?(r.checked=!1,r.indeterminate=!0,h=!0,l):(h=!1,t):t}return r.value=n,!a||void 0!==n&&n!==l&&""!==n||(h=!0,r.indeterminate=!0),"firefox"!=this.table.browser&&t((function(){r.focus({preventScroll:!0})})),r.checked=d?n===o.trueValue:!0===n||"true"===n||"True"===n||1===n,t((function(){r.focus()})),r.addEventListener("change",(function(e){i(u())})),r.addEventListener("blur",(function(e){i(u(!0))})),r.addEventListener("keydown",(function(e){13==e.keyCode&&i(u()),27==e.keyCode&&s()})),r}};class k extends s{constructor(e){super(e),this.currentCell=!1,this.mouseClick=!1,this.recursionBlock=!1,this.invalidEdit=!1,this.editedCells=[],this.editors=k.editors,this.registerColumnOption("editable"),this.registerColumnOption("editor"),this.registerColumnOption("editorParams"),this.registerColumnOption("cellEditing"),this.registerColumnOption("cellEdited"),this.registerColumnOption("cellEditCancelled"),this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this)),this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this)),this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this)),this.registerTableFunction("navigateNext",this.navigateNext.bind(this)),this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this)),this.registerTableFunction("navigateRight",this.navigateRight.bind(this)),this.registerTableFunction("navigateUp",this.navigateUp.bind(this)),this.registerTableFunction("navigateDown",this.navigateDown.bind(this)),this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this)),this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this)),this.registerComponentFunction("cell","edit",this.editCell.bind(this)),this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this)),this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this)),this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this)),this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this)),this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this)),this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this)),this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this)),this.subscribe("cell-delete",this.clearEdited.bind(this)),this.subscribe("cell-value-changed",this.updateCellClass.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("column-delete",this.columnDeleteCheck.bind(this)),this.subscribe("row-deleting",this.rowDeleteCheck.bind(this)),this.subscribe("data-refreshing",this.cancelEdit.bind(this)),this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,void 0)),this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this)),this.subscribe("keybinding-nav-left",this.navigateLeft.bind(this,void 0)),this.subscribe("keybinding-nav-right",this.navigateRight.bind(this,void 0)),this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,void 0)),this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,void 0))}keybindingNavigateNext(e){var t=this.currentCell,i=this.options("tabEndNewRow");t&&(this.navigateNext(t,e)||i&&(t.getElement().firstChild.blur(),(i=!0===i?this.table.addRow({}):"function"==typeof i?this.table.addRow(i(t.row.getComponent())):this.table.addRow(Object.assign({},i))).then((()=>{setTimeout((()=>{t.getComponent().navigateNext()}))}))))}cellIsEdited(e){return!!e.modules.edit&&e.modules.edit.edited}cellCancelEdit(e){e===this.currentCell?this.table.modules.edit.cancelEdit():console.warn("Cancel Editor Error - This cell is not currently being edited ")}updateCellClass(e){this.allowEdit(e)?e.getElement().classList.add("tabulator-editable"):e.getElement().classList.remove("tabulator-editable")}clearCellEdited(e){e||(e=this.table.modules.edit.getEditedCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.table.modules.edit.clearEdited(e._getSelf())}))}navigatePrev(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateLeft())return!0;if((s=this.table.rowManager.prevDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,s.cells.length)))return i.getComponent().edit(),!0}return!1}navigateNext(e=this.currentCell,t){var i,s;if(e){if(t&&t.preventDefault(),i=this.navigateRight())return!0;if((s=this.table.rowManager.nextDisplayRow(e.row,!0))&&(i=this.findNextEditableCell(s,-1)))return i.getComponent().edit(),!0}return!1}navigateLeft(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findPrevEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateRight(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.findNextEditableCell(e.row,i)))&&(s.getComponent().edit(),!0)}navigateUp(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.prevDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}navigateDown(e=this.currentCell,t){var i,s;return!!(e&&(t&&t.preventDefault(),i=e.getIndex(),s=this.table.rowManager.nextDisplayRow(e.row,!0)))&&(s.cells[i].getComponent().edit(),!0)}findNextEditableCell(e,i){var s=!1;if(i0)for(var o=i-1;o>=0;o--){let i=e.cells[o];if(i.column.modules.edit&&t.elVisible(i.getElement())){if(this.allowEdit(i)){s=i;break}}}return s}initializeColumnCheck(e){void 0!==e.definition.editor&&this.initializeColumn(e)}columnDeleteCheck(e){this.currentCell&&this.currentCell.column===e&&this.cancelEdit()}rowDeleteCheck(e){this.currentCell&&this.currentCell.row===e&&this.cancelEdit()}initializeColumn(e){var t={editor:!1,blocked:!1,check:e.definition.editable,params:e.definition.editorParams||{}};switch(typeof e.definition.editor){case"string":this.editors[e.definition.editor]?t.editor=this.editors[e.definition.editor]:console.warn("Editor Error - No such editor found: ",e.definition.editor);break;case"function":t.editor=e.definition.editor;break;case"boolean":!0===e.definition.editor&&("function"!=typeof e.definition.formatter?this.editors[e.definition.formatter]?t.editor=this.editors[e.definition.formatter]:t.editor=this.editors.input:console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",e.definition.formatter))}t.editor&&(e.modules.edit=t)}getCurrentCell(){return!!this.currentCell&&this.currentCell.getComponent()}clearEditor(e){var t,i=this.currentCell;if(this.invalidEdit=!1,i){for(this.currentCell=!1,t=i.getElement(),this.dispatch("edit-editor-clear",i,e),t.classList.remove("tabulator-editing");t.firstChild;)t.removeChild(t.firstChild);i.row.getElement().classList.remove("tabulator-editing"),i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var e=this.currentCell,t=this.currentCell.getComponent();this.clearEditor(!0),e.setValueActual(e.getValue()),e.cellRendered(),("textarea"==e.column.definition.editor||e.column.definition.variableHeight)&&e.row.normalizeHeight(!0),e.column.definition.cellEditCancelled&&e.column.definition.cellEditCancelled.call(this.table,t),this.dispatch("edit-cancelled",e),this.dispatchExternal("cellEditCancelled",t)}}bindEditor(e){if(e.column.modules.edit){var t=this,i=e.getElement(!0);this.updateCellClass(e),i.setAttribute("tabindex",0),i.addEventListener("click",(function(e){i.classList.contains("tabulator-editing")||i.focus({preventScroll:!0})})),i.addEventListener("mousedown",(function(e){2===e.button?e.preventDefault():t.mouseClick=!0})),i.addEventListener("focus",(function(i){t.recursionBlock||t.edit(e,i,!1)}))}}focusCellNoEvent(e,t){this.recursionBlock=!0,t&&"ie"===this.table.browser||e.getElement().focus({preventScroll:!0}),this.recursionBlock=!1}editCell(e,t){this.focusCellNoEvent(e),this.edit(e,!1,t)}focusScrollAdjust(e){if("virtual"==this.table.rowManager.getRenderMode()){var t=this.table.rowManager.element.scrollTop,i=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=e.row.getElement();s.offsetTopi&&(this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-i);var o=this.table.rowManager.element.scrollLeft,n=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,r=e.getElement();this.table.modExists("frozenColumns")&&(o+=parseInt(this.table.modules.frozenColumns.leftMargin),n-=parseInt(this.table.modules.frozenColumns.rightMargin)),"virtual"===this.table.options.renderHorizontal&&(o-=parseInt(this.table.columnManager.renderer.vDomPadLeft),n-=parseInt(this.table.columnManager.renderer.vDomPadLeft)),r.offsetLeftn&&(this.table.rowManager.element.scrollLeft+=r.offsetLeft+r.offsetWidth-n)}}allowEdit(e){var t=!!e.column.modules.edit;if(e.column.modules.edit)switch(typeof e.column.modules.edit.check){case"function":t=e.column.modules.edit.check(e.getComponent());break;case"string":t=!!e.row.data[e.column.modules.edit.check];break;case"boolean":t=e.column.modules.edit.check}return t}edit(e,t,i){var s,o,n,r=this,a=function(){},l=e.getElement();if(!this.currentCell){if(e.column.modules.edit.blocked)return this.mouseClick=!1,l.blur(),!1;if(t&&t.stopPropagation(),this.allowEdit(e)||i){if(r.cancelEdit(),r.currentCell=e,this.focusScrollAdjust(e),o=e.getComponent(),this.mouseClick&&(this.mouseClick=!1,e.column.definition.cellClick&&e.column.definition.cellClick.call(this.table,t,o)),e.column.definition.cellEditing&&e.column.definition.cellEditing.call(this.table,o),this.dispatch("cell-editing",e),this.dispatchExternal("cellEditing",o),n="function"==typeof e.column.modules.edit.params?e.column.modules.edit.params(o):e.column.modules.edit.params,!1===(s=e.column.modules.edit.editor.call(r,o,(function(e){a=e}),(function(t){if(r.currentCell===e){var i=r.chain("edit-success",[e,t],!0,!0);return!0===i||"highlight"===r.table.options.validationMode?(r.clearEditor(),e.modules.edit||(e.modules.edit={}),e.modules.edit.edited=!0,-1==r.editedCells.indexOf(e)&&r.editedCells.push(e),e.setValue(t,!0),!0===i):(r.invalidEdit=!0,r.focusCellNoEvent(e,!0),a(),!1)}}),(function(){r.currentCell===e&&r.cancelEdit()}),n)))return l.blur(),!1;if(!(s instanceof Node))return console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",s),l.blur(),!1;for(l.classList.add("tabulator-editing"),e.row.getElement().classList.add("tabulator-editing"),e.table.element.classList.add("tabulator-editing");l.firstChild;)l.removeChild(l.firstChild);l.appendChild(s),a();for(var h=l.children,d=0;d{e.push(t.getComponent())})),e}clearEdited(e){var t;e.modules.edit&&e.modules.edit.edited&&(e.modules.edit.edited=!1,this.dispatch("edit-edited-clear",e)),(t=this.editedCells.indexOf(e))>-1&&this.editedCells.splice(t,1)}}k.moduleName="edit",k.editors=L;class S{constructor(e,t,i,s){this.type=e,this.columns=t,this.component=i||!1,this.indent=s||0}}class D{constructor(e,t,i,s,o){this.value=e,this.component=t||!1,this.width=i,this.height=s,this.depth=o}}class P extends s{constructor(e){super(e),this.config={},this.cloneTableStyle=!0,this.colVisProp="",this.registerTableOption("htmlOutputConfig",!1),this.registerColumnOption("htmlOutput"),this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(e,t,i,s){this.cloneTableStyle=t,this.config=e||{},this.colVisProp=s;var o=!1!==this.config.columnHeaders?this.headersToExportRows(this.generateColumnGroupHeaders()):[],n=this.bodyToExportRows(this.rowLookup(i));return o.concat(n)}generateTable(e,t,i,s){var o=this.generateExportList(e,t,i,s);return this.generateTableElement(o)}rowLookup(e){var t=[];if("function"==typeof e)e.call(this.table).forEach((e=>{(e=this.table.rowManager.findRow(e))&&t.push(e)}));else switch(e){case!0:case"visible":t=this.table.rowManager.getVisibleRows(!1,!0);break;case"all":t=this.table.rowManager.rows;break;case"selected":t=this.table.modules.selectRow.selectedRows;break;case"active":default:t=this.table.options.pagination?this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length-2):this.table.rowManager.getDisplayRows()}return Object.assign([],t)}generateColumnGroupHeaders(){var e=[];return(!1!==this.config.columnGroups?this.table.columnManager.columns:this.table.columnManager.columnsByIndex).forEach((t=>{var i=this.processColumnGroup(t);i&&e.push(i)})),e}processColumnGroup(e){var t=e.columns,i=0,s={title:e.definition["title"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))]||e.definition.title,column:e,depth:1};if(t.length){if(s.subGroups=[],s.width=0,t.forEach((e=>{var t=this.processColumnGroup(e);t&&(s.width+=t.width,s.subGroups.push(t),t.depth>i&&(i=t.depth))})),s.depth+=i,!s.width)return!1}else{if(!this.columnVisCheck(e))return!1;s.width=1}return s}columnVisCheck(e){var t=e.definition[this.colVisProp];return"function"==typeof t&&(t=t.call(this.table,e.getComponent())),!1!==t&&(e.visible||!e.visible&&t)}headersToExportRows(e){var t=[],i=0,s=[];function o(e,s){var n=i-s;if(void 0===t[s]&&(t[s]=[]),e.height=e.subGroups?1:n-e.depth+1,t[s].push(e),e.height>1)for(let i=1;i1)for(let i=1;ii&&(i=e.depth)})),e.forEach((function(e){o(e,0)})),t.forEach((e=>{var t=[];e.forEach((e=>{if(e){let i=void 0===e.title?"":e.title;t.push(new D(i,e.column.getComponent(),e.width,e.height,e.depth))}else t.push(null)})),s.push(new S("header",t))})),s}bodyToExportRows(e){var t=[],i=[];return this.table.columnManager.columnsByIndex.forEach((e=>{this.columnVisCheck(e)&&t.push(e.getComponent())})),!1!==this.config.columnCalcs&&this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&e.unshift(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&e.push(this.table.modules.columnCalcs.botRow)),(e=e.filter((e=>{switch(e.type){case"group":return!1!==this.config.rowGroups;case"calc":return!1!==this.config.columnCalcs;case"row":return!(this.table.options.dataTree&&!1===this.config.dataTree&&e.modules.dataTree.parent)}return!0}))).forEach(((e,s)=>{var o=e.getData(this.colVisProp),n=[],r=0;switch(e.type){case"group":r=e.level,n.push(new D(e.key,e.getComponent(),t.length,1));break;case"calc":case"row":t.forEach((e=>{n.push(new D(e._column.getFieldValue(o),e,1,1))})),this.table.options.dataTree&&!1!==this.config.dataTree&&(r=e.modules.dataTree.index)}i.push(new S(e.type,n,e.getComponent(),r))})),i}generateTableElement(e){var t=document.createElement("table"),i=document.createElement("thead"),s=document.createElement("tbody"),o=this.lookupTableStyles(),n=this.table.options["rowFormatter"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r={};return r.rowFormatter=null!==n?n:this.table.options.rowFormatter,this.table.options.dataTree&&!1!==this.config.dataTree&&this.table.modExists("columnCalcs")&&(r.treeElementField=this.table.modules.dataTree.elementField),r.groupHeader=this.table.options["groupHeader"+(this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1))],r.groupHeader&&!Array.isArray(r.groupHeader)&&(r.groupHeader=[r.groupHeader]),t.classList.add("tabulator-print-table"),this.mapElementStyles(this.table.columnManager.getHeadersElement(),i,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),e.length>1e3&&console.warn("It may take a long time to render an HTML table with more than 1000 rows"),e.forEach(((e,t)=>{let n;switch(e.type){case"header":i.appendChild(this.generateHeaderElement(e,r,o));break;case"group":s.appendChild(this.generateGroupElement(e,r,o));break;case"calc":s.appendChild(this.generateCalcElement(e,r,o));break;case"row":n=this.generateRowElement(e,r,o),this.mapElementStyles(t%2&&o.evenRow?o.evenRow:o.oddRow,n,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s.appendChild(n)}})),i.innerHTML&&t.appendChild(i),t.appendChild(s),this.mapElementStyles(this.table.element,t,["border-top","border-left","border-right","border-bottom"]),t}lookupTableStyles(){var e={};return this.cloneTableStyle&&window.getComputedStyle&&(e.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)"),e.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)"),e.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs"),e.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)"),e.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0],e.firstRow&&(e.styleCells=e.firstRow.getElementsByClassName("tabulator-cell"),e.firstCell=e.styleCells[0],e.lastCell=e.styleCells[e.styleCells.length-1])),e}generateHeaderElement(e,t,i){var s=document.createElement("tr");return e.columns.forEach((e=>{if(e){var t=document.createElement("th"),i=e.component._column.definition.cssClass?e.component._column.definition.cssClass.split(" "):[];t.colSpan=e.width,t.rowSpan=e.height,t.innerHTML=e.value,this.cloneTableStyle&&(t.style.boxSizing="border-box"),i.forEach((function(e){t.classList.add(e)})),this.mapElementStyles(e.component.getElement(),t,["text-align","border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]),this.mapElementStyles(e.component._column.contentElement,t,["padding-top","padding-left","padding-right","padding-bottom"]),e.component._column.visible?this.mapElementStyles(e.component.getElement(),t,["width"]):e.component._column.definition.width&&(t.style.width=e.component._column.definition.width+"px"),e.component._column.parent&&this.mapElementStyles(e.component._column.parent.groupElement,t,["border-top"]),s.appendChild(t)}})),s}generateGroupElement(e,t,i){var s=document.createElement("tr"),o=document.createElement("td"),n=e.columns[0];return s.classList.add("tabulator-print-table-row"),t.groupHeader&&t.groupHeader[e.indent]?n.value=t.groupHeader[e.indent](n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component):!1!==t.groupHeader&&(n.value=e.component._group.generator(n.value,e.component._group.getRowCount(),e.component._group.getData(),e.component)),o.colSpan=n.width,o.innerHTML=n.value,s.classList.add("tabulator-print-table-group"),s.classList.add("tabulator-group-level-"+e.indent),n.component.isVisible()&&s.classList.add("tabulator-group-visible"),this.mapElementStyles(i.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),this.mapElementStyles(i.firstGroup,o,["padding-top","padding-left","padding-right","padding-bottom"]),s.appendChild(o),s}generateCalcElement(e,t,i){var s=this.generateRowElement(e,t,i);return s.classList.add("tabulator-print-table-calcs"),this.mapElementStyles(i.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]),s}generateRowElement(e,t,i){var s=document.createElement("tr");return s.classList.add("tabulator-print-table-row"),e.columns.forEach(((o,n)=>{if(o){var r,a=document.createElement("td"),l=o.component._column,h=this.table.columnManager.findColumnIndex(l),d=o.value,c={modules:{},getValue:function(){return d},getField:function(){return l.definition.field},getElement:function(){return a},getColumn:function(){return l.getComponent()},getData:function(){return e.component.getData()},getRow:function(){return e.component},getComponent:function(){return c},column:l};if((l.definition.cssClass?l.definition.cssClass.split(" "):[]).forEach((function(e){a.classList.add(e)})),this.table.modExists("format")&&!1!==this.config.formatCells)d=this.table.modules.format.formatExportValue(c,this.colVisProp);else switch(typeof d){case"object":d=null!==d?JSON.stringify(d):"";break;case"undefined":d=""}d instanceof Node?a.appendChild(d):a.innerHTML=d,(r=i.styleCells&&i.styleCells[h]?i.styleCells[h]:i.firstCell)&&(this.mapElementStyles(r,a,["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"]),l.definition.align&&(a.style.textAlign=l.definition.align)),this.table.options.dataTree&&!1!==this.config.dataTree&&(t.treeElementField&&t.treeElementField==l.field||!t.treeElementField&&0==n)&&(e.component._row.modules.dataTree.controlEl&&a.insertBefore(e.component._row.modules.dataTree.controlEl.cloneNode(!0),a.firstChild),e.component._row.modules.dataTree.branchEl&&a.insertBefore(e.component._row.modules.dataTree.branchEl.cloneNode(!0),a.firstChild)),s.appendChild(a),c.modules.format&&c.modules.format.renderedCallback&&c.modules.format.renderedCallback(),t.rowFormatter&&!1!==this.config.formatCells&&t.rowFormatter(e.component)}})),s}generateHTMLTable(e){var t=document.createElement("div");return t.appendChild(this.generateTableElement(e)),t.innerHTML}getHtml(e,t,i,s){var o=this.generateExportList(i||this.table.options.htmlOutputConfig,t,e,s||"htmlOutput");return this.generateHTMLTable(o)}mapElementStyles(e,t,i){if(this.cloneTableStyle&&e&&t){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var o=window.getComputedStyle(e);i.forEach((function(e){t.style[s[e]]=o.getPropertyValue(e)}))}}}}P.moduleName="export";var z={"=":function(e,t,i,s){return t==e},"<":function(e,t,i,s){return t":function(e,t,i,s){return t>e},">=":function(e,t,i,s){return t>=e},"!=":function(e,t,i,s){return t!=e},regex:function(e,t,i,s){return"string"==typeof e&&(e=new RegExp(e)),e.test(t)},like:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().indexOf(e.toLowerCase())>-1},keywords:function(e,t,i,s){var o=e.toLowerCase().split(void 0===s.separator?" ":s.separator),n=String(null==t?"":t).toLowerCase(),r=[];return o.forEach((e=>{n.includes(e)&&r.push(!0)})),s.matchAll?r.length===o.length:!!r.length},starts:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().startsWith(e.toLowerCase())},ends:function(e,t,i,s){return null==e?t===e:null!=t&&String(t).toLowerCase().endsWith(e.toLowerCase())},in:function(e,t,i,s){return Array.isArray(e)?!e.length||e.indexOf(t)>-1:(console.warn("Filter Error - filter value is not an array:",e),!1)}};class F extends s{constructor(e){super(e),this.filterList=[],this.headerFilters={},this.headerFilterColumns=[],this.prevHeaderFilterChangeCheck="",this.prevHeaderFilterChangeCheck="{}",this.changed=!1,this.tableInitialized=!1,this.registerTableOption("filterMode","local"),this.registerTableOption("initialFilter",!1),this.registerTableOption("initialHeaderFilter",!1),this.registerTableOption("headerFilterLiveFilterDelay",300),this.registerColumnOption("headerFilter"),this.registerColumnOption("headerFilterPlaceholder"),this.registerColumnOption("headerFilterParams"),this.registerColumnOption("headerFilterEmptyCheck"),this.registerColumnOption("headerFilterFunc"),this.registerColumnOption("headerFilterFuncParams"),this.registerColumnOption("headerFilterLiveFilter"),this.registerTableFunction("searchRows",this.searchRows.bind(this)),this.registerTableFunction("searchData",this.searchData.bind(this)),this.registerTableFunction("setFilter",this.userSetFilter.bind(this)),this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this)),this.registerTableFunction("addFilter",this.userAddFilter.bind(this)),this.registerTableFunction("getFilters",this.getFilters.bind(this)),this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this)),this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this)),this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this)),this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this)),this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this)),this.registerTableFunction("clearFilter",this.userClearFilter.bind(this)),this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this)),this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this)),this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this)),this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this)),this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this)),this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this)),this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),"remote"===this.table.options.filterMode&&this.subscribe("data-params",this.remoteFilterParams.bind(this)),this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){this.table.options.initialFilter&&this.setFilter(this.table.options.initialFilter),this.table.options.initialHeaderFilter&&this.table.options.initialHeaderFilter.forEach((e=>{var t=this.table.columnManager.findColumn(e.field);if(!t)return console.warn("Column Filter Error - No matching column found:",e.field),!1;this.setHeaderFilterValue(t,e.value)})),this.tableInitialized=!0}remoteFilterParams(e,t,i,s){return s.filter=this.getFilters(!0,!0),s}userSetFilter(e,t,i,s){this.setFilter(e,t,i,s),this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(e,t,i,s){this.addFilter(e,t,i,s),this.refreshFilter()}userSetHeaderFilterFocus(e){var t=this.table.columnManager.findColumn(e);if(!t)return console.warn("Column Filter Focus Error - No matching column found:",e),!1;this.setHeaderFilterFocus(t)}userGetHeaderFilterValue(e){var t=this.table.columnManager.findColumn(e);if(t)return this.getHeaderFilterValue(t);console.warn("Column Filter Error - No matching column found:",e)}userSetHeaderFilterValue(e,t){var i=this.table.columnManager.findColumn(e);if(!i)return console.warn("Column Filter Error - No matching column found:",e),!1;this.setHeaderFilterValue(i,t)}userRemoveFilter(e,t,i){this.removeFilter(e,t,i),this.refreshFilter()}userClearFilter(e){this.clearFilter(e),this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter(),this.refreshFilter()}searchRows(e,t,i){return this.search("rows",e,t,i)}searchData(e,t,i){return this.search("data",e,t,i)}initializeColumnHeaderFilter(e){var t=e.definition;t.headerFilter&&(void 0!==t.headerFilterPlaceholder&&t.field&&this.module("localize").setHeaderFilterColumnPlaceholder(t.field,t.headerFilterPlaceholder),this.initializeColumn(e))}initializeColumn(e,t){var i=this,s=e.getField();e.modules.filter={success:function(t){var o,n="input"==e.modules.filter.tagType&&"text"==e.modules.filter.attrType||"textarea"==e.modules.filter.tagType?"partial":"match",r="",a="";if(void 0===e.modules.filter.prevSuccess||e.modules.filter.prevSuccess!==t){if(e.modules.filter.prevSuccess=t,e.modules.filter.emptyFunc(t))delete i.headerFilters[s];else{switch(e.modules.filter.value=t,typeof e.definition.headerFilterFunc){case"string":F.filters[e.definition.headerFilterFunc]?(r=e.definition.headerFilterFunc,o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,F.filters[e.definition.headerFilterFunc](t,o,i,s)}):console.warn("Header Filter Error - Matching filter function not found: ",e.definition.headerFilterFunc);break;case"function":r=o=function(i){var s=e.definition.headerFilterFuncParams||{},o=e.getFieldValue(i);return s="function"==typeof s?s(t,o,i):s,e.definition.headerFilterFunc(t,o,i,s)}}if(!o)switch(n){case"partial":o=function(i){var s=e.getFieldValue(i);return null!=s&&String(s).toLowerCase().indexOf(String(t).toLowerCase())>-1},r="like";break;default:o=function(i){return e.getFieldValue(i)==t},r="="}i.headerFilters[s]={value:t,func:o,type:r}}e.modules.filter.value=t,a=JSON.stringify(i.headerFilters),i.prevHeaderFilterChangeCheck!==a&&(i.prevHeaderFilterChangeCheck=a,i.trackChanges(),i.refreshFilter())}return!0},attrType:!1,tagType:!1,emptyFunc:!1},this.generateHeaderFilterElement(e)}generateHeaderFilterElement(e,t,i){var s,o,n,r,a,l,h,d=this,c=e.modules.filter.success,u=e.getField();if(e.modules.filter.value=t,e.modules.filter.headerElement&&e.modules.filter.headerElement.parentNode&&e.contentElement.removeChild(e.modules.filter.headerElement.parentNode),u){switch(e.modules.filter.emptyFunc=e.definition.headerFilterEmptyCheck||function(e){return!e&&0!==e},(s=document.createElement("div")).classList.add("tabulator-header-filter"),typeof e.definition.headerFilter){case"string":d.table.modules.edit.editors[e.definition.headerFilter]?(o=d.table.modules.edit.editors[e.definition.headerFilter],"tick"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):console.warn("Filter Error - Cannot build header filter, No such editor found: ",e.definition.editor);break;case"function":o=e.definition.headerFilter;break;case"boolean":e.modules.edit&&e.modules.edit.editor?o=e.modules.edit.editor:e.definition.formatter&&d.table.modules.edit.editors[e.definition.formatter]?(o=d.table.modules.edit.editors[e.definition.formatter],"tick"!==e.definition.formatter&&"tickCross"!==e.definition.formatter||e.definition.headerFilterEmptyCheck||(e.modules.filter.emptyFunc=function(e){return!0!==e&&!1!==e})):o=d.table.modules.edit.editors.input}if(o){if(r={getValue:function(){return void 0!==t?t:""},getField:function(){return e.definition.field},getElement:function(){return s},getColumn:function(){return e.getComponent()},getTable:()=>this.table,getRow:function(){return{normalizeHeight:function(){}}}},h="function"==typeof(h=e.definition.headerFilterParams||{})?h.call(d.table,r):h,!(n=o.call(this.table.modules.edit,r,(function(){}),c,(function(){}),h)))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor returned a value of false");if(!(n instanceof Node))return void console.warn("Filter Error - Cannot add filter to "+u+" column, editor should return an instance of Node, the editor returned:",n);d.langBind("headerFilters|columns|"+e.definition.field,(function(e){n.setAttribute("placeholder",void 0!==e&&e?e:d.langText("headerFilters|default"))})),n.addEventListener("click",(function(e){e.stopPropagation(),n.focus()})),n.addEventListener("focus",(e=>{var t=this.table.columnManager.element.scrollLeft;t!==this.table.rowManager.element.scrollLeft+parseInt(this.table.columnManager.element.style.marginLeft)&&(this.table.rowManager.scrollHorizontal(t),this.table.columnManager.scrollHorizontal(t))})),a=!1,l=function(e){a&&clearTimeout(a),a=setTimeout((function(){c(n.value)}),d.table.options.headerFilterLiveFilterDelay)},e.modules.filter.headerElement=n,e.modules.filter.attrType=n.hasAttribute("type")?n.getAttribute("type").toLowerCase():"",e.modules.filter.tagType=n.tagName.toLowerCase(),!1!==e.definition.headerFilterLiveFilter&&("autocomplete"!==e.definition.headerFilter&&"tickCross"!==e.definition.headerFilter&&("autocomplete"!==e.definition.editor&&"tickCross"!==e.definition.editor||!0!==e.definition.headerFilter)&&(n.addEventListener("keyup",l),n.addEventListener("search",l),"number"==e.modules.filter.attrType&&n.addEventListener("change",(function(e){c(n.value)})),"text"==e.modules.filter.attrType&&"ie"!==this.table.browser&&n.setAttribute("type","search")),"input"!=e.modules.filter.tagType&&"select"!=e.modules.filter.tagType&&"textarea"!=e.modules.filter.tagType||n.addEventListener("mousedown",(function(e){e.stopPropagation()}))),s.appendChild(n),e.contentElement.appendChild(s),i||d.headerFilterColumns.push(e)}}else console.warn("Filter Error - Cannot add header filter, column has no field set:",e.definition.title)}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="none")}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(e){e.modules.filter&&e.modules.filter.headerElement&&(e.modules.filter.headerElement.style.display="")}))}setHeaderFilterFocus(e){e.modules.filter&&e.modules.filter.headerElement?e.modules.filter.headerElement.focus():console.warn("Column Filter Focus Error - No header filter set on column:",e.getField())}getHeaderFilterValue(e){if(e.modules.filter&&e.modules.filter.headerElement)return e.modules.filter.value;console.warn("Column Filter Error - No header filter set on column:",e.getField())}setHeaderFilterValue(e,t){e&&(e.modules.filter&&e.modules.filter.headerElement?(this.generateHeaderFilterElement(e,t,!0),e.modules.filter.success(t)):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}reloadHeaderFilter(e){e&&(e.modules.filter&&e.modules.filter.headerElement?this.generateHeaderFilterElement(e,e.modules.filter.value,!0):console.warn("Column Filter Error - No header filter set on column:",e.getField()))}refreshFilter(){this.tableInitialized&&("remote"===this.table.options.filterMode?this.reloadData(null,!1,!1):this.refreshData(!0))}trackChanges(){this.changed=!0,this.dispatch("filter-changed")}hasChanged(){var e=this.changed;return this.changed=!1,e}setFilter(e,t,i,s){this.filterList=[],Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),this.addFilter(e)}addFilter(e,t,i,s){var o=!1;Array.isArray(e)||(e=[{field:e,type:t,value:i,params:s}]),e.forEach((e=>{(e=this.findFilter(e))&&(this.filterList.push(e),o=!0)})),o&&this.trackChanges()}findFilter(e){var t;if(Array.isArray(e))return this.findSubFilters(e);var i=!1;return"function"==typeof e.field?i=function(t){return e.field(t,e.type||{})}:F.filters[e.type]?i=(t=this.table.columnManager.getColumnByField(e.field))?function(i){return F.filters[e.type](e.value,t.getFieldValue(i),i,e.params||{})}:function(t){return F.filters[e.type](e.value,t[e.field],t,e.params||{})}:console.warn("Filter Error - No such filter type found, ignoring: ",e.type),e.func=i,!!e.func&&e}findSubFilters(e){var t=[];return e.forEach((e=>{(e=this.findFilter(e))&&t.push(e)})),!!t.length&&t}getFilters(e,t){var i=[];return e&&(i=this.getHeaderFilters()),t&&i.forEach((function(e){"function"==typeof e.type&&(e.type="function")})),i=i.concat(this.filtersToArray(this.filterList,t))}filtersToArray(e,t){var i=[];return e.forEach((e=>{var s;Array.isArray(e)?i.push(this.filtersToArray(e,t)):(s={field:e.field,type:e.type,value:e.value},t&&"function"==typeof s.type&&(s.type="function"),i.push(s))})),i}getHeaderFilters(){var e=[];for(var t in this.headerFilters)e.push({field:t,type:this.headerFilters[t].type,value:this.headerFilters[t].value});return e}removeFilter(e,t,i){Array.isArray(e)||(e=[{field:e,type:t,value:i}]),e.forEach((e=>{var t=-1;(t="object"==typeof e.field?this.filterList.findIndex((t=>e===t)):this.filterList.findIndex((t=>e.field===t.field&&e.type===t.type&&e.value===t.value)))>-1?this.filterList.splice(t,1):console.warn("Filter Error - No matching filter type found, ignoring: ",e.type)})),this.trackChanges()}clearFilter(e){this.filterList=[],e&&this.clearHeaderFilter(),this.trackChanges()}clearHeaderFilter(){this.headerFilters={},this.prevHeaderFilterChangeCheck="{}",this.headerFilterColumns.forEach((e=>{void 0!==e.modules.filter.value&&delete e.modules.filter.value,e.modules.filter.prevSuccess=void 0,this.reloadHeaderFilter(e)})),this.trackChanges()}search(e,t,i,s){var o=[],n=[];return Array.isArray(t)||(t=[{field:t,type:i,value:s}]),t.forEach((e=>{(e=this.findFilter(e))&&n.push(e)})),this.table.rowManager.rows.forEach((t=>{var i=!0;n.forEach((e=>{this.filterRecurse(e,t.getData())||(i=!1)})),i&&o.push("data"===e?t.getData("data"):t.getComponent())})),o}filter(e,t){var i=[],s=[];return this.subscribedExternal("dataFiltering")&&this.dispatchExternal("dataFiltering",this.getFilters(!0)),"remote"!==this.table.options.filterMode&&(this.filterList.length||Object.keys(this.headerFilters).length)?e.forEach((e=>{this.filterRow(e)&&i.push(e)})):i=e.slice(0),this.subscribedExternal("dataFiltered")&&(i.forEach((e=>{s.push(e.getComponent())})),this.dispatchExternal("dataFiltered",this.getFilters(!0),s)),i}filterRow(e,t){var i=!0,s=e.getData();for(var o in this.filterList.forEach((e=>{this.filterRecurse(e,s)||(i=!1)})),this.headerFilters)this.headerFilters[o].func(s)||(i=!1);return i}filterRecurse(e,t){var i=!1;return Array.isArray(e)?e.forEach((e=>{this.filterRecurse(e,t)&&(i=!0)})):i=e.func(t),i}}F.moduleName="filter",F.filters=z;var H={plaintext:function(e,t,i){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,i){return e.getValue()},textarea:function(e,t,i){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,i){var s,o,n,r,a=parseFloat(e.getValue()),l="",h=t.decimal||".",d=t.thousand||",",c=t.negativeSign||"-",u=t.symbol||"",m=!!t.symbolAfter,p=void 0!==t.precision?t.precision:2;if(isNaN(a))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));if(a<0&&(a=Math.abs(a),l=c),s=!1!==p?a.toFixed(p):a,o=(s=String(s).split("."))[0],n=s.length>1?h+s[1]:"",!1!==t.thousand)for(r=/(\d+)(\d{3})/;r.test(o);)o=o.replace(r,"$1"+d+"$2");return m?l+o+n+u:l+u+o+n},link:function(e,t,i){var s,o=e.getValue(),n=t.urlPrefix||"",r=t.download,a=o,l=document.createElement("a");if(t.labelField&&(s=e.getData(),a=function e(t,i){var s=i[t.shift()];return t.length&&"object"==typeof s?e(t,s):s}(t.labelField.split(this.table.options.nestedFieldSeparator),s)),t.label)switch(typeof t.label){case"string":a=t.label;break;case"function":a=t.label(e)}if(a){if(t.urlField&&(o=(s=e.getData())[t.urlField]),t.url)switch(typeof t.url){case"string":o=t.url;break;case"function":o=t.url(e)}return l.setAttribute("href",n+o),t.target&&l.setAttribute("target",t.target),t.download&&(r="function"==typeof r?r(e):!0===r?"":r,l.setAttribute("download",r)),l.innerHTML=this.emptyToSpace(this.sanitizeHTML(a)),l}return" "},image:function(e,t,i){var s=document.createElement("img"),o=e.getValue();switch(t.urlPrefix&&(o=t.urlPrefix+e.getValue()),t.urlSuffix&&(o+=t.urlSuffix),s.setAttribute("src",o),typeof t.height){case"number":s.style.height=t.height+"px";break;case"string":s.style.height=t.height}switch(typeof t.width){case"number":s.style.width=t.width+"px";break;case"string":s.style.width=t.width}return s.addEventListener("load",(function(){e.getRow().normalizeHeight()})),s},tickCross:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t.allowEmpty,r=t.allowTruthy,a=Object.keys(t).includes("trueValue"),l=void 0!==t.tickElement?t.tickElement:'',h=void 0!==t.crossElement?t.crossElement:'';return a&&s===t.trueValue||!a&&(r&&s||!0===s||"true"===s||"True"===s||1===s||"1"===s)?(o.setAttribute("aria-checked",!0),l||""):!n||"null"!==s&&""!==s&&null!=s?(o.setAttribute("aria-checked",!1),h||""):(o.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=t.outputFormat||"dd/MM/yyyy HH:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=e.getValue();if(void 0!==o)return(s=o.isDateTime(l)?l:"iso"===n?o.fromISO(String(l)):o.fromFormat(String(l),n)).isValid?(t.timezone&&(s=s.setZone(t.timezone)),s.toFormat(r)):!0!==a&&l?"function"==typeof a?a(l):a:l;console.error("Format Error - 'datetime' formatter is dependant on luxon.js")},datetimediff:function(e,t,i){var s,o=window.DateTime||luxon.DateTime,n=t.inputFormat||"yyyy-MM-dd HH:mm:ss",r=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",a=void 0!==t.suffix&&t.suffix,l=void 0!==t.unit?t.unit:"days",h=void 0!==t.humanize&&t.humanize,d=void 0!==t.date?t.date:o.now(),c=e.getValue();if(void 0!==o)return(s=o.isDateTime(c)?c:"iso"===n?o.fromISO(String(c)):o.fromFormat(String(c),n)).isValid?h?s.diff(d,l).toHuman()+(a?" "+a:""):parseInt(s.diff(d,l)[l])+(a?" "+a:""):!0===r?c:"function"==typeof r?r(c):r;console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")},lookup:function(e,t,i){var s=e.getValue();return void 0===t[s]?(console.warn("Missing display value for "+s),s):t[s]},star:function(e,t,i){var s=e.getValue(),o=e.getElement(),n=t&&t.stars?t.stars:5,r=document.createElement("span"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");r.style.verticalAlign="middle",a.setAttribute("width","14"),a.setAttribute("height","14"),a.setAttribute("viewBox","0 0 512 512"),a.setAttribute("xml:space","preserve"),a.style.padding="0 1px",s=s&&!isNaN(s)?parseInt(s):0,s=Math.max(0,Math.min(s,n));for(var l=1;l<=n;l++){var h=a.cloneNode(!0);h.innerHTML=l<=s?'':'',r.appendChild(h)}return o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.setAttribute("aria-label",s),r},traffic:function(e,t,i){var s,o,n=this.sanitizeHTML(e.getValue())||0,r=document.createElement("span"),a=t&&t.max?t.max:100,l=t&&t.min?t.min:0,h=t&&void 0!==t.color?t.color:["red","orange","green"],d="#666666";if(!isNaN(n)&&void 0!==e.getValue()){switch(r.classList.add("tabulator-traffic-light"),o=parseFloat(n)<=a?parseFloat(n):a,o=parseFloat(o)>=l?parseFloat(o):l,s=(a-l)/100,o=Math.round((o-l)/s),typeof h){case"string":d=h;break;case"function":d=h(n);break;case"object":if(Array.isArray(h)){var c=100/h.length,u=Math.floor(o/c);u=Math.min(u,h.length-1),d=h[u=Math.max(u,0)];break}}return r.style.backgroundColor=d,r}},progress:function(e,t={},i){var s,o,n,r,a,l=this.sanitizeHTML(e.getValue())||0,h=e.getElement(),d=t.max?t.max:100,c=t.min?t.min:0,u=t.legendAlign?t.legendAlign:"center";switch(o=parseFloat(l)<=d?parseFloat(l):d,o=parseFloat(o)>=c?parseFloat(o):c,s=(d-c)/100,o=Math.round((o-c)/s),typeof t.color){case"string":n=t.color;break;case"function":n=t.color(l);break;case"object":if(Array.isArray(t.color)){let e=100/t.color.length,i=Math.floor(o/e);i=Math.min(i,t.color.length-1),i=Math.max(i,0),n=t.color[i];break}default:n="#2DC214"}switch(typeof t.legend){case"string":r=t.legend;break;case"function":r=t.legend(l);break;case"boolean":r=l;break;default:r=!1}switch(typeof t.legendColor){case"string":a=t.legendColor;break;case"function":a=t.legendColor(l);break;case"object":if(Array.isArray(t.legendColor)){let e=100/t.legendColor.length,i=Math.floor(o/e);i=Math.min(i,t.legendColor.length-1),i=Math.max(i,0),a=t.legendColor[i]}break;default:a="#000"}h.style.minWidth="30px",h.style.position="relative",h.setAttribute("aria-label",o);var p=document.createElement("div");p.style.display="inline-block",p.style.width=o+"%",p.style.backgroundColor=n,p.style.height="100%",p.setAttribute("data-max",d),p.setAttribute("data-min",c);var g=document.createElement("div");if(g.style.position="relative",g.style.width="100%",g.style.height="100%",r){var b=document.createElement("div");b.style.position="absolute",b.style.top=0,b.style.left=0,b.style.textAlign=u,b.style.width="100%",b.style.color=a,b.innerHTML=r}return i((function(){if(!(e instanceof m)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",h.appendChild(t),h=t}h.appendChild(g),g.appendChild(p),r&&g.appendChild(b)})),""},color:function(e,t,i){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,i){return''},buttonCross:function(e,t,i){return''},rownum:function(e,t,i){var s=document.createElement("span");return e.getRow().watchPosition((e=>{s.innerText=e})),s},handle:function(e,t,i){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,i){var s=document.createElement("div"),o=e.getRow()._row.modules.responsiveLayout;function n(e){var t=o.element;o.open=e,t&&(o.open?(s.classList.add("open"),t.style.display=""):(s.classList.remove("open"),t.style.display="none"))}return s.classList.add("tabulator-responsive-collapse-toggle"),s.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),s.addEventListener("click",(function(t){t.stopImmediatePropagation(),n(!o.open),e.getTable().rowManager.adjustTableSize()})),n(o.open),s},rowSelection:function(e,t,i){var s=document.createElement("input"),o=!1;if(s.type="checkbox",s.setAttribute("aria-label","Select Row"),this.table.modExists("selectRow",!0))if(s.addEventListener("click",(e=>{e.stopPropagation()})),"function"==typeof e.getRow){var n=e.getRow();n instanceof v?(s.addEventListener("change",(e=>{"click"===this.table.options.selectableRangeMode&&o?o=!1:n.toggleSelect()})),"click"===this.table.options.selectableRangeMode&&s.addEventListener("click",(e=>{o=!0,this.table.modules.selectRow.handleComplexRowClick(n._row,e)})),s.checked=n.isSelected&&n.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(n,s)):s=""}else s.addEventListener("change",(e=>{this.table.modules.selectRow.selectedRows.length?this.table.deselectRow():this.table.selectRow(t.rowRange)})),this.table.modules.selectRow.registerHeaderSelectCheckbox(s);return s}};class A extends s{constructor(e){super(e),this.registerColumnOption("formatter"),this.registerColumnOption("formatterParams"),this.registerColumnOption("formatterPrint"),this.registerColumnOption("formatterPrintParams"),this.registerColumnOption("formatterClipboard"),this.registerColumnOption("formatterClipboardParams"),this.registerColumnOption("formatterHtmlOutput"),this.registerColumnOption("formatterHtmlOutputParams"),this.registerColumnOption("titleFormatter"),this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this)),this.subscribe("cell-rendered",this.cellRendered.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))}lookupFormatter(e,t){var i={params:e.definition["formatter"+t+"Params"]||{}},s=e.definition["formatter"+t];switch(typeof s){case"string":A.formatters[s]?i.formatter=A.formatters[s]:(console.warn("Formatter Error - No such formatter found: ",s),i.formatter=A.formatters.plaintext);break;case"function":i.formatter=s;break;default:i.formatter=A.formatters.plaintext}return i}cellRendered(e){e.modules.format&&e.modules.format.renderedCallback&&!e.modules.format.rendered&&(e.modules.format.renderedCallback(),e.modules.format.rendered=!0)}formatHeader(e,t,i){var s,o,n,r;return e.definition.titleFormatter?(s=this.getFormatter(e.definition.titleFormatter),n=t=>{e.titleFormatterRendered=t},r={getValue:function(){return t},getElement:function(){return i}},o="function"==typeof(o=e.definition.titleFormatterParams||{})?o():o,s.call(this,r,o,n)):t}formatValue(e){var t=e.getComponent(),i="function"==typeof e.column.modules.format.params?e.column.modules.format.params(t):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,t,i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}formatExportValue(e,t){var i,s=e.column.modules.format[t];if(s){return i="function"==typeof s.params?s.params(e.getComponent()):s.params,s.formatter.call(this,e.getComponent(),i,(function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t,e.modules.format.rendered=!1}))}return this.formatValue(e)}sanitizeHTML(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=/]/g,(function(e){return t[e]}))}return e}emptyToSpace(e){return null==e||""===e?" ":e}getFormatter(e){switch(typeof e){case"string":A.formatters[e]?e=A.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=A.formatters.plaintext);break;case"function":break;default:e=A.formatters.plaintext}return e}}A.moduleName="format",A.formatters=H;class _ extends s{constructor(e){super(e),this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightPadding=0,this.initializationMode="left",this.active=!1,this.blocked=!0,this.registerColumnOption("frozen")}reset(){this.initializationMode="left",this.leftColumns=[],this.rightColumns=[],this.leftMargin=0,this.rightMargin=0,this.rightMargin=0,this.active=!1,this.table.columnManager.headersElement.style.marginLeft=0,this.table.columnManager.element.style.paddingRight=0}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-width",this.layout.bind(this)),this.subscribe("row-layout-after",this.layoutRow.bind(this)),this.subscribe("table-layout",this.layout.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this)),this.subscribe("columns-loading",this.reset.bind(this)),this.subscribe("column-add",this.reinitializeColumns.bind(this)),this.subscribe("column-delete",this.reinitializeColumns.bind(this)),this.subscribe("table-redraw",this.layout.bind(this)),this.subscribe("layout-refreshing",this.blockLayout.bind(this)),this.subscribe("layout-refreshed",this.unblockLayout.bind(this))}blockLayout(){this.blocked=!0}unblockLayout(){this.blocked=!1}layoutCell(e){this.layoutElement(e.element,e.column)}reinitializeColumns(){this.reset(),this.table.columnManager.columnsByIndex.forEach((e=>{this.initializeColumn(e)}))}initializeColumn(e){var t={margin:0,edge:!1};e.isGroup||(this.frozenCheck(e)?(t.position=this.initializationMode,"left"==this.initializationMode?this.leftColumns.push(e):this.rightColumns.unshift(e),this.active=!0,e.modules.frozen=t):this.initializationMode="right")}frozenCheck(e){return e.parent.isGroup&&e.definition.frozen&&console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups"),e.parent.isGroup?this.frozenCheck(e.parent):e.definition.frozen}scrollHorizontal(){this.active&&(this.calcMargins(!0),this.layoutColumnPosition(),this.layoutCalcRows(),this.reinitializeRows())}calcMargins(e){e||(this.leftMargin=this._calcSpace(this.leftColumns,this.leftColumns.length)+"px",this.rightMargin=this._calcSpace(this.rightColumns,this.rightColumns.length)+"px",this.table.rowManager.tableElement.style.marginRight=this.rightMargin),this.rightPadding=this.table.rowManager.element.clientWidth+this.table.columnManager.scrollLeft}layoutCalcRows(){this.table.modExists("columnCalcs")&&(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow&&this.layoutRow(this.table.modules.columnCalcs.topRow),this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow&&this.layoutRow(this.table.modules.columnCalcs.botRow),this.table.modExists("groupRows")&&this.layoutGroupCalcs(this.table.modules.groupRows.getGroups()))}layoutGroupCalcs(e){e.forEach((e=>{e.calcs.top&&this.layoutRow(e.calcs.top),e.calcs.bottom&&this.layoutRow(e.calcs.bottom),e.groupList&&e.groupList.length&&this.layoutGroupCalcs(e.groupList)}))}layoutColumnPosition(e){var t=[],i=0,s=0;this.table.columnManager.headersElement.style.marginLeft=this.leftMargin,this.table.columnManager.element.style.paddingRight=this.rightMargin,this.leftColumns.forEach(((s,o)=>{if(s.modules.frozen.marginValue=i+this.table.columnManager.scrollLeft,s.modules.frozen.margin=s.modules.frozen.marginValue+"px",s.visible&&(i+=s.getWidth()),o==this.leftColumns.length-1?s.modules.frozen.edge=!0:s.modules.frozen.edge=!1,s.parent.isGroup){var n=this.getColGroupParentElement(s);t.includes(n)||(this.layoutElement(n,s),t.push(n)),s.modules.frozen.edge&&n.classList.add("tabulator-frozen-"+s.modules.frozen.position)}else this.layoutElement(s.getElement(),s);e&&s.cells.forEach((e=>{this.layoutElement(e.getElement(!0),s)}))})),this.rightColumns.forEach(((t,i)=>{t.visible&&(s+=t.getWidth()),t.modules.frozen.marginValue=this.rightPadding-s,t.modules.frozen.margin=t.modules.frozen.marginValue+"px",i==this.rightColumns.length-1?t.modules.frozen.edge=!0:t.modules.frozen.edge=!1,t.parent.isGroup?this.layoutElement(this.getColGroupParentElement(t),t):this.layoutElement(t.getElement(),t),e&&t.cells.forEach((e=>{this.layoutElement(e.getElement(!0),t)}))}))}getColGroupParentElement(e){return e.parent.isGroup?this.getColGroupParentElement(e.parent):e.getElement()}layout(){this.active&&!this.blocked&&(this.calcMargins(),this.layoutColumnPosition(),this.reinitializeRows(),this.layoutCalcRows())}reinitializeRows(){var e=this.table.rowManager.getVisibleRows(!0);this.table.rowManager.getRows().filter((t=>!e.includes(t))).forEach((e=>{e.deinitialize()})),e.forEach((e=>{"row"===e.type&&this.layoutRow(e)}))}layoutRow(e){e.getElement().style.paddingLeft=this.leftMargin,"fitDataFill"===this.table.options.layout&&this.rightColumns.length&&(this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"),this.leftColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)})),this.rightColumns.forEach((t=>{var i=e.getCell(t);i&&this.layoutElement(i.getElement(!0),t)}))}layoutElement(e,t){t.modules.frozen&&(e.style.position="absolute",e.style.left=t.modules.frozen.margin,e.classList.add("tabulator-frozen"),t.modules.frozen.edge&&e.classList.add("tabulator-frozen-"+t.modules.frozen.position))}_calcSpace(e,t){var i=0;for(let s=0;s{this.initializeRow(e)}))}initializeRow(e){var t=this.table.options.frozenRows,i=typeof t;"number"===i?e.getPosition()&&e.getPosition()+this.rows.length<=t&&this.freezeRow(e):"function"===i?t.call(this.table,e.getComponent())&&this.freezeRow(e):Array.isArray(t)&&t.includes(e.data[this.options("frozenRowsField")])&&this.freezeRow(e)}isRowFrozen(e){return this.rows.indexOf(e)>-1}isFrozen(){return!!this.rows.length}visibleRows(e,t){return this.rows.forEach((e=>{t.push(e)})),t}getRows(e){var t=e.slice(0);return this.rows.forEach((function(e){var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t}freezeRow(e){e.modules.frozen?console.warn("Freeze Error - Row is already frozen"):(e.modules.frozen=!0,this.topElement.appendChild(e.getElement()),e.initialize(),e.normalizeHeight(),this.rows.push(e),this.refreshData(!1,"display"),this.table.rowManager.adjustTableSize(),this.styleRows())}unfreezeRow(e){e.modules.frozen?(e.modules.frozen=!1,this.detachRow(e),this.table.rowManager.adjustTableSize(),this.refreshData(!1,"display"),this.rows.length&&this.styleRows()):console.warn("Freeze Error - Row is already unfrozen")}detachRow(e){var t=this.rows.indexOf(e);if(t>-1){var i=e.getElement();i.parentNode&&i.parentNode.removeChild(i),this.rows.splice(t,1)}}styleRows(e){this.rows.forEach(((e,t)=>{this.table.rowManager.styleRow(e,t)}))}}O.moduleName="frozenRows";class B{constructor(e){return this._group=e,this.type="GroupComponent",new Proxy(this,{get:function(e,t,i){return void 0!==e[t]?e[t]:e._group.groupManager.table.componentFunctionBinder.handle("row",e._group,t)}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(!0)}getSubGroups(){return this._group.getSubGroups(!0)}getParentGroup(){return!!this._group.parent&&this._group.parent.getComponent()}isVisible(){return this._group._visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class I{constructor(e,t,i,s,o,n,r){this.groupManager=e,this.parent=t,this.key=s,this.level=i,this.field=o,this.hasSubGroups=i{e.modules&&delete e.modules.group})),this.element=!1,this.arrowElement=!1,this.elementContents=!1}createElements(){var e=document.createElement("div");e.classList.add("tabulator-arrow"),this.element=document.createElement("div"),this.element.classList.add("tabulator-row"),this.element.classList.add("tabulator-group"),this.element.classList.add("tabulator-group-level-"+this.level),this.element.setAttribute("role","rowgroup"),this.arrowElement=document.createElement("div"),this.arrowElement.classList.add("tabulator-group-toggle"),this.arrowElement.appendChild(e),!1!==this.groupManager.table.options.movableRows&&this.groupManager.table.modExists("moveRow")&&this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}createValueGroups(){var e=this.level+1;this.groupManager.allowedValues&&this.groupManager.allowedValues[e]&&this.groupManager.allowedValues[e].forEach((t=>{this._createGroup(t,e)}))}addBindings(){this.groupManager.table.options.groupToggleElement&&("arrow"==this.groupManager.table.options.groupToggleElement?this.arrowElement:this.element).addEventListener("click",(e=>{e.stopPropagation(),e.stopImmediatePropagation(),this.toggleVisibility()}))}_createGroup(e,t){var i=t+"_"+e,s=new I(this.groupManager,this,t,e,this.groupManager.groupIDLookups[t].field,this.groupManager.headerGenerator[t]||this.groupManager.headerGenerator[0],!!this.old&&this.old.groups[i]);this.groups[i]=s,this.groupList.push(s)}_addRowToGroup(e){var t=this.level+1;if(this.hasSubGroups){var i=this.groupManager.groupIDLookups[t].func(e.getData()),s=t+"_"+i;this.groupManager.allowedValues&&this.groupManager.allowedValues[t]?this.groups[s]&&this.groups[s].addRow(e):(this.groups[s]||this._createGroup(i,t),this.groups[s].addRow(e))}}_addRow(e){this.rows.push(e),e.modules.group=this}insertRow(e,t,i){var s=this.conformRowData({});e.updateData(s);var o=this.rows.indexOf(t);o>-1?i?this.rows.splice(o+1,0,e):this.rows.splice(o,0,e):i?this.rows.push(e):this.rows.unshift(e),e.modules.group=this,this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this),this.groupManager.updateGroupRows(!0)}scrollHeader(e){this.arrowElement&&(this.arrowElement.style.marginLeft=e,this.groupList.forEach((function(t){t.scrollHeader(e)})))}getRowIndex(e){}conformRowData(e){return this.field?e[this.field]=this.key:console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function"),this.parent&&(e=this.parent.conformRowData(e)),e}removeRow(e){var t=this.rows.indexOf(e),i=e.getElement();t>-1&&this.rows.splice(t,1),this.groupManager.table.options.groupValues||this.rows.length?(i.parentNode&&i.parentNode.removeChild(i),this.generateGroupHeaderContents(),this.groupManager.table.modExists("columnCalcs")&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modules.columnCalcs.recalcGroup(this)):(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this),this.groupManager.updateGroupRows(!0))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1),this.groupList.length||(this.parent?this.parent.removeGroup(this):this.groupManager.removeGroup(this)))}getHeadersAndRows(e){var t=[];return t.push(this),this._visSet(),this.visible?this.groupList.length?this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows(e))})):(!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top)),t=t.concat(this.rows),!e&&"table"!=this.groupManager.table.options.columnCalcs&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom))):this.groupList.length||"table"==this.groupManager.table.options.columnCalcs||this.groupManager.table.modExists("columnCalcs")&&(!e&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()&&(this.calcs.top&&(this.calcs.top.detachElement(),this.calcs.top.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows),t.push(this.calcs.top))),!e&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()&&(this.calcs.bottom&&(this.calcs.bottom.detachElement(),this.calcs.bottom.deleteCells()),this.groupManager.table.options.groupClosedShowCalcs&&(this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows),t.push(this.calcs.bottom)))),t}getData(e,t){var i=[];return this._visSet(),(!e||e&&this.visible)&&this.rows.forEach((e=>{i.push(e.getData(t||"data"))})),i}getRowCount(){var e=0;return this.groupList.length?this.groupList.forEach((t=>{e+=t.getRowCount()})):e=this.rows.length,e}toggleVisibility(){this.visible?this.hide():this.show()}hide(){this.visible=!1,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination||(this.element.classList.remove("tabulator-group-visible"),this.groupList.length?this.groupList.forEach((e=>{e.getHeadersAndRows().forEach((e=>{e.detachElement()}))})):this.rows.forEach((e=>{var t=e.getElement();t.parentNode.removeChild(t)}))),this.groupManager.updateGroupRows(!0),this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!1)}show(){if(this.visible=!0,"basic"!=this.groupManager.table.rowManager.getRenderMode()||this.groupManager.table.options.pagination)this.groupManager.updateGroupRows(!0);else{this.element.classList.add("tabulator-group-visible");var e=this.generateElement();this.groupList.length?this.groupList.forEach((t=>{t.getHeadersAndRows().forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i}))})):this.rows.forEach((t=>{var i=t.getElement();e.parentNode.insertBefore(i,e.nextSibling),t.initialize(),e=i})),this.groupManager.updateGroupRows(!0)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),!0)}_visSet(){var e=[];"function"==typeof this.visible&&(this.rows.forEach((function(t){e.push(t.getData())})),this.visible=this.visible(this.key,this.getRowCount(),e,this.getComponent()))}getRowGroup(e){var t=!1;return this.groupList.length?this.groupList.forEach((function(i){var s=i.getRowGroup(e);s&&(t=s)})):this.rows.find((function(t){return t===e}))&&(t=this),t}getSubGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getRows(e){var t=[];return this.rows.forEach((function(i){t.push(e?i.getComponent():i)})),t}generateGroupHeaderContents(){var e=[];for(this.rows.forEach((function(t){e.push(t.getData())})),this.elementContents=this.generator(this.key,this.getRowCount(),e,this.getComponent());this.element.firstChild;)this.element.removeChild(this.element.firstChild);"string"==typeof this.elementContents?this.element.innerHTML=this.elementContents:this.element.appendChild(this.elementContents),this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(e=[]){return e.unshift(this.key),this.parent&&this.parent.getPath(e),e}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=!1,this._visSet(),this.visible?this.element.classList.add("tabulator-group-visible"):this.element.classList.remove("tabulator-group-visible");for(var e=0;ei.length&&console.warn("Error creating group headers, groupHeader array is shorter than groupBy array"),this.headerGenerator=[function(){return""}],this.startOpen=[function(){return!1}],this.langBind("groups|item",((e,t)=>{this.headerGenerator[0]=(i,s,o)=>(void 0===i?"":i)+"("+s+" "+(1===s?e:t.groups.items)+")"})),this.groupIDLookups=[],Array.isArray(e))this.table.modExists("columnCalcs")&&"table"!=this.table.options.columnCalcs&&"both"!=this.table.options.columnCalcs&&this.table.modules.columnCalcs.removeCalcs();else if(this.table.modExists("columnCalcs")&&"group"!=this.table.options.columnCalcs)this.table.columnManager.getRealColumns().forEach((e=>{e.definition.topCalc&&this.table.modules.columnCalcs.initializeTopRow(),e.definition.bottomCalc&&this.table.modules.columnCalcs.initializeBottomRow()}));Array.isArray(e)||(e=[e]),e.forEach(((e,t)=>{var i,s;i="function"==typeof e?e:(s=this.table.columnManager.getColumnByField(e))?function(e){return s.getFieldValue(e)}:function(t){return t[e]},this.groupIDLookups.push({field:"function"!=typeof e&&e,func:i,values:!!this.allowedValues&&this.allowedValues[t]})})),t&&(Array.isArray(t)||(t=[t]),t.forEach((e=>{})),this.startOpen=t),i&&(this.headerGenerator=Array.isArray(i)?i:[i])}else this.groupList=[],this.groups={}}rowSample(e,t){if(this.table.options.groupBy){var i=this.getGroups(!1)[0];t.push(i.getRows(!1)[0])}return t}virtualRenderFill(){var e=this.table.rowManager.tableElement,t=this.table.rowManager.getVisibleRows();if(!this.table.options.groupBy)return t;t=t.filter((e=>"group"!==e.type)),e.style.minWidth=t.length?"":this.table.columnManager.getWidth()+"px"}rowAddingIndex(e,t,i){if(this.table.options.groupBy){this.assignRowToGroup(e);var s=e.modules.group.rows;return s.length>1&&(!t||t&&-1==s.indexOf(t)?i?s[0]!==e&&(t=s[0],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):s[s.length-1]!==e&&(t=s[s.length-1],this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)):this.table.rowManager.moveRowInArray(e.modules.group.rows,e,t,!i)),t}}trackChanges(){this.dispatch("group-changed")}setGroupBy(e){this.table.options.groupBy=e,this.initialized||this.initialize(),this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupValues(e){this.table.options.groupValues=e,this.configureGroupSetup(),this.refreshData(),this.trackChanges()}setGroupStartOpen(e){this.table.options.groupStartOpen=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}setGroupHeader(e){this.table.options.groupHeader=e,this.configureGroupSetup(),this.table.options.groupBy?(this.refreshData(),this.trackChanges()):console.warn("Grouping Update - cant refresh view, no groups have been set")}userGetGroups(e){return this.getGroups(!0)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(e){return!!e.modules.group&&e.modules.group.getComponent()}rowMoving(e,t,i){if(this.table.options.groupBy){!i&&t instanceof I&&(t=this.table.rowManager.prevDisplayRow(e)||t);var s=t instanceof I?t:t.modules.group,o=e instanceof I?e:e.modules.group;s===o?this.table.rowManager.moveRowInArray(s.rows,e,t,i):(o&&o.removeRow(e),s.insertRow(e,t,i))}}rowDeleting(e){this.table.options.groupBy&&e.modules.group&&e.modules.group.removeRow(e)}rowsUpdated(e){this.table.options.groupBy&&this.updateGroupRows(!0)}cellUpdated(e){this.table.options.groupBy&&this.reassignRowToGroup(e.row)}getRows(e){return this.table.options.groupBy&&this.groupIDLookups.length?(this.dispatchExternal("dataGrouping"),this.generateGroups(e),this.subscribedExternal("dataGrouped")&&this.dispatchExternal("dataGrouped",this.getGroups(!0)),this.updateGroupRows()):e.slice(0)}getGroups(e){var t=[];return this.groupList.forEach((function(i){t.push(e?i.getComponent():i)})),t}getChildGroups(e){var t=[];return e||(e=this),e.groupList.forEach((e=>{e.groupList.length?t=t.concat(this.getChildGroups(e)):t.push(e)})),t}wipe(){this.table.options.groupBy&&this.groupList.forEach((function(e){e.wipe()}))}pullGroupListData(e){var t=[];return e.forEach((e=>{var i={level:0,rowCount:0,headerContent:""},s=[];e.hasSubGroups?(s=this.pullGroupListData(e.groupList),i.level=e.level,i.rowCount=s.length-e.groupList.length,i.headerContent=e.generator(e.key,i.rowCount,e.rows,e),t.push(i),t=t.concat(s)):(i.level=e.level,i.headerContent=e.generator(e.key,e.rows.length,e.rows,e),i.rowCount=e.getRows().length,t.push(i),e.getRows().forEach((e=>{t.push(e.getData("data"))})))})),t}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(e){var t=!1;return this.options("dataTree")&&(e=this.table.modules.dataTree.getTreeParentRoot(e)),this.groupList.forEach((i=>{var s=i.getRowGroup(e);s&&(t=s)})),t}countGroups(){return this.groupList.length}generateGroups(e){var t=this.groups;this.groups={},this.groupList=[],this.allowedValues&&this.allowedValues[0]?(this.allowedValues[0].forEach((e=>{this.createGroup(e,0,t)})),e.forEach((e=>{this.assignRowToExistingGroup(e,t)}))):e.forEach((e=>{this.assignRowToGroup(e,t)}))}createGroup(e,t,i){var s,o=t+"_"+e;i=i||[],s=new I(this,!1,t,e,this.groupIDLookups[0].field,this.headerGenerator[0],i[o]),this.groups[o]=s,this.groupList.push(s)}assignRowToExistingGroup(e,t){var i="0_"+this.groupIDLookups[0].func(e.getData());this.groups[i]&&this.groups[i].addRow(e)}assignRowToGroup(e,t){var i=this.groupIDLookups[0].func(e.getData()),s=!this.groups["0_"+i];return s&&this.createGroup(i,0,t),this.groups["0_"+i].addRow(e),!s}reassignRowToGroup(e){if("row"===e.type){var t=e.modules.group,i=t.getPath(),s=this.getExpectedPath(e);i.length==s.length&&i.every(((e,t)=>e===s[t]))||(t.removeRow(e),this.assignRowToGroup(e,this.groups),this.refreshData(!0))}}getExpectedPath(e){var t=[],i=e.getData();return this.groupIDLookups.forEach((e=>{t.push(e.func(i))})),t}updateGroupRows(e){var t=[];return this.groupList.forEach((e=>{t=t.concat(e.getHeadersAndRows())})),e&&this.refreshData(!0,this.displayHandler),t}scrollHeaders(e){this.table.options.groupBy&&("virtual"===this.table.options.renderHorizontal&&(e-=this.table.columnManager.renderer.vDomPadLeft),e+="px",this.groupList.forEach((t=>{t.scrollHeader(e)})))}removeGroup(e){var t,i=e.level+"_"+e.key;this.groups[i]&&(delete this.groups[i],(t=this.groupList.indexOf(e))>-1&&this.groupList.splice(t,1))}checkBasicModeGroupHeaderWidth(){var e=this.table.rowManager.tableElement,t=!0;this.table.rowManager.getDisplayRows().forEach(((i,s)=>{this.table.rowManager.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}}V.moduleName="groupRows";class N extends s{constructor(e){super(e),this.history=[],this.index=-1,this.registerTableOption("history",!1)}initialize(){this.table.options.history&&(this.subscribe("cell-value-updated",this.cellUpdated.bind(this)),this.subscribe("cell-delete",this.clearComponentHistory.bind(this)),this.subscribe("row-delete",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clear.bind(this)),this.subscribe("row-added",this.rowAdded.bind(this)),this.subscribe("row-move",this.rowMoved.bind(this))),this.registerTableFunction("undo",this.undo.bind(this)),this.registerTableFunction("redo",this.redo.bind(this)),this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this)),this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this)),this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(e,t,i){this.action("rowMove",e,{posFrom:e.getPosition(),posTo:t.getPosition(),to:t,after:i})}rowAdded(e,t,i,s){this.action("rowAdd",e,{data:t,pos:i,index:s})}rowDeleted(e){var t,i;this.table.options.groupBy?(t=(i=e.getComponent().getGroup()._getSelf().rows).indexOf(e))&&(t=i[t-1]):(t=e.table.rowManager.getRowIndex(e))&&(t=e.table.rowManager.rows[t-1]),this.action("rowDelete",e,{data:e.getData(),pos:!t,index:t})}cellUpdated(e){this.action("cellEdit",e,{oldValue:e.oldValue,newValue:e.value})}clear(){this.history=[],this.index=-1}action(e,t,i){this.history=this.history.slice(0,this.index+1),this.history.push({type:e,component:t,data:i}),this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(e){var t=this.history.findIndex((function(t){return t.component===e}));t>-1&&(this.history.splice(t,1),t<=this.index&&this.index--,this.clearComponentHistory(e))}undo(){if(this.index>-1){let e=this.history[this.index];return N.undoers[e.type].call(this,e),this.index--,this.dispatchExternal("historyUndo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Undo Error - No more history to undo"),!1}redo(){if(this.history.length-1>this.index){this.index++;let e=this.history[this.index];return N.redoers[e.type].call(this,e),this.dispatchExternal("historyRedo",e.type,e.component.getComponent(),e.data),!0}return console.warn("History Redo Error - No more history to redo"),!1}_rebindRow(e,t){this.history.forEach((function(i){if(i.component instanceof w)i.component===e&&(i.component=t);else if(i.component instanceof p&&i.component.row===e){var s=i.component.column.getField();s&&(i.component=t.getCell(s))}}))}}N.moduleName="history",N.undoers={cellEdit:function(e){e.component.setValueProcessData(e.data.oldValue),e.component.cellRendered()},rowAdd:function(e){e.component.deleteActual()},rowDelete:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posFrom],!e.data.after),this.table.rowManager.redraw()}},N.redoers={cellEdit:function(e){e.component.setValueProcessData(e.data.newValue),e.component.cellRendered()},rowAdd:function(e){var t=this.table.rowManager.addRowActual(e.data.data,e.data.pos,e.data.index);this.table.options.groupBy&&this.table.modExists("groupRows")&&this.table.modules.groupRows.updateGroupRows(!0),this._rebindRow(e.component,t)},rowDelete:function(e){e.component.deleteActual()},rowMove:function(e){this.table.rowManager.moveRowActual(e.component,this.table.rowManager.rows[e.data.posTo],e.data.after),this.table.rowManager.redraw()}};class W extends s{constructor(e){super(e),this.fieldIndex=[],this.hasIndex=!1}initialize(){this.tableElementCheck()}tableElementCheck(){this.table.originalElement&&"TABLE"===this.table.originalElement.tagName&&(this.table.originalElement.childNodes.length?this.parseTable():console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element."))}parseTable(){var e=this.table.originalElement,t=this.table.options,i=e.getElementsByTagName("th"),s=e.getElementsByTagName("tbody")[0],o=[];this.hasIndex=!1,this.dispatchExternal("htmlImporting"),s=s?s.getElementsByTagName("tr"):[],this._extractOptions(e,t),i.length?this._extractHeaders(i,s):this._generateBlankHeaders(i,s);for(var n=0;n{n[e.toLowerCase()]=e})),s){var a,l=s[r];l&&"object"==typeof l&&l.name&&0===l.name.indexOf("tabulator-")&&(a=l.name.replace("tabulator-",""),void 0!==n[a]&&(t[n[a]]=this._attribValue(l.value)))}}_attribValue(e){return"true"===e||"false"!==e&&e}_findCol(e){return this.table.options.columns.find((t=>t.title===e))||!1}_extractHeaders(e,t){for(var i=0;i(console.error("Import Error:",e||"Unable to import data"),Promise.reject(e))))}lookupImporter(e){var t;return e||(e=this.table.options.importFormat),(t="string"==typeof e?G.importers[e]:e)||console.error("Import Error - Importer not found:",e),t}importFromFile(e,t){var i=this.lookupImporter(e);if(i)return this.pickFile(t).then(this.importData.bind(this,i)).then(this.structureData.bind(this)).then(this.setData.bind(this)).catch((e=>(console.error("Import Error:",e||"Unable to import file"),Promise.reject(e))))}pickFile(e){return new Promise(((t,i)=>{var s=document.createElement("input");s.type="file",s.accept=e,s.addEventListener("change",(e=>{var o=s.files[0],n=new FileReader;switch(this.table.options.importReader){case"buffer":n.readAsArrayBuffer(o);break;case"binary":n.readAsBinaryString(o);break;case"url":n.readAsDataURL(o);break;case"text":default:n.readAsText(o)}n.onload=e=>{t(n.result)},n.onerror=e=>{console.warn("File Load Error - Unable to read file"),i()}})),s.click()}))}importData(e,t){var i=e.call(this.table,t);return i instanceof Promise?i:i?Promise.resolve(i):Promise.reject()}structureData(e){return Array.isArray(e)&&e.length&&Array.isArray(e[0])?this.table.options.autoColumns?this.structureArrayToObject(e):this.structureArrayToColumns(e):e}structureArrayToObject(e){var t=e.shift();return e.map((e=>{var i={};return t.forEach(((t,s)=>{i[t]=e[s]})),i}))}structureArrayToColumns(e){var t=[],i=this.table.getColumns();return i[0]&&e[0][0]&&i[0].getDefinition().title===e[0][0]&&e.shift(),e.forEach((e=>{var s={};e.forEach(((e,t)=>{var o=i[t];o&&(s[o.getField()]=e)})),t.push(s)})),t}setData(e){return this.table.setData(e)}}G.moduleName="import",G.importers=j;class U extends s{constructor(e){super(e),this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupTap:"group",groupDblTap:"group",groupTapHold:"group"},this.subscribers={},this.touchSubscribers={},this.columnSubscribers={},this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}},this.registerColumnOption("headerClick"),this.registerColumnOption("headerDblClick"),this.registerColumnOption("headerContext"),this.registerColumnOption("headerMouseEnter"),this.registerColumnOption("headerMouseLeave"),this.registerColumnOption("headerMouseOver"),this.registerColumnOption("headerMouseOut"),this.registerColumnOption("headerMouseMove"),this.registerColumnOption("headerTap"),this.registerColumnOption("headerDblTap"),this.registerColumnOption("headerTapHold"),this.registerColumnOption("cellClick"),this.registerColumnOption("cellDblClick"),this.registerColumnOption("cellContext"),this.registerColumnOption("cellMouseEnter"),this.registerColumnOption("cellMouseLeave"),this.registerColumnOption("cellMouseOver"),this.registerColumnOption("cellMouseOut"),this.registerColumnOption("cellMouseMove"),this.registerColumnOption("cellTap"),this.registerColumnOption("cellDblTap"),this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents(),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this))}cellContentsSelectionFixer(e,t){var i;if(!this.table.modExists("edit")||this.table.modules.edit.currentCell!==t){e.preventDefault();try{document.selection?((i=document.body.createTextRange()).moveToElementText(t.getElement()),i.select()):window.getSelection&&((i=document.createRange()).selectNode(t.getElement()),window.getSelection().removeAllRanges(),window.getSelection().addRange(i))}catch(e){}}}initializeExternalEvents(){for(let e in this.eventMap)this.subscriptionChangeExternal(e,this.subscriptionChanged.bind(this,e))}subscriptionChanged(e,t){t?this.subscribers[e]||(this.eventMap[e].includes("-")?(this.subscribers[e]=this.handle.bind(this,e),this.subscribe(this.eventMap[e],this.subscribers[e])):this.subscribeTouchEvents(e)):this.eventMap[e].includes("-")?!this.subscribers[e]||this.columnSubscribers[e]||this.subscribedExternal(e)||(this.unsubscribe(this.eventMap[e],this.subscribers[e]),delete this.subscribers[e]):this.unsubscribeTouchEvents(e)}subscribeTouchEvents(e){var t=this.eventMap[e];this.touchSubscribers[t+"-touchstart"]||(this.touchSubscribers[t+"-touchstart"]=this.handleTouch.bind(this,t,"start"),this.touchSubscribers[t+"-touchend"]=this.handleTouch.bind(this,t,"end"),this.subscribe(t+"-touchstart",this.touchSubscribers[t+"-touchstart"]),this.subscribe(t+"-touchend",this.touchSubscribers[t+"-touchend"])),this.subscribers[e]=!0}unsubscribeTouchEvents(e){var t=!0,i=this.eventMap[e];if(this.subscribers[e]&&!this.subscribedExternal(e)){delete this.subscribers[e];for(let e in this.eventMap)this.eventMap[e]===i&&this.subscribers[e]&&(t=!1);t&&(this.unsubscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]),this.unsubscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"]),delete this.touchSubscribers[i+"-touchstart"],delete this.touchSubscribers[i+"-touchend"])}}initializeColumn(e){var t=e.definition;for(let i in this.eventMap)t[i]&&(this.subscriptionChanged(i,!0),this.columnSubscribers[i]||(this.columnSubscribers[i]=[]),this.columnSubscribers[i].push(e))}handle(e,t,i){this.dispatchEvent(e,t,i)}handleTouch(e,t,i,s){var o=this.touchWatchers[e];switch("column"===e&&(e="header"),t){case"start":o.tap=!0,clearTimeout(o.tapHold),o.tapHold=setTimeout((()=>{clearTimeout(o.tapHold),o.tapHold=null,o.tap=null,clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"TapHold",i,s)}),1e3);break;case"end":o.tap&&(o.tap=null,this.dispatchEvent(e+"Tap",i,s)),o.tapDbl?(clearTimeout(o.tapDbl),o.tapDbl=null,this.dispatchEvent(e+"DblTap",i,s)):o.tapDbl=setTimeout((()=>{clearTimeout(o.tapDbl),o.tapDbl=null}),300),clearTimeout(o.tapHold),o.tapHold=null}}dispatchEvent(e,t,i){var s,o=i.getComponent();this.columnSubscribers[e]&&(i instanceof p?s=i.column.definition[e]:i instanceof f&&(s=i.definition[e]),s&&s(t,o)),this.dispatchExternal(e,t,o)}}U.moduleName="interaction";class X extends s{constructor(e){super(e),this.watchKeys=null,this.pressedKeys=null,this.keyupBinding=!1,this.keydownBinding=!1,this.registerTableOption("keybindings",{}),this.registerTableOption("tabEndNewRow",!1)}initialize(){var e=this.table.options.keybindings,t={};this.watchKeys={},this.pressedKeys=[],!1!==e&&(Object.assign(t,X.bindings),Object.assign(t,e),this.mapBindings(t),this.bindEvents()),this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(e){for(let t in e)X.actions[t]?e[t]&&("object"!=typeof e[t]&&(e[t]=[e[t]]),e[t].forEach((e=>{(Array.isArray(e)?e:[e]).forEach((e=>{this.mapBinding(t,e)}))}))):console.warn("Key Binding Error - no such action:",t)}mapBinding(e,t){var i={action:X.actions[e],keys:[],ctrl:!1,shift:!1,meta:!1};t.toString().toLowerCase().split(" ").join("").split("+").forEach((e=>{switch(e){case"ctrl":i.ctrl=!0;break;case"shift":i.shift=!0;break;case"meta":i.meta=!0;break;default:e=isNaN(e)?e.toUpperCase().charCodeAt(0):parseInt(e),i.keys.push(e),this.watchKeys[e]||(this.watchKeys[e]=[]),this.watchKeys[e].push(i)}}))}bindEvents(){var e=this;this.keyupBinding=function(t){var i=t.keyCode,s=e.watchKeys[i];s&&(e.pressedKeys.push(i),s.forEach((function(i){e.checkBinding(t,i)})))},this.keydownBinding=function(t){var i=t.keyCode;if(e.watchKeys[i]){var s=e.pressedKeys.indexOf(i);s>-1&&e.pressedKeys.splice(s,1)}},this.table.element.addEventListener("keydown",this.keyupBinding),this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){this.keyupBinding&&this.table.element.removeEventListener("keydown",this.keyupBinding),this.keydownBinding&&this.table.element.removeEventListener("keyup",this.keydownBinding)}checkBinding(e,t){var i=!0;return e.ctrlKey==t.ctrl&&e.shiftKey==t.shift&&e.metaKey==t.meta&&(t.keys.forEach((e=>{-1==this.pressedKeys.indexOf(e)&&(i=!1)})),i&&t.action.call(this,e),!0)}}X.moduleName="keybindings",X.bindings={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35,undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"],copyToClipboard:["ctrl + 67","meta + 89"]},X.actions={keyBlock:function(e){e.stopPropagation(),e.preventDefault()},scrollPageUp:function(e){var t=this.table.rowManager,i=t.scrollTop-t.element.clientHeight;e.preventDefault(),t.displayRowsCount&&(i>=0?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[0])),this.table.element.focus()},scrollPageDown:function(e){var t=this.table.rowManager,i=t.scrollTop+t.element.clientHeight,s=t.element.scrollHeight;e.preventDefault(),t.displayRowsCount&&(i<=s?t.element.scrollTop=i:t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1])),this.table.element.focus()},scrollToStart:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[0]),this.table.element.focus()},scrollToEnd:function(e){var t=this.table.rowManager;e.preventDefault(),t.displayRowsCount&&t.scrollToRow(t.getDisplayRows()[t.displayRowsCount-1]),this.table.element.focus()},navPrev:function(e){this.dispatch("keybinding-nav-prev",e)},navNext:function(e){this.dispatch("keybinding-nav-next",e)},navLeft:function(e){this.dispatch("keybinding-nav-left",e)},navRight:function(e){this.dispatch("keybinding-nav-right",e)},navUp:function(e){this.dispatch("keybinding-nav-up",e)},navDown:function(e){this.dispatch("keybinding-nav-down",e)},undo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.undo()))},redo:function(e){this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")&&(this.table.modules.edit.currentCell||(e.preventDefault(),this.table.modules.history.redo()))},copyToClipboard:function(e){this.table.modules.edit.currentCell||this.table.modExists("clipboard",!0)&&this.table.modules.clipboard.copy(!1,!0)}};class q extends s{constructor(e){super(e),this.menuContainer=null,this.nestedMenuBlock=!1,this.currentComponent=null,this.rootPopup=null,this.columnSubscribers={},this.registerTableOption("menuContainer",void 0),this.registerTableOption("rowContextMenu",!1),this.registerTableOption("rowClickMenu",!1),this.registerTableOption("groupContextMenu",!1),this.registerTableOption("groupClickMenu",!1),this.registerColumnOption("headerContextMenu"),this.registerColumnOption("headerClickMenu"),this.registerColumnOption("headerMenu"),this.registerColumnOption("headerMenuIcon"),this.registerColumnOption("contextMenu"),this.registerColumnOption("clickMenu")}initialize(){this.deprecatedOptionsCheck(),this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheck("menuContainer","popupContainer")||(this.table.options.popupContainer=this.table.options.menuContainer)}initializeRowWatchers(){this.table.options.rowContextMenu&&(this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu)),this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))),this.table.options.rowClickMenu&&this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}initializeGroupWatchers(){this.table.options.groupContextMenu&&(this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu)),this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))),this.table.options.groupClickMenu&&this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}initializeColumn(e){var t=e.definition;t.headerContextMenu&&!this.columnSubscribers.headerContextMenu&&(this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu),this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))),t.headerClickMenu&&!this.columnSubscribers.headerClickMenu&&(this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu"),this.subscribe("column-click",this.columnSubscribers.headerClickMenu)),t.headerMenu&&this.initializeColumnHeaderMenu(e),t.contextMenu&&!this.columnSubscribers.contextMenu&&(this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu),this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))),t.clickMenu&&!this.columnSubscribers.clickMenu&&(this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu"),this.subscribe("cell-click",this.columnSubscribers.clickMenu))}initializeColumnHeaderMenu(e){var t,i=e.definition.headerMenuIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadMenuEvent(e.definition.headerMenu,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadMenuTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadMenuEvent(i.column.definition[e],t,i)}loadMenuTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadMenuEvent(i.definition[e],t,i)}loadMenuEvent(e,t,i){i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent()):e,this.loadMenu(t,i,e)}loadMenu(e,t,i,s,o){var n,r=!(e instanceof MouseEvent),a=document.createElement("div");if(a.classList.add("tabulator-menu"),r||e.preventDefault(),i&&i.length){if(s)n=o.child(a);else{if(this.nestedMenuBlock){if(this.rootPopup)return}else this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=!1}),100);this.rootPopup&&this.rootPopup.hide(),this.rootPopup=n=this.popup(a)}i.forEach((e=>{var i=document.createElement("div"),s=e.label,o=e.disabled;e.separator?i.classList.add("tabulator-menu-separator"):(i.classList.add("tabulator-menu-item"),"function"==typeof s&&(s=s.call(this.table,t.getComponent())),s instanceof Node?i.appendChild(s):i.innerHTML=s,"function"==typeof o&&(o=o.call(this.table,t.getComponent())),o?(i.classList.add("tabulator-menu-item-disabled"),i.addEventListener("click",(e=>{e.stopPropagation()}))):e.menu&&e.menu.length?i.addEventListener("click",(s=>{s.stopPropagation(),this.loadMenu(s,t,e.menu,i,n)})):e.action&&i.addEventListener("click",(i=>{e.action(i,t.getComponent())})),e.menu&&e.menu.length&&i.classList.add("tabulator-menu-item-submenu")),a.appendChild(i)})),a.addEventListener("click",(e=>{this.rootPopup.hide()})),n.show(s||e),n===this.rootPopup&&(this.rootPopup.hideOnBlur((()=>{this.rootPopup=null,this.currentComponent&&(this.dispatchExternal("menuClosed",this.currentComponent.getComponent()),this.currentComponent=null)})),this.currentComponent=t,this.dispatchExternal("menuOpened",t.getComponent()))}}}q.moduleName="menu";class K extends s{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=250,this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.startX=0,this.autoScrollMargin=40,this.autoScrollStep=5,this.autoScrollTimeout=!1,this.touchMove=!1,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.registerTableOption("movableColumns",!1)}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-col"),e.classList.add("tabulator-col-placeholder"),e}initialize(){this.table.options.movableColumns&&this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(e){var i,s=this,o={};e.modules.frozen||e.isGroup||(i=e.getElement(),o.mousemove=function(o){e.parent===s.moving.parent&&((s.touchMove?o.touches[0].pageX:o.pageX)-t.elOffset(i).left+s.table.columnManager.element.scrollLeft>e.getWidth()/2?s.toCol===e&&s.toColAfter||(i.parentNode.insertBefore(s.placeholderElement,i.nextSibling),s.moveColumn(e,!0)):(s.toCol!==e||s.toColAfter)&&(i.parentNode.insertBefore(s.placeholderElement,i),s.moveColumn(e,!1)))}.bind(s),i.addEventListener("mousedown",(function(t){s.touchMove=!1,1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),s.bindTouchEvents(e)),e.modules.moveColumn=o}bindTouchEvents(e){var t,i,s,o,n,r,a=e.getElement(),l=!1;a.addEventListener("touchstart",(a=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,t=e.nextColumn(),s=t?t.getWidth()/2:0,i=e.prevColumn(),o=i?i.getWidth()/2:0,n=0,r=0,l=!1,this.startMove(a,e)}),this.checkPeriod)}),{passive:!0}),a.addEventListener("touchmove",(a=>{var h,d;this.moving&&(this.moveHover(a),l||(l=a.touches[0].pageX),(h=a.touches[0].pageX-l)>0?t&&h-n>s&&(d=t)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveColumn(d,!0)):i&&-h-r>o&&(d=i)!==e&&(l=a.touches[0].pageX,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveColumn(d,!1)),d&&(t=d.nextColumn(),n=s,s=t?t.getWidth()/2:0,i=d.prevColumn(),r=o,o=i?i.getWidth()/2:0))}),{passive:!0}),a.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&this.endMove(e)}))}startMove(e,i){var s=i.getElement(),o=this.table.columnManager.getElement(),n=this.table.columnManager.getHeadersElement();this.moving=i,this.startX=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=i.getWidth()+"px",this.placeholderElement.style.height=i.getHeight()+"px",s.parentNode.insertBefore(this.placeholderElement,s),s.parentNode.removeChild(s),this.hoverElement=s.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.table.columnManager.getElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.bottom=o.clientHeight-n.offsetHeight+"px",this.touchMove||(this._bindMouseMove(),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove)),this.moveHover(e)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveColumn.mousemove)}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(e){e.modules.moveColumn.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveColumn.mousemove)}))}moveColumn(e,t){var i=this.moving.getCells();this.toCol=e,this.toColAfter=t,t?e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s.nextSibling)})):e.getCells().forEach((function(e,t){var s=e.getElement(!0);s.parentNode&&i[t]&&s.parentNode.insertBefore(i[t].getElement(),s)}))}endMove(e){(1===e.which||this.touchMove)&&(this._unbindMouseMove(),this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toCol&&this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter),this.moving=!1,this.toCol=!1,this.toColAfter=!1,this.touchMove||(document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove)))}moveHover(e){var i,s=this.table.columnManager.getElement(),o=s.scrollLeft,n=(this.touchMove?e.touches[0].pageX:e.pageX)-t.elOffset(s).left+o;this.hoverElement.style.left=n-this.startX+"px",n-o{i=Math.max(0,o-5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1))),o+s.clientWidth-n{i=Math.min(s.clientWidth,o+5),this.table.rowManager.getElement().scrollLeft=i,this.autoScrollTimeout=!1}),1)))}}K.moduleName="moveColumn";class J extends s{constructor(e){super(e),this.placeholderElement=this.createPlaceholderElement(),this.hoverElement=!1,this.checkTimeout=!1,this.checkPeriod=150,this.moving=!1,this.toRow=!1,this.toRowAfter=!1,this.hasHandle=!1,this.startY=0,this.startX=0,this.moveHover=this.moveHover.bind(this),this.endMove=this.endMove.bind(this),this.tableRowDropEvent=!1,this.touchMove=!1,this.connection=!1,this.connectionSelectorsTables=!1,this.connectionSelectorsElements=!1,this.connectionElements=[],this.connections=[],this.connectedTable=!1,this.connectedRow=!1,this.registerTableOption("movableRows",!1),this.registerTableOption("movableRowsConnectedTables",!1),this.registerTableOption("movableRowsConnectedElements",!1),this.registerTableOption("movableRowsSender",!1),this.registerTableOption("movableRowsReceiver","insert"),this.registerColumnOption("rowHandle")}createPlaceholderElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e.classList.add("tabulator-row-placeholder"),e}initialize(){this.table.options.movableRows&&(this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables,this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements,this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements,this.subscribe("cell-init",this.initializeCell.bind(this)),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)))}initializeGroupHeader(e){var i=this,s={};s.mouseup=function(t){i.tableRowDrop(t,e)}.bind(i),s.mousemove=function(s){var o;s.pageY-t.elOffset(e.element).top+i.table.rowManager.element.scrollTop>e.getHeight()/2?i.toRow===e&&i.toRowAfter||((o=e.getElement()).parentNode.insertBefore(i.placeholderElement,o.nextSibling),i.moveRow(e,!0)):(i.toRow!==e||i.toRowAfter)&&(o=e.getElement()).previousSibling&&(o.parentNode.insertBefore(i.placeholderElement,o),i.moveRow(e,!1))}.bind(i),e.modules.moveRow=s}initializeRow(e){var i,s=this,o={};o.mouseup=function(t){s.tableRowDrop(t,e)}.bind(s),o.mousemove=function(i){var o=e.getElement();i.pageY-t.elOffset(o).top+s.table.rowManager.element.scrollTop>e.getHeight()/2?s.toRow===e&&s.toRowAfter||(o.parentNode.insertBefore(s.placeholderElement,o.nextSibling),s.moveRow(e,!0)):(s.toRow!==e||s.toRowAfter)&&(o.parentNode.insertBefore(s.placeholderElement,o),s.moveRow(e,!1))}.bind(s),this.hasHandle||((i=e.getElement()).addEventListener("mousedown",(function(t){1===t.which&&(s.checkTimeout=setTimeout((function(){s.startMove(t,e)}),s.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&s.checkTimeout&&clearTimeout(s.checkTimeout)})),this.bindTouchEvents(e,e.getElement())),e.modules.moveRow=o}initializeColumn(e){e.definition.rowHandle&&!1!==this.table.options.movableRows&&(this.hasHandle=!0)}initializeCell(e){if(e.column.definition.rowHandle&&!1!==this.table.options.movableRows){var t=this,i=e.getElement(!0);i.addEventListener("mousedown",(function(i){1===i.which&&(t.checkTimeout=setTimeout((function(){t.startMove(i,e.row)}),t.checkPeriod))})),i.addEventListener("mouseup",(function(e){1===e.which&&t.checkTimeout&&clearTimeout(t.checkTimeout)})),this.bindTouchEvents(e.row,i)}}bindTouchEvents(e,t){var i,s,o,n,r,a,l=!1;t.addEventListener("touchstart",(t=>{this.checkTimeout=setTimeout((()=>{this.touchMove=!0,i=e.nextRow(),o=i?i.getHeight()/2:0,s=e.prevRow(),n=s?s.getHeight()/2:0,r=0,a=0,l=!1,this.startMove(t,e)}),this.checkPeriod)}),{passive:!0}),this.moving,this.toRow,this.toRowAfter,t.addEventListener("touchmove",(t=>{var h,d;this.moving&&(t.preventDefault(),this.moveHover(t),l||(l=t.touches[0].pageY),(h=t.touches[0].pageY-l)>0?i&&h-r>o&&(d=i)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement().nextSibling),this.moveRow(d,!0)):s&&-h-a>n&&(d=s)!==e&&(l=t.touches[0].pageY,d.getElement().parentNode.insertBefore(this.placeholderElement,d.getElement()),this.moveRow(d,!1)),d&&(i=d.nextRow(),r=o,o=i?i.getHeight()/2:0,s=d.prevRow(),a=n,n=s?s.getHeight()/2:0))})),t.addEventListener("touchend",(e=>{this.checkTimeout&&clearTimeout(this.checkTimeout),this.moving&&(this.endMove(e),this.touchMove=!1)}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().addEventListener("mousemove",e.modules.moveRow.mousemove)}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((e=>{("row"===e.type||"group"===e.type)&&e.modules.moveRow&&e.modules.moveRow.mousemove&&e.getElement().removeEventListener("mousemove",e.modules.moveRow.mousemove)}))}startMove(e,t){var i=t.getElement();this.setStartPosition(e,t),this.moving=t,this.table.element.classList.add("tabulator-block-select"),this.placeholderElement.style.width=t.getWidth()+"px",this.placeholderElement.style.height=t.getHeight()+"px",this.connection?(this.table.element.classList.add("tabulator-movingrow-sending"),this.connectToTables(t)):(i.parentNode.insertBefore(this.placeholderElement,i),i.parentNode.removeChild(i)),this.hoverElement=i.cloneNode(!0),this.hoverElement.classList.add("tabulator-moving"),this.connection?(document.body.appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this.hoverElement.style.width=this.table.element.clientWidth+"px",this.hoverElement.style.whiteSpace="nowrap",this.hoverElement.style.overflow="hidden",this.hoverElement.style.pointerEvents="none"):(this.table.rowManager.getTableElement().appendChild(this.hoverElement),this.hoverElement.style.left="0",this.hoverElement.style.top="0",this._bindMouseMove()),document.body.addEventListener("mousemove",this.moveHover),document.body.addEventListener("mouseup",this.endMove),this.dispatchExternal("rowMoving",t.getComponent()),this.moveHover(e)}setStartPosition(e,t){var i,s,o=this.touchMove?e.touches[0].pageX:e.pageX,n=this.touchMove?e.touches[0].pageY:e.pageY;i=t.getElement(),this.connection?(s=i.getBoundingClientRect(),this.startX=s.left-o+window.pageXOffset,this.startY=s.top-n+window.pageYOffset):this.startY=n-i.getBoundingClientRect().top}endMove(e){e&&1!==e.which&&!this.touchMove||(this._unbindMouseMove(),this.connection||(this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling),this.placeholderElement.parentNode.removeChild(this.placeholderElement)),this.hoverElement.parentNode.removeChild(this.hoverElement),this.table.element.classList.remove("tabulator-block-select"),this.toRow?this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter):this.dispatchExternal("rowMoveCancelled",this.moving.getComponent()),this.moving=!1,this.toRow=!1,this.toRowAfter=!1,document.body.removeEventListener("mousemove",this.moveHover),document.body.removeEventListener("mouseup",this.endMove),this.connection&&(this.table.element.classList.remove("tabulator-movingrow-sending"),this.disconnectFromTables()))}moveRow(e,t){this.toRow=e,this.toRowAfter=t}moveHover(e){this.connection?this.moveHoverConnections.call(this,e):this.moveHoverTable.call(this,e)}moveHoverTable(e){var t=this.table.rowManager.getElement(),i=t.scrollTop,s=(this.touchMove?e.touches[0].pageY:e.pageY)-t.getBoundingClientRect().top+i;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(e){this.hoverElement.style.left=this.startX+(this.touchMove?e.touches[0].pageX:e.pageX)+"px",this.hoverElement.style.top=this.startY+(this.touchMove?e.touches[0].pageY:e.pageY)+"px"}elementRowDrop(e,t,i){this.dispatchExternal("movableRowsElementDrop",e,t,!!i&&i.getComponent())}connectToTables(e){var t;this.connectionSelectorsTables&&(t=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStart",t),this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:e})),this.connectionSelectorsElements&&(this.connectionElements=[],Array.isArray(this.connectionSelectorsElements)||(this.connectionSelectorsElements=[this.connectionSelectorsElements]),this.connectionSelectorsElements.forEach((e=>{"string"==typeof e?this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(e))):this.connectionElements.push(e)})),this.connectionElements.forEach((e=>{var t=t=>{this.elementRowDrop(t,e,this.moving)};e.addEventListener("mouseup",t),e.tabulatorElementDropEvent=t,e.classList.add("tabulator-movingrow-receiving")})))}disconnectFromTables(){var e;this.connectionSelectorsTables&&(e=this.commsConnections(this.connectionSelectorsTables),this.dispatchExternal("movableRowsSendingStop",e),this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")),this.connectionElements.forEach((e=>{e.classList.remove("tabulator-movingrow-receiving"),e.removeEventListener("mouseup",e.tabulatorElementDropEvent),delete e.tabulatorElementDropEvent}))}connect(e,t){return this.connectedTable?(console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable),!1):(this.connectedTable=e,this.connectedRow=t,this.table.element.classList.add("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().addEventListener("mouseup",e.modules.moveRow.mouseup)})),this.tableRowDropEvent=this.tableRowDrop.bind(this),this.table.element.addEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStart",t,e),!0)}disconnect(e){e===this.connectedTable?(this.connectedTable=!1,this.connectedRow=!1,this.table.element.classList.remove("tabulator-movingrow-receiving"),this.table.rowManager.getDisplayRows().forEach((e=>{"row"===e.type&&e.modules.moveRow&&e.modules.moveRow.mouseup&&e.getElement().removeEventListener("mouseup",e.modules.moveRow.mouseup)})),this.table.element.removeEventListener("mouseup",this.tableRowDropEvent),this.dispatchExternal("movableRowsReceivingStop",e)):console.warn("Move Row Error - trying to disconnect from non connected table")}dropComplete(e,t,i){var s=!1;if(i){switch(typeof this.table.options.movableRowsSender){case"string":s=this.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender}s?s.call(this,this.moving?this.moving.getComponent():void 0,t?t.getComponent():void 0,e):this.table.options.movableRowsSender&&console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender),this.dispatchExternal("movableRowsSent",this.moving.getComponent(),t?t.getComponent():void 0,e)}else this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),t?t.getComponent():void 0,e);this.endMove()}tableRowDrop(e,t){var i=!1,s=!1;switch(e.stopImmediatePropagation(),typeof this.table.options.movableRowsReceiver){case"string":i=this.receivers[this.table.options.movableRowsReceiver];break;case"function":i=this.table.options.movableRowsReceiver}i?s=i.call(this,this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver),s?this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable):this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),t?t.getComponent():void 0,this.connectedTable),this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:t,success:s})}commsReceived(e,t,i){switch(t){case"connect":return this.connect(e,i.row);case"disconnect":return this.disconnect(e);case"dropcomplete":return this.dropComplete(e,i.row,i.success)}}}J.prototype.receivers={insert:function(e,t,i){return this.table.addRow(e.getData(),void 0,t),!0},add:function(e,t,i){return this.table.addRow(e.getData()),!0},update:function(e,t,i){return!!t&&(t.update(e.getData()),!0)},replace:function(e,t,i){return!!t&&(this.table.addRow(e.getData(),void 0,t),t.delete(),!0)}},J.prototype.senders={delete:function(e,t,i){e.delete()}},J.moduleName="moveRow";class Y extends s{constructor(e){super(e),this.allowedTypes=["","data","edit","clipboard"],this.enabled=!0,this.registerColumnOption("mutator"),this.registerColumnOption("mutatorParams"),this.registerColumnOption("mutatorData"),this.registerColumnOption("mutatorDataParams"),this.registerColumnOption("mutatorEdit"),this.registerColumnOption("mutatorEditParams"),this.registerColumnOption("mutatorClipboard"),this.registerColumnOption("mutatorClipboardParams"),this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this)),this.subscribe("cell-value-changed",this.mutateLink.bind(this)),this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("row-data-init-before",this.rowDataChanged.bind(this)),this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(e,t,i){return this.transformRow(t,"data",i)}initializeColumn(e){var t=!1,i={};this.allowedTypes.forEach((s=>{var o,n="mutator"+(s.charAt(0).toUpperCase()+s.slice(1));e.definition[n]&&(o=this.lookupMutator(e.definition[n]))&&(t=!0,i[n]={mutator:o,params:e.definition[n+"Params"]||{}})})),t&&(e.modules.mutate=i)}lookupMutator(e){var t=!1;switch(typeof e){case"string":Y.mutators[e]?t=Y.mutators[e]:console.warn("Mutator Error - No such mutator found, ignoring: ",e);break;case"function":t=e}return t}transformRow(e,t,i){var s,o="mutator"+(t.charAt(0).toUpperCase()+t.slice(1));return this.enabled&&this.table.columnManager.traverse((n=>{var r,a,l;n.modules.mutate&&(r=n.modules.mutate[o]||n.modules.mutate.mutator||!1)&&(s=n.getFieldValue(void 0!==i?i:e),"data"!=t&&void 0===s||(l=n.getComponent(),a="function"==typeof r.params?r.params(s,e,t,l):r.params,n.setFieldValue(e,r.mutator(s,e,t,a,l))))})),e}transformCell(e,t){if(e.column.modules.mutate){var i=e.column.modules.mutate.mutatorEdit||e.column.modules.mutate.mutator||!1,s={};if(i)return s=Object.assign(s,e.row.getData()),e.column.setFieldValue(s,t),i.mutator(t,s,"edit",i.params,e.getComponent())}return t}mutateLink(e){var t=e.column.definition.mutateLink;t&&(Array.isArray(t)||(t=[t]),t.forEach((t=>{var i=e.row.getCell(t);i&&i.setValue(i.getValue(),!0,!0)})))}enable(){this.enabled=!0}disable(){this.enabled=!1}}Y.moduleName="mutator",Y.mutators={};var $={rows:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),this.table.modules.localize.langBind("pagination|counter|rows",(e=>{d.innerHTML=e})),s?(a.innerHTML=" "+t+"-"+Math.min(t+e-1,s)+" ",h.innerHTML=" "+s+" ",n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d)):(a.innerHTML=" 0 ",n.appendChild(r),n.appendChild(a),n.appendChild(d)),n},pages:function(e,t,i,s,o){var n=document.createElement("span"),r=document.createElement("span"),a=document.createElement("span"),l=document.createElement("span"),h=document.createElement("span"),d=document.createElement("span");return this.table.modules.localize.langBind("pagination|counter|showing",(e=>{r.innerHTML=e})),a.innerHTML=" "+i+" ",this.table.modules.localize.langBind("pagination|counter|of",(e=>{l.innerHTML=e})),h.innerHTML=" "+o+" ",this.table.modules.localize.langBind("pagination|counter|pages",(e=>{d.innerHTML=e})),n.appendChild(r),n.appendChild(a),n.appendChild(l),n.appendChild(h),n.appendChild(d),n}};class Z extends s{constructor(e){super(e),this.mode="local",this.progressiveLoad=!1,this.element=null,this.pageCounterElement=null,this.pageCounter=null,this.size=0,this.page=1,this.count=5,this.max=1,this.remoteRowCountEstimate=null,this.initialLoad=!0,this.dataChanging=!1,this.pageSizes=[],this.registerTableOption("pagination",!1),this.registerTableOption("paginationMode","local"),this.registerTableOption("paginationSize",!1),this.registerTableOption("paginationInitialPage",1),this.registerTableOption("paginationCounter",!1),this.registerTableOption("paginationCounterElement",!1),this.registerTableOption("paginationButtonCount",5),this.registerTableOption("paginationSizeSelector",!1),this.registerTableOption("paginationElement",!1),this.registerTableOption("paginationAddRow","page"),this.registerTableOption("progressiveLoad",!1),this.registerTableOption("progressiveLoadDelay",0),this.registerTableOption("progressiveLoadScrollMargin",0),this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this)),this.registerTableFunction("setPage",this.setPage.bind(this)),this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this)),this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this)),this.registerTableFunction("getPageSize",this.getPageSize.bind(this)),this.registerTableFunction("previousPage",this.previousPage.bind(this)),this.registerTableFunction("nextPage",this.nextPage.bind(this)),this.registerTableFunction("getPage",this.getPage.bind(this)),this.registerTableFunction("getPageMax",this.getPageMax.bind(this)),this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){this.table.options.pagination?(this.subscribe("row-deleted",this.rowsUpdated.bind(this)),this.subscribe("row-added",this.rowsUpdated.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("footer-redraw",this.footerRedraw.bind(this)),"page"==this.table.options.paginationAddRow&&this.subscribe("row-adding-position",this.rowAddingPosition.bind(this)),"remote"===this.table.options.paginationMode&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this))),this.table.options.progressiveLoad&&console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time"),this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40),this.registerDisplayHandler(this.getRows.bind(this),50),this.createElements(),this.initializePageCounter(),this.initializePaginator()):this.table.options.progressiveLoad&&(this.subscribe("data-params",this.remotePageParams.bind(this)),this.subscribe("data-loaded",this._parseRemoteData.bind(this)),this.subscribe("table-built",this.calculatePageSizes.bind(this)),this.subscribe("data-processed",this.initialLoadComplete.bind(this)),this.initializeProgressive(this.table.options.progressiveLoad),"scroll"===this.table.options.progressiveLoad&&this.subscribe("scroll-vertical",this.scrollVertical.bind(this)))}rowAddingPosition(e,t){var i,s=this.table.rowManager,o=s.getDisplayRows();return t?o.length?i=o[0]:s.activeRows.length&&(i=s.activeRows[s.activeRows.length-1],t=!1):o.length&&(i=o[o.length-1],t=!(o.length{}))}restOnRenderBefore(e,t){return t||"local"===this.mode&&this.reset(),e}rowsUpdated(){this.refreshData(!0,"all")}createElements(){var e;this.element=document.createElement("span"),this.element.classList.add("tabulator-paginator"),this.pagesElement=document.createElement("span"),this.pagesElement.classList.add("tabulator-pages"),(e=document.createElement("button")).classList.add("tabulator-page"),e.setAttribute("type","button"),e.setAttribute("role","button"),e.setAttribute("aria-label",""),e.setAttribute("title",""),this.firstBut=e.cloneNode(!0),this.firstBut.setAttribute("data-page","first"),this.prevBut=e.cloneNode(!0),this.prevBut.setAttribute("data-page","prev"),this.nextBut=e.cloneNode(!0),this.nextBut.setAttribute("data-page","next"),this.lastBut=e.cloneNode(!0),this.lastBut.setAttribute("data-page","last"),this.table.options.paginationSizeSelector&&(this.pageSizeSelect=document.createElement("select"),this.pageSizeSelect.classList.add("tabulator-page-size"))}generatePageSizeSelectList(){var e=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector))e=this.table.options.paginationSizeSelector,this.pageSizes=e,-1==this.pageSizes.indexOf(this.size)&&e.unshift(this.size);else if(-1==this.pageSizes.indexOf(this.size)){e=[];for(let t=1;t<5;t++)e.push(this.size*t);this.pageSizes=e}else e=this.pageSizes;for(;this.pageSizeSelect.firstChild;)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);e.forEach((e=>{var t=document.createElement("option");t.value=e,!0===e?this.langBind("pagination|all",(function(e){t.innerHTML=e})):t.innerHTML=e,this.pageSizeSelect.appendChild(t)})),this.pageSizeSelect.value=this.size}}initializePageCounter(){var e=this.table.options.paginationCounter,t=null;e&&((t="function"==typeof e?e:Z.pageCounters[e])?(this.pageCounter=t,this.pageCounterElement=document.createElement("span"),this.pageCounterElement.classList.add("tabulator-page-counter")):console.warn("Pagination Error - No such page counter found: ",e))}initializePaginator(e){var t,i;e||(this.langBind("pagination|first",(e=>{this.firstBut.innerHTML=e})),this.langBind("pagination|first_title",(e=>{this.firstBut.setAttribute("aria-label",e),this.firstBut.setAttribute("title",e)})),this.langBind("pagination|prev",(e=>{this.prevBut.innerHTML=e})),this.langBind("pagination|prev_title",(e=>{this.prevBut.setAttribute("aria-label",e),this.prevBut.setAttribute("title",e)})),this.langBind("pagination|next",(e=>{this.nextBut.innerHTML=e})),this.langBind("pagination|next_title",(e=>{this.nextBut.setAttribute("aria-label",e),this.nextBut.setAttribute("title",e)})),this.langBind("pagination|last",(e=>{this.lastBut.innerHTML=e})),this.langBind("pagination|last_title",(e=>{this.lastBut.setAttribute("aria-label",e),this.lastBut.setAttribute("title",e)})),this.firstBut.addEventListener("click",(()=>{this.setPage(1)})),this.prevBut.addEventListener("click",(()=>{this.previousPage()})),this.nextBut.addEventListener("click",(()=>{this.nextPage()})),this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)})),this.table.options.paginationElement&&(this.element=this.table.options.paginationElement),this.pageSizeSelect&&(t=document.createElement("label"),this.langBind("pagination|page_size",(e=>{this.pageSizeSelect.setAttribute("aria-label",e),this.pageSizeSelect.setAttribute("title",e),t.innerHTML=e})),this.element.appendChild(t),this.element.appendChild(this.pageSizeSelect),this.pageSizeSelect.addEventListener("change",(e=>{this.setPageSize("true"==this.pageSizeSelect.value||this.pageSizeSelect.value),this.setPage(1)}))),this.element.appendChild(this.firstBut),this.element.appendChild(this.prevBut),this.element.appendChild(this.pagesElement),this.element.appendChild(this.nextBut),this.element.appendChild(this.lastBut),this.table.options.paginationElement||(this.table.options.paginationCounter&&(this.table.options.paginationCounterElement?this.table.options.paginationCounterElement instanceof HTMLElement?this.table.options.paginationCounterElement.appendChild(this.pageCounterElement):"string"==typeof this.table.options.paginationCounterElement&&((i=document.querySelector(this.table.options.paginationCounterElement))?i.appendChild(this.pageCounterElement):console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)):this.footerAppend(this.pageCounterElement)),this.footerAppend(this.element)),this.page=this.table.options.paginationInitialPage,this.count=this.table.options.paginationButtonCount),this.mode=this.table.options.paginationMode}initializeProgressive(e){this.initializePaginator(!0),this.mode="progressive_"+e,this.progressiveLoad=!0}trackChanges(){this.dispatch("page-changed")}setMaxRows(e){this.max=e?!0===this.size?1:Math.ceil(e/this.size):1,this.page>this.max&&(this.page=this.max)}reset(e){this.initialLoad||("local"==this.mode||e)&&(this.page=1)}setMaxPage(e){e=parseInt(e),this.max=e||1,this.page>this.max&&(this.page=this.max,this.trigger())}setPage(e){switch(e){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}return(e=parseInt(e))>0&&e<=this.max||"local"!==this.mode?(this.page=e,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",e),Promise.reject())}setPageToRow(e){var t=this.displayRows(-1).indexOf(e);if(t>-1){var i=!0===this.size?1:Math.ceil((t+1)/this.size);return this.setPage(i)}return console.warn("Pagination Error - Requested row is not visible"),Promise.reject()}setPageSize(e){!0!==e&&(e=parseInt(e)),e>0&&(this.size=e,this.dispatchExternal("pageSizeChanged",e)),this.pageSizeSelect&&this.generatePageSizeSelectList(),this.trackChanges()}_setPageCounter(e,t,i){var s;if(this.pageCounter)switch("remote"===this.mode&&(t=this.size,i=(this.page-1)*this.size+1,e=this.remoteRowCountEstimate),typeof(s=this.pageCounter.call(this,t,i,this.page,e,this.max))){case"object":if(s instanceof Node){for(;this.pageCounterElement.firstChild;)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else this.pageCounterElement.innerHTML="",null!=s&&console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s);break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}_setPageButtons(){let e=Math.floor((this.count-1)/2),t=Math.ceil((this.count-1)/2),i=this.max-this.page+e+10&&e<=this.max&&this.pagesElement.appendChild(this._generatePageButton(e));this.footerRedraw()}_generatePageButton(e){var t=document.createElement("button");return t.classList.add("tabulator-page"),e==this.page&&t.classList.add("active"),t.setAttribute("type","button"),t.setAttribute("role","button"),this.langBind("pagination|page_title",(i=>{t.setAttribute("aria-label",i+" "+e),t.setAttribute("title",i+" "+e)})),t.setAttribute("data-page",e),t.textContent=e,t.addEventListener("click",(t=>{this.setPage(e)})),t}previousPage(){return this.page>1?(this.page--,this.trackChanges(),this.trigger()):(console.warn("Pagination Error - Previous page would be less than page 1:",0),Promise.reject())}nextPage(){return this.page"row"===e.type));if("local"==this.mode){t=[],this.setMaxRows(e.length),!0===this.size?(i=0,s=e.length):s=(i=this.size*(this.page-1))+parseInt(this.size),this._setPageButtons();for(let r=i;r{this.dataChanging=!1}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,!0);default:return console.warn("Pagination Error - no such pagination mode:",this.mode),Promise.reject()}}_parseRemoteData(e){var t;if(void 0===e.last_page&&console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property"),e.data){if(this.max=parseInt(e.last_page)||1,this.remoteRowCountEstimate=void 0!==e.last_row?e.last_row:e.last_page*this.size-(this.page==e.last_page?this.size-e.data.length:0),this.progressiveLoad){switch(this.mode){case"progressive_load":1==this.page?this.table.rowManager.setData(e.data,!1,1==this.page):this.table.rowManager.addRows(e.data),this.page{this.nextPage()}),this.table.options.progressiveLoadDelay);break;case"progressive_scroll":e=1===this.page?e.data:this.table.rowManager.getData().concat(e.data),this.table.rowManager.setData(e,1!==this.page,1==this.page),t=this.table.options.progressiveLoadScrollMargin||2*this.table.rowManager.element.clientHeight,this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+t&&this.page{this.nextPage()}))}return!1}this.dispatchExternal("pageLoaded",this.getPage())}else console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property");return e.data}footerRedraw(){var e=this.table.footerManager.containerElement;Math.ceil(e.clientWidth)-e.scrollWidth<0?this.pagesElement.style.display="none":(this.pagesElement.style.display="",Math.ceil(e.clientWidth)-e.scrollWidth<0&&(this.pagesElement.style.display="none"))}}Z.moduleName="page",Z.pageCounters=$;var Q={local:function(e,t){var i=localStorage.getItem(e+"-"+t);return!!i&&JSON.parse(i)},cookie:function(e,t){var i,s,o=document.cookie,n=e+"-"+t,r=o.indexOf(n+"=");return r>-1&&((i=(o=o.slice(r)).indexOf(";"))>-1&&(o=o.slice(0,i)),s=o.replace(n+"=","")),!!s&&JSON.parse(s)}},ee={local:function(e,t,i){localStorage.setItem(e+"-"+t,JSON.stringify(i))},cookie:function(e,t,i){var s=new Date;s.setDate(s.getDate()+1e4),document.cookie=e+"-"+t+"="+JSON.stringify(i)+"; expires="+s.toUTCString()}};class te extends s{constructor(e){super(e),this.mode="",this.id="",this.defWatcherBlock=!1,this.config={},this.readFunc=!1,this.writeFunc=!1,this.registerTableOption("persistence",!1),this.registerTableOption("persistenceID",""),this.registerTableOption("persistenceMode",!0),this.registerTableOption("persistenceReaderFunc",!1),this.registerTableOption("persistenceWriterFunc",!1)}localStorageTest(){var e="_tabulator_test";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return!1}}initialize(){if(this.table.options.persistence){var e,t=this.table.options.persistenceMode,i=this.table.options.persistenceID;this.mode=!0!==t?t:this.localStorageTest()?"local":"cookie",this.table.options.persistenceReaderFunc?"function"==typeof this.table.options.persistenceReaderFunc?this.readFunc=this.table.options.persistenceReaderFunc:te.readers[this.table.options.persistenceReaderFunc]?this.readFunc=te.readers[this.table.options.persistenceReaderFunc]:console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc):te.readers[this.mode]?this.readFunc=te.readers[this.mode]:console.warn("Persistence Read Error - invalid reader set",this.mode),this.table.options.persistenceWriterFunc?"function"==typeof this.table.options.persistenceWriterFunc?this.writeFunc=this.table.options.persistenceWriterFunc:te.writers[this.table.options.persistenceWriterFunc]?this.writeFunc=te.writers[this.table.options.persistenceWriterFunc]:console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc):te.writers[this.mode]?this.writeFunc=te.writers[this.mode]:console.warn("Persistence Write Error - invalid writer set",this.mode),this.id="tabulator-"+(i||this.table.element.getAttribute("id")||""),this.config={sort:!0===this.table.options.persistence||this.table.options.persistence.sort,filter:!0===this.table.options.persistence||this.table.options.persistence.filter,group:!0===this.table.options.persistence||this.table.options.persistence.group,page:!0===this.table.options.persistence||this.table.options.persistence.page,columns:!0===this.table.options.persistence?["title","width","visible"]:this.table.options.persistence.columns},this.config.page&&(e=this.retrieveData("page"))&&(void 0===e.paginationSize||!0!==this.config.page&&!this.config.page.size||(this.table.options.paginationSize=e.paginationSize),void 0===e.paginationInitialPage||!0!==this.config.page&&!this.config.page.page||(this.table.options.paginationInitialPage=e.paginationInitialPage)),this.config.group&&(e=this.retrieveData("group"))&&(void 0===e.groupBy||!0!==this.config.group&&!this.config.group.groupBy||(this.table.options.groupBy=e.groupBy),void 0===e.groupStartOpen||!0!==this.config.group&&!this.config.group.groupStartOpen||(this.table.options.groupStartOpen=e.groupStartOpen),void 0===e.groupHeader||!0!==this.config.group&&!this.config.group.groupHeader||(this.table.options.groupHeader=e.groupHeader)),this.config.columns&&(this.table.options.columns=this.load("columns",this.table.options.columns),this.subscribe("column-init",this.initializeColumn.bind(this)),this.subscribe("column-show",this.save.bind(this,"columns")),this.subscribe("column-hide",this.save.bind(this,"columns")),this.subscribe("column-moved",this.save.bind(this,"columns"))),this.subscribe("table-built",this.tableBuilt.bind(this),0),this.subscribe("table-redraw",this.tableRedraw.bind(this)),this.subscribe("filter-changed",this.eventSave.bind(this,"filter")),this.subscribe("sort-changed",this.eventSave.bind(this,"sort")),this.subscribe("group-changed",this.eventSave.bind(this,"group")),this.subscribe("page-changed",this.eventSave.bind(this,"page")),this.subscribe("column-resized",this.eventSave.bind(this,"columns")),this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this)),this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(e){this.config[e]&&this.save(e)}tableBuilt(){var e,t;this.config.sort&&!1==!(e=this.load("sort"))&&(this.table.options.initialSort=e),this.config.filter&&!1==!(t=this.load("filter"))&&(this.table.options.initialFilter=t)}tableRedraw(e){e&&this.config.columns&&this.save("columns")}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(e){return this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,e)),!0}initializeColumn(e){var t;this.config.columns&&(this.defWatcherBlock=!0,t=e.getDefinition(),(!0===this.config.columns?Object.keys(t):this.config.columns).forEach((e=>{var i=Object.getOwnPropertyDescriptor(t,e),s=t[e];i&&Object.defineProperty(t,e,{set:e=>{s=e,this.defWatcherBlock||this.save("columns"),i.set&&i.set(e)},get:()=>(i.get&&i.get(),s)})})),this.defWatcherBlock=!1)}load(e,t){var i=this.retrieveData(e);return t&&(i=i?this.mergeDefinition(t,i):t),i}retrieveData(e){return!!this.readFunc&&this.readFunc(this.id,e)}mergeDefinition(e,t){var i=[];return(t=t||[]).forEach(((t,s)=>{var o,n=this._findColumn(e,t);n&&(!0===this.config.columns||null==this.config.columns?(o=Object.keys(n)).push("width"):o=this.config.columns,o.forEach((e=>{"columns"!==e&&void 0!==t[e]&&(n[e]=t[e])})),n.columns&&(n.columns=this.mergeDefinition(n.columns,t.columns)),i.push(n))})),e.forEach(((e,s)=>{this._findColumn(t,e)||(i.length>s?i.splice(s,0,e):i.push(e))})),i}_findColumn(e,t){var i=t.columns?"group":t.field?"field":"object";return e.find((function(e){switch(i){case"group":return e.title===t.title&&e.columns.length===t.columns.length;case"field":return e.field===t.field;case"object":return e===t}}))}save(e){var t={};switch(e){case"columns":t=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":t=this.table.modules.filter.getFilters();break;case"sort":t=this.validateSorters(this.table.modules.sort.getSort());break;case"group":t=this.getGroupConfig();break;case"page":t=this.getPageConfig()}this.writeFunc&&this.writeFunc(this.id,e,t)}validateSorters(e){return e.forEach((function(e){e.column=e.field,delete e.field})),e}getGroupConfig(){var e={};return this.config.group&&((!0===this.config.group||this.config.group.groupBy)&&(e.groupBy=this.table.options.groupBy),(!0===this.config.group||this.config.group.groupStartOpen)&&(e.groupStartOpen=this.table.options.groupStartOpen),(!0===this.config.group||this.config.group.groupHeader)&&(e.groupHeader=this.table.options.groupHeader)),e}getPageConfig(){var e={};return this.config.page&&((!0===this.config.page||this.config.page.size)&&(e.paginationSize=this.table.modules.page.getPageSize()),(!0===this.config.page||this.config.page.page)&&(e.paginationInitialPage=this.table.modules.page.getPage())),e}parseColumns(e){var t=[],i=["headerContextMenu","headerMenu","contextMenu","clickMenu"];return e.forEach((e=>{var s,o={},n=e.getDefinition();e.isGroup?(o.title=n.title,o.columns=this.parseColumns(e.getColumns())):(o.field=e.getField(),!0===this.config.columns||null==this.config.columns?((s=Object.keys(n)).push("width"),s.push("visible")):s=this.config.columns,s.forEach((t=>{switch(t){case"width":o.width=e.getWidth();break;case"visible":o.visible=e.visible;break;default:"function"!=typeof n[t]&&-1===i.indexOf(t)&&(o[t]=n[t])}}))),t.push(o)})),t}}te.moduleName="persistence",te.moduleInitOrder=-10,te.readers=Q,te.writers=ee;class ie extends s{constructor(e){super(e),this.columnSubscribers={},this.registerTableOption("rowContextPopup",!1),this.registerTableOption("rowClickPopup",!1),this.registerTableOption("groupContextPopup",!1),this.registerTableOption("groupClickPopup",!1),this.registerColumnOption("headerContextPopup"),this.registerColumnOption("headerClickPopup"),this.registerColumnOption("headerPopup"),this.registerColumnOption("headerPopupIcon"),this.registerColumnOption("contextPopup"),this.registerColumnOption("clickPopup")}initialize(){this.initializeRowWatchers(),this.initializeGroupWatchers(),this.subscribe("column-init",this.initializeColumn.bind(this))}initializeRowWatchers(){this.table.options.rowContextPopup&&(this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup)),this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))),this.table.options.rowClickPopup&&this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}initializeGroupWatchers(){this.table.options.groupContextPopup&&(this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup)),this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))),this.table.options.groupClickPopup&&this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}initializeColumn(e){var t=e.definition;t.headerContextPopup&&!this.columnSubscribers.headerContextPopup&&(this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"),this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup),this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))),t.headerClickPopup&&!this.columnSubscribers.headerClickPopup&&(this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup"),this.subscribe("column-click",this.columnSubscribers.headerClickPopup)),t.headerPopup&&this.initializeColumnHeaderPopup(e),t.contextPopup&&!this.columnSubscribers.contextPopup&&(this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup"),this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup),this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))),t.clickPopup&&!this.columnSubscribers.clickPopup&&(this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup"),this.subscribe("cell-click",this.columnSubscribers.clickPopup))}initializeColumnHeaderPopup(e){var t,i=e.definition.headerPopupIcon;(t=document.createElement("span")).classList.add("tabulator-header-popup-button"),i?("function"==typeof i&&(i=i(e.getComponent())),i instanceof HTMLElement?t.appendChild(i):t.innerHTML=i):t.innerHTML="⋮",t.addEventListener("click",(t=>{t.stopPropagation(),t.preventDefault(),this.loadPopupEvent(e.definition.headerPopup,t,e)})),e.titleElement.insertBefore(t,e.titleElement.firstChild)}loadPopupTableCellEvent(e,t,i){i._cell&&(i=i._cell),i.column.definition[e]&&this.loadPopupEvent(i.column.definition[e],t,i)}loadPopupTableColumnEvent(e,t,i){i._column&&(i=i._column),i.definition[e]&&this.loadPopupEvent(i.definition[e],t,i)}loadPopupEvent(e,t,i){var s;i._group?i=i._group:i._row&&(i=i._row),e="function"==typeof e?e.call(this.table,t,i.getComponent(),(function(e){s=e})):e,this.loadPopup(t,i,e,s)}loadPopup(e,t,i,s){var o,n,r=!(e instanceof MouseEvent);i instanceof HTMLElement?o=i:(o=document.createElement("div")).innerHTML=i,o.classList.add("tabulator-popup"),o.addEventListener("click",(e=>{e.stopPropagation()})),r||e.preventDefault(),n=this.popup(o),"function"==typeof s&&n.renderCallback(s),n.show(e).hideOnBlur((()=>{this.dispatchExternal("popupClosed",t.getComponent())})),this.dispatchExternal("popupOpened",t.getComponent())}}ie.moduleName="popup";class se extends s{constructor(e){super(e),this.element=!1,this.manualBlock=!1,this.registerTableOption("printAsHtml",!1),this.registerTableOption("printFormatter",!1),this.registerTableOption("printHeader",!1),this.registerTableOption("printFooter",!1),this.registerTableOption("printStyled",!0),this.registerTableOption("printRowRange","visible"),this.registerTableOption("printConfig",{}),this.registerColumnOption("print"),this.registerColumnOption("titlePrint")}initialize(){this.table.options.printAsHtml&&(window.addEventListener("beforeprint",this.replaceTable.bind(this)),window.addEventListener("afterprint",this.cleanup.bind(this))),this.registerTableFunction("print",this.printFullscreen.bind(this))}replaceTable(){this.manualBlock||(this.element=document.createElement("div"),this.element.classList.add("tabulator-print-table"),this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print")),this.table.element.style.display="none",this.table.element.parentNode.insertBefore(this.element,this.table.element))}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide"),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.table.element.style.display="")}printFullscreen(e,t,i){var s,o,n=window.scrollX,r=window.scrollY,a=document.createElement("div"),l=document.createElement("div"),h=this.table.modules.export.generateTable(void 0!==i?i:this.table.options.printConfig,void 0!==t?t:this.table.options.printStyled,e||this.table.options.printRowRange,"print");this.manualBlock=!0,this.element=document.createElement("div"),this.element.classList.add("tabulator-print-fullscreen"),this.table.options.printHeader&&(a.classList.add("tabulator-print-header"),"string"==typeof(s="function"==typeof this.table.options.printHeader?this.table.options.printHeader.call(this.table):this.table.options.printHeader)?a.innerHTML=s:a.appendChild(s),this.element.appendChild(a)),this.element.appendChild(h),this.table.options.printFooter&&(l.classList.add("tabulator-print-footer"),"string"==typeof(o="function"==typeof this.table.options.printFooter?this.table.options.printFooter.call(this.table):this.table.options.printFooter)?l.innerHTML=o:l.appendChild(o),this.element.appendChild(l)),document.body.classList.add("tabulator-print-fullscreen-hide"),document.body.appendChild(this.element),this.table.options.printFormatter&&this.table.options.printFormatter(this.element,h),window.print(),this.cleanup(),window.scrollTo(n,r),this.manualBlock=!1}}se.moduleName="print";class oe extends s{constructor(e){super(e),this.data=!1,this.blocked=!1,this.origFuncs={},this.currentVersion=0,this.registerTableOption("reactiveData",!1)}initialize(){this.table.options.reactiveData&&(this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave")),this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave")),this.subscribe("row-data-save-before",this.block.bind(this,"rowsave")),this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave")),this.subscribe("row-data-init-after",this.watchRow.bind(this)),this.subscribe("data-processing",this.watchData.bind(this)),this.subscribe("table-destroy",this.unwatchData.bind(this)))}watchData(e){var t,i=this;this.currentVersion++,t=this.currentVersion,this.unwatchData(),this.data=e,this.origFuncs.push=e.push,Object.defineProperty(this.data,"push",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-push"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!1)})),s=i.origFuncs.push.apply(e,arguments),i.unblock("data-push")),s}}),this.origFuncs.unshift=e.unshift,Object.defineProperty(this.data,"unshift",{enumerable:!1,configurable:!0,value:function(){var s,o=Array.from(arguments);return i.blocked||t!==i.currentVersion||(i.block("data-unshift"),o.forEach((e=>{i.table.rowManager.addRowActual(e,!0)})),s=i.origFuncs.unshift.apply(e,arguments),i.unblock("data-unshift")),s}}),this.origFuncs.shift=e.shift,Object.defineProperty(this.data,"shift",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-shift"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[0]))&&s.deleteActual(),o=i.origFuncs.shift.call(e),i.unblock("data-shift")),o}}),this.origFuncs.pop=e.pop,Object.defineProperty(this.data,"pop",{enumerable:!1,configurable:!0,value:function(){var s,o;return i.blocked||t!==i.currentVersion||(i.block("data-pop"),i.data.length&&(s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]))&&s.deleteActual(),o=i.origFuncs.pop.call(e),i.unblock("data-pop")),o}}),this.origFuncs.splice=e.splice,Object.defineProperty(this.data,"splice",{enumerable:!1,configurable:!0,value:function(){var s,o,n=Array.from(arguments),r=n[0]<0?e.length+n[0]:n[0],a=n[1],l=!!n[2]&&n.slice(2);if(!i.blocked&&t===i.currentVersion){if(i.block("data-splice"),l&&((s=!!e[r]&&i.table.rowManager.getRowFromDataObject(e[r]))?l.forEach((e=>{i.table.rowManager.addRowActual(e,!0,s,!0)})):(l=l.slice().reverse()).forEach((e=>{i.table.rowManager.addRowActual(e,!0,!1,!0)}))),0!==a){var h=e.slice(r,void 0===n[1]?n[1]:r+a);h.forEach(((e,t)=>{var s=i.table.rowManager.getRowFromDataObject(e);s&&s.deleteActual(t!==h.length-1)}))}(l||0!==a)&&i.table.rowManager.reRenderInPosition(),o=i.origFuncs.splice.apply(e,arguments),i.unblock("data-splice")}return o}})}unwatchData(){if(!1!==this.data)for(var e in this.origFuncs)Object.defineProperty(this.data,e,{enumerable:!0,configurable:!0,writable:!0,value:this.origFuncs.key})}watchRow(e){var t=e.getData();for(var i in t)this.watchKey(e,t,i);this.table.options.dataTree&&this.watchTreeChildren(e)}watchTreeChildren(e){var t=this,i=e.getData()[this.table.options.dataTreeChildField],s={};i&&(s.push=i.push,Object.defineProperty(i,"push",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-push");var o=s.push.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-push")}return o}}),s.unshift=i.unshift,Object.defineProperty(i,"unshift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-unshift");var o=s.unshift.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-unshift")}return o}}),s.shift=i.shift,Object.defineProperty(i,"shift",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-shift");var o=s.shift.call(i);this.rebuildTree(e),t.unblock("tree-shift")}return o}}),s.pop=i.pop,Object.defineProperty(i,"pop",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-pop");var o=s.pop.call(i);this.rebuildTree(e),t.unblock("tree-pop")}return o}}),s.splice=i.splice,Object.defineProperty(i,"splice",{enumerable:!1,configurable:!0,value:()=>{if(!t.blocked){t.block("tree-splice");var o=s.splice.apply(i,arguments);this.rebuildTree(e),t.unblock("tree-splice")}return o}}))}rebuildTree(e){this.table.modules.dataTree.initializeRow(e),this.table.modules.dataTree.layoutRow(e),this.table.rowManager.refreshActiveData("tree",!1,!0)}watchKey(e,t,i){var s=this,o=Object.getOwnPropertyDescriptor(t,i),n=t[i],r=this.currentVersion;Object.defineProperty(t,i,{set:t=>{if(n=t,!s.blocked&&r===s.currentVersion){s.block("key");var a={};a[i]=t,e.updateData(a),s.unblock("key")}o.set&&o.set(t)},get:()=>(o.get&&o.get(),n)})}unwatchRow(e){var t=e.getData();for(var i in t)Object.defineProperty(t,i,{value:t[i]})}block(e){this.blocked||(this.blocked=e)}unblock(e){this.blocked===e&&(this.blocked=!1)}}oe.moduleName="reactiveData";class ne extends s{constructor(e){super(e),this.startColumn=!1,this.startX=!1,this.startWidth=!1,this.latestX=!1,this.handle=null,this.initialNextColumn=null,this.nextColumn=null,this.initialized=!1,this.registerColumnOption("resizable",!0),this.registerTableOption("resizableColumnFit",!1)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){this.initialized||(this.subscribe("cell-rendered",this.layoutCellHandles.bind(this)),this.subscribe("cell-delete",this.deInitializeComponent.bind(this)),this.subscribe("cell-height",this.resizeHandle.bind(this)),this.subscribe("column-moved",this.columnLayoutUpdated.bind(this)),this.subscribe("column-hide",this.deInitializeColumn.bind(this)),this.subscribe("column-show",this.columnLayoutUpdated.bind(this)),this.subscribe("column-width",this.columnWidthUpdated.bind(this)),this.subscribe("column-delete",this.deInitializeComponent.bind(this)),this.subscribe("column-height",this.resizeHandle.bind(this)),this.initialized=!0)}layoutCellHandles(e){"row"===e.row.type&&(this.deInitializeComponent(e),this.initializeColumn("cell",e,e.column,e.element))}layoutColumnHeader(e){e.definition.resizable&&(this.initializeEventWatchers(),this.deInitializeComponent(e),this.initializeColumn("header",e,e,e.element))}columnLayoutUpdated(e){var t=e.prevColumn();this.reinitializeColumn(e),t&&this.reinitializeColumn(t)}columnWidthUpdated(e){e.modules.frozen&&(this.table.modules.frozenColumns.leftColumns.includes(e)?this.table.modules.frozenColumns.leftColumns.forEach((e=>{this.reinitializeColumn(e)})):this.table.modules.frozenColumns.rightColumns.includes(e)&&this.table.modules.frozenColumns.rightColumns.forEach((e=>{this.reinitializeColumn(e)})))}reinitializeColumn(e){var t=!!e.modules.frozen&&e.modules.frozen.marginValue+e.getWidth()+"px";e.cells.forEach((e=>{e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))})),e.modules.resize&&e.modules.resize.handleEl&&(t&&(e.modules.resize.handleEl.style.left=t),e.element.after(e.modules.resize.handleEl))}initializeColumn(e,t,i,s){var o=this,n=i.definition.resizable,r={},a=i.getLastColumn();if("header"===e&&(r={variableHeight:"textarea"==i.definition.formatter||i.definition.variableHeight}),(!0===n||n==e)&&this._checkResizability(a)){var l=document.createElement("span");l.className="tabulator-col-resize-handle",l.addEventListener("click",(function(e){e.stopPropagation()}));var h=function(e){o.startColumn=i,o.initialNextColumn=o.nextColumn=a.nextColumn(),o._mouseDown(e,a,l)};l.addEventListener("mousedown",h),l.addEventListener("touchstart",h,{passive:!0}),l.addEventListener("dblclick",(e=>{var t=a.getWidth();e.stopPropagation(),a.reinitializeWidth(!0),t!==a.getWidth()&&(o.dispatch("column-resized",a),o.table.externalEvents.dispatch("columnResized",a.getComponent()))})),i.modules.frozen&&(l.style.position="absolute",l.style.left=i.modules.frozen.marginValue+i.getWidth()+"px"),r.handleEl=l,s.parentNode&&i.visible&&s.after(l)}t.modules.resize=r}deInitializeColumn(e){this.deInitializeComponent(e),e.cells.forEach((e=>{this.deInitializeComponent(e)}))}deInitializeComponent(e){var t;e.modules.resize&&(t=e.modules.resize.handleEl)&&t.parentElement&&t.parentElement.removeChild(t)}resizeHandle(e,t){e.modules.resize&&e.modules.resize.handleEl&&(e.modules.resize.handleEl.style.height=t)}_checkResizability(e){return e.definition.resizable}_mouseDown(e,t,i){var s=this;function o(e){var i,o,n=void 0===e.screenX?e.touches[0].screenX:e.screenX,r=n-s.startX,a=n-s.latestX;if(s.latestX=n,s.table.rtl&&(r=-r,a=-a),i=t.width==t.minWidth||t.width==t.maxWidth,t.setWidth(s.startWidth+r),o=t.width==t.minWidth||t.width==t.maxWidth,a<0&&(s.nextColumn=s.initialNextColumn),s.table.options.resizableColumnFit&&s.nextColumn&&(!i||!o)){let e=s.nextColumn.getWidth();a>0&&e<=s.nextColumn.minWidth&&(s.nextColumn=s.nextColumn.nextColumn()),s.nextColumn&&s.nextColumn.setWidth(s.nextColumn.getWidth()-a)}s.table.columnManager.rerenderColumns(!0),!s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights()}function n(e){s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!1),s.table.browserSlow&&t.modules.resize&&t.modules.resize.variableHeight&&t.checkCellHeights(),document.body.removeEventListener("mouseup",n),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.startWidth!==t.getWidth()&&(s.dispatch("column-resized",t),s.table.externalEvents.dispatch("columnResized",t.getComponent()))}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startColumn.modules.edit&&(s.startColumn.modules.edit.blocked=!0),s.startX=void 0===e.screenX?e.touches[0].screenX:e.screenX,s.latestX=s.startX,s.startWidth=t.getWidth(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}ne.moduleName="resizeColumns";class re extends s{constructor(e){super(e),this.startColumn=!1,this.startY=!1,this.startHeight=!1,this.handle=null,this.prevHandle=null,this.registerTableOption("resizableRows",!1)}initialize(){this.table.options.resizableRows&&this.subscribe("row-layout-after",this.initializeRow.bind(this))}initializeRow(e){var t=this,i=e.getElement(),s=document.createElement("div");s.className="tabulator-row-resize-handle";var o=document.createElement("div");o.className="tabulator-row-resize-handle prev",s.addEventListener("click",(function(e){e.stopPropagation()}));var n=function(i){t.startRow=e,t._mouseDown(i,e,s)};s.addEventListener("mousedown",n),s.addEventListener("touchstart",n,{passive:!0}),o.addEventListener("click",(function(e){e.stopPropagation()}));var r=function(i){var s=t.table.rowManager.prevDisplayRow(e);s&&(t.startRow=s,t._mouseDown(i,s,o))};o.addEventListener("mousedown",r),o.addEventListener("touchstart",r,{passive:!0}),i.appendChild(s),i.appendChild(o)}_mouseDown(e,t,i){var s=this;function o(e){t.setHeight(s.startHeight+((void 0===e.screenY?e.touches[0].screenY:e.screenY)-s.startY))}function n(e){document.body.removeEventListener("mouseup",o),document.body.removeEventListener("mousemove",o),i.removeEventListener("touchmove",o),i.removeEventListener("touchend",n),s.table.element.classList.remove("tabulator-block-select"),s.dispatchExternal("rowResized",t.getComponent())}s.table.element.classList.add("tabulator-block-select"),e.stopPropagation(),s.startY=void 0===e.screenY?e.touches[0].screenY:e.screenY,s.startHeight=t.getHeight(),document.body.addEventListener("mousemove",o),document.body.addEventListener("mouseup",n),i.addEventListener("touchmove",o,{passive:!0}),i.addEventListener("touchend",n)}}re.moduleName="resizeRows";class ae extends s{constructor(e){super(e),this.binding=!1,this.visibilityObserver=!1,this.resizeObserver=!1,this.containerObserver=!1,this.tableHeight=0,this.tableWidth=0,this.containerHeight=0,this.containerWidth=0,this.autoResize=!1,this.visible=!1,this.initialized=!1,this.initialRedraw=!1,this.registerTableOption("autoResize",!0)}initialize(){if(this.table.options.autoResize){var e,t=this.table;this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof ResizeObserver&&"virtual"===t.rowManager.getRenderMode()?(this.initializeVisibilityObserver(),this.autoResize=!0,this.resizeObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.tableHeight==i&&this.tableWidth==s||(this.tableHeight=i,this.tableWidth=s,t.element.parentNode&&(this.containerHeight=t.element.parentNode.clientHeight,this.containerWidth=t.element.parentNode.clientWidth),this.redrawTable())}})),this.resizeObserver.observe(t.element),e=window.getComputedStyle(t.element),this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(e.getPropertyValue("max-height")||e.getPropertyValue("min-height"))&&(this.containerObserver=new ResizeObserver((e=>{if(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell){var i=Math.floor(e[0].contentRect.height),s=Math.floor(e[0].contentRect.width);this.containerHeight==i&&this.containerWidth==s||(this.containerHeight=i,this.containerWidth=s,this.tableHeight=t.element.clientHeight,this.tableWidth=t.element.clientWidth),this.redrawTable()}})),this.containerObserver.observe(this.table.element.parentNode)),this.subscribe("table-resize",this.tableResized.bind(this))):(this.binding=function(){(!t.browserMobile||t.browserMobile&&!t.modules.edit.currentCell)&&(t.columnManager.rerenderColumns(!0),t.redraw())},window.addEventListener("resize",this.binding)),this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver((e=>{this.visible=e[0].isIntersecting,this.initialized||(this.initialized=!0,this.initialRedraw=!this.visible),this.visible&&(this.redrawTable(this.initialRedraw),this.initialRedraw=!1)})),this.visibilityObserver.observe(this.table.element)}redrawTable(e){this.initialized&&this.visible&&(this.table.columnManager.rerenderColumns(!0),this.table.redraw(e))}tableResized(){this.table.rowManager.redraw()}clearBindings(){this.binding&&window.removeEventListener("resize",this.binding),this.resizeObserver&&this.resizeObserver.unobserve(this.table.element),this.visibilityObserver&&this.visibilityObserver.unobserve(this.table.element),this.containerObserver&&this.containerObserver.unobserve(this.table.element.parentNode)}}ae.moduleName="resizeTable";class le extends s{constructor(e){super(e),this.columns=[],this.hiddenColumns=[],this.mode="",this.index=0,this.collapseFormatter=[],this.collapseStartOpen=!0,this.collapseHandleColumn=!1,this.registerTableOption("responsiveLayout",!1),this.registerTableOption("responsiveLayoutCollapseStartOpen",!0),this.registerTableOption("responsiveLayoutCollapseUseFormatters",!0),this.registerTableOption("responsiveLayoutCollapseFormatter",!1),this.registerColumnOption("responsive")}initialize(){this.table.options.responsiveLayout&&(this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("column-show",this.updateColumnVisibility.bind(this)),this.subscribe("column-hide",this.updateColumnVisibility.bind(this)),this.subscribe("columns-loaded",this.initializeResponsivity.bind(this)),this.subscribe("column-moved",this.initializeResponsivity.bind(this)),this.subscribe("column-add",this.initializeResponsivity.bind(this)),this.subscribe("column-delete",this.initializeResponsivity.bind(this)),this.subscribe("table-redrawing",this.tableRedraw.bind(this)),"collapse"===this.table.options.responsiveLayout&&(this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this)),this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-layout",this.layoutRow.bind(this))))}tableRedraw(e){-1===["fitColumns","fitDataStretch"].indexOf(this.layoutMode())&&(e||this.update())}initializeResponsivity(){var e=[];this.mode=this.table.options.responsiveLayout,this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData,this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen,this.hiddenColumns=[],this.table.columnManager.columnsByIndex.forEach(((t,i)=>{t.modules.responsive&&t.modules.responsive.order&&t.modules.responsive.visible&&(t.modules.responsive.index=i,e.push(t),t.visible||"collapse"!==this.mode||this.hiddenColumns.push(t))})),e=(e=e.reverse()).sort(((e,t)=>t.modules.responsive.order-e.modules.responsive.order||t.modules.responsive.index-e.modules.responsive.index)),this.columns=e,"collapse"===this.mode&&this.generateCollapsedContent();for(let e of this.table.columnManager.columnsByIndex)if("responsiveCollapse"==e.definition.formatter){this.collapseHandleColumn=e;break}this.collapseHandleColumn&&(this.hiddenColumns.length?this.collapseHandleColumn.show():this.collapseHandleColumn.hide())}initializeColumn(e){var t=e.getDefinition();e.modules.responsive={order:void 0===t.responsive?1:t.responsive,visible:!1!==t.visible}}initializeRow(e){var t;"calc"!==e.type&&((t=document.createElement("div")).classList.add("tabulator-responsive-collapse"),e.modules.responsiveLayout={element:t,open:this.collapseStartOpen},this.collapseStartOpen||(t.style.display="none"))}layoutRow(e){var t=e.getElement();e.modules.responsiveLayout&&(t.appendChild(e.modules.responsiveLayout.element),this.generateCollapsedRowContent(e))}updateColumnVisibility(e,t){!t&&e.modules.responsive&&(e.modules.responsive.visible=e.visible,this.initializeResponsivity())}hideColumn(e){var t=this.hiddenColumns.length;e.hide(!1,!0),"collapse"===this.mode&&(this.hiddenColumns.unshift(e),this.generateCollapsedContent(),this.collapseHandleColumn&&!t&&this.collapseHandleColumn.show())}showColumn(e){var t;e.show(!1,!0),e.setWidth(e.getWidth()),"collapse"===this.mode&&((t=this.hiddenColumns.indexOf(e))>-1&&this.hiddenColumns.splice(t,1),this.generateCollapsedContent(),this.collapseHandleColumn&&!this.hiddenColumns.length&&this.collapseHandleColumn.hide())}update(){for(var e=this,t=!0;t;){let i="fitColumns"==e.table.modules.layout.getMode()?e.table.columnManager.getFlexBaseWidth():e.table.columnManager.getWidth(),s=(e.table.options.headerVisible?e.table.columnManager.element.clientWidth:e.table.element.clientWidth)-i;if(s<0){let i=e.columns[e.index];i?(e.hideColumn(i),e.index++):t=!1}else{let i=e.columns[e.index-1];i&&s>0&&s>=i.getWidth()?(e.showColumn(i),e.index--):t=!1}e.table.rowManager.activeRowsCount||e.table.rowManager.renderEmptyScroll()}}generateCollapsedContent(){var e=this;this.table.rowManager.getDisplayRows().forEach((function(t){e.generateCollapsedRowContent(t)}))}generateCollapsedRowContent(e){var t,i;if(e.modules.responsiveLayout){for(t=e.modules.responsiveLayout.element;t.firstChild;)t.removeChild(t.firstChild);(i=this.collapseFormatter(this.generateCollapsedRowData(e)))&&t.appendChild(i)}}generateCollapsedRowData(e){var t,i=this,s=e.getData(),o=[];return this.hiddenColumns.forEach((function(n){var r=n.getFieldValue(s);if(n.definition.title&&n.field)if(n.modules.format&&i.table.options.responsiveLayoutCollapseUseFormatters){t={value:!1,data:{},getValue:function(){return r},getData:function(){return s},getElement:function(){return document.createElement("div")},getRow:function(){return e.getComponent()},getColumn:function(){return n.getComponent()}},o.push({field:n.field,title:n.definition.title,value:n.modules.format.formatter.call(i.table.modules.format,t,n.modules.format.params,(function(e){e()}))})}else o.push({field:n.field,title:n.definition.title,value:r})})),o}formatCollapsedData(e){var t=document.createElement("table");return e.forEach((function(e){var i,s=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("td"),r=document.createElement("strong");o.appendChild(r),this.langBind("columns|"+e.field,(function(t){r.innerHTML=t||e.title})),e.value instanceof Node?((i=document.createElement("div")).appendChild(e.value),n.appendChild(i)):n.innerHTML=e.value,s.appendChild(o),s.appendChild(n),t.appendChild(s)}),this),Object.keys(e).length?t:""}}le.moduleName="responsiveLayout";class he extends s{constructor(e){super(e),this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],this.headerCheckboxElement=null,this.registerTableOption("selectable","highlight"),this.registerTableOption("selectableRangeMode","drag"),this.registerTableOption("selectableRollingSelection",!0),this.registerTableOption("selectablePersistence",!0),this.registerTableOption("selectableCheck",(function(e,t){return!0})),this.registerTableFunction("selectRow",this.selectRows.bind(this)),this.registerTableFunction("deselectRow",this.deselectRows.bind(this)),this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this)),this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this)),this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this)),this.registerComponentFunction("row","select",this.selectRows.bind(this)),this.registerComponentFunction("row","deselect",this.deselectRows.bind(this)),this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this)),this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){!1!==this.table.options.selectable&&(this.subscribe("row-init",this.initializeRow.bind(this)),this.subscribe("row-deleting",this.rowDeleted.bind(this)),this.subscribe("rows-wipe",this.clearSelectionData.bind(this)),this.subscribe("rows-retrieve",this.rowRetrieve.bind(this)),this.table.options.selectable&&!this.table.options.selectablePersistence&&this.subscribe("data-refreshing",this.deselectRows.bind(this)))}rowRetrieve(e,t){return"selected"===e?this.selectedRows:t}rowDeleted(e){this._deselectRow(e,!0)}clearSelectionData(e){this.selecting=!1,this.lastClickedRow=!1,this.selectPrev=[],this.selectedRows=[],!0!==e&&this._rowSelectionChanged()}initializeRow(e){var t=this,i=e.getElement(),s=function(){setTimeout((function(){t.selecting=!1}),50),document.body.removeEventListener("mouseup",s)};e.modules.select={selected:!1},t.table.options.selectableCheck.call(this.table,e.getComponent())?(i.classList.add("tabulator-selectable"),i.classList.remove("tabulator-unselectable"),t.table.options.selectable&&"highlight"!=t.table.options.selectable&&("click"===t.table.options.selectableRangeMode?i.addEventListener("click",this.handleComplexRowClick.bind(this,e)):(i.addEventListener("click",(function(i){t.table.modExists("edit")&&t.table.modules.edit.getCurrentCell()||t.table._clearSelection(),t.selecting||t.toggleRow(e)})),i.addEventListener("mousedown",(function(i){if(i.shiftKey)return t.table._clearSelection(),t.selecting=!0,t.selectPrev=[],document.body.addEventListener("mouseup",s),document.body.addEventListener("keyup",s),t.toggleRow(e),!1})),i.addEventListener("mouseenter",(function(i){t.selecting&&(t.table._clearSelection(),t.toggleRow(e),t.selectPrev[1]==e&&t.toggleRow(t.selectPrev[0]))})),i.addEventListener("mouseout",(function(i){t.selecting&&(t.table._clearSelection(),t.selectPrev.unshift(e))}))))):(i.classList.add("tabulator-unselectable"),i.classList.remove("tabulator-selectable"))}handleComplexRowClick(e,t){if(t.shiftKey){this.table._clearSelection(),this.lastClickedRow=this.lastClickedRow||e;var i=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow),s=this.table.rowManager.getDisplayRowIndex(e),o=i<=s?i:s,n=i>=s?i:s,r=this.table.rowManager.getDisplayRows().slice(0).splice(o,n-o+1);t.ctrlKey||t.metaKey?(r.forEach((t=>{t!==this.lastClickedRow&&(!0===this.table.options.selectable||this.isRowSelected(e)||this.selectedRows.lengththis.table.options.selectable&&(r=r.slice(0,this.table.options.selectable)),this.selectRows(r)),this.table._clearSelection()}else t.ctrlKey||t.metaKey?(this.toggleRow(e),this.lastClickedRow=e):(this.deselectRows(void 0,!0),this.selectRows(e),this.lastClickedRow=e)}toggleRow(e){this.table.options.selectableCheck.call(this.table,e.getComponent())&&(e.modules.select&&e.modules.select.selected?this._deselectRow(e):this._selectRow(e))}selectRows(e){var t;switch(typeof e){case"undefined":this.table.rowManager.rows.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged();break;case"string":(t=this.table.rowManager.findRow(e))?(this._selectRow(t,!0,!0),this._rowSelectionChanged()):((t=this.table.rowManager.getRows(e)).forEach((e=>{this._selectRow(e,!0,!0)})),t.length&&this._rowSelectionChanged());break;default:Array.isArray(e)?(e.forEach((e=>{this._selectRow(e,!0,!0)})),this._rowSelectionChanged()):this._selectRow(e,!1,!0)}}_selectRow(e,t,i){if(!isNaN(this.table.options.selectable)&&!0!==this.table.options.selectable&&!i&&this.selectedRows.length>=this.table.options.selectable){if(!this.table.options.selectableRollingSelection)return!1;this._deselectRow(this.selectedRows[0])}var s=this.table.rowManager.findRow(e);s?-1==this.selectedRows.indexOf(s)&&(s.getElement().classList.add("tabulator-selected"),s.modules.select||(s.modules.select={}),s.modules.select.selected=!0,s.modules.select.checkboxEl&&(s.modules.select.checkboxEl.checked=!0),this.selectedRows.push(s),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(s,!0),this.dispatchExternal("rowSelected",s.getComponent()),this._rowSelectionChanged(t)):t||console.warn("Selection Error - No such row found, ignoring selection:"+e)}isRowSelected(e){return-1!==this.selectedRows.indexOf(e)}deselectRows(e,t){var i,s=this;if(void 0===e){i=s.selectedRows.length;for(let e=0;e-1&&(o.getElement().classList.remove("tabulator-selected"),o.modules.select||(o.modules.select={}),o.modules.select.selected=!1,o.modules.select.checkboxEl&&(o.modules.select.checkboxEl.checked=!1),s.selectedRows.splice(i,1),this.table.options.dataTreeSelectPropagate&&this.childRowSelection(o,!1),this.dispatchExternal("rowDeselected",o.getComponent()),s._rowSelectionChanged(t)):t||console.warn("Deselection Error - No such row found, ignoring selection:"+e)}getSelectedData(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getData())})),e}getSelectedRows(){var e=[];return this.selectedRows.forEach((function(t){e.push(t.getComponent())})),e}_rowSelectionChanged(e){this.headerCheckboxElement&&(0===this.selectedRows.length?(this.headerCheckboxElement.checked=!1,this.headerCheckboxElement.indeterminate=!1):this.table.rowManager.rows.length===this.selectedRows.length?(this.headerCheckboxElement.checked=!0,this.headerCheckboxElement.indeterminate=!1):(this.headerCheckboxElement.indeterminate=!0,this.headerCheckboxElement.checked=!1)),e||this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows())}registerRowSelectCheckbox(e,t){e._row.modules.select||(e._row.modules.select={}),e._row.modules.select.checkboxEl=t}registerHeaderSelectCheckbox(e){this.headerCheckboxElement=e}childRowSelection(e,t){var i=this.table.modules.dataTree.getChildren(e,!0);if(t)for(let e of i)this._selectRow(e,!0);else for(let e of i)this._deselectRow(e,!0)}}function de(e,t,i,s,o,n,r){var a=window.DateTime||luxon.DateTime,l=r.format||"dd/MM/yyyy HH:mm:ss",h=r.alignEmptyValues,d=0;if(void 0!==a){if(a.isDateTime(e)||(e="iso"===l?a.fromISO(String(e)):a.fromFormat(String(e),l)),a.isDateTime(t)||(t="iso"===l?a.fromISO(String(t)):a.fromFormat(String(t),l)),e.isValid){if(t.isValid)return e-t;d=1}else d=t.isValid?-1:0;return("top"===h&&"desc"===n||"bottom"===h&&"asc"===n)&&(d*=-1),d}console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}he.moduleName="selectRow";var ce={number:function(e,t,i,s,o,n,r){var a=r.alignEmptyValues,l=r.decimalSeparator,h=r.thousandSeparator,d=0;if(e=String(e),t=String(t),h&&(e=e.split(h).join(""),t=t.split(h).join("")),l&&(e=e.split(l).join("."),t=t.split(l).join(".")),e=parseFloat(e),t=parseFloat(t),isNaN(e))d=isNaN(t)?0:-1;else{if(!isNaN(t))return e-t;d=1}return("top"===a&&"desc"===n||"bottom"===a&&"asc"===n)&&(d*=-1),d},string:function(e,t,i,s,o,n,r){var a,l=r.alignEmptyValues,h=0;if(e){if(t){switch(typeof r.locale){case"boolean":r.locale&&(a=this.langLocale());break;case"string":a=r.locale}return String(e).toLowerCase().localeCompare(String(t).toLowerCase(),a)}h=1}else h=t?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},date:function(e,t,i,s,o,n,r){return r.format||(r.format="dd/MM/yyyy"),de.call(this,e,t,i,s,o,n,r)},time:function(e,t,i,s,o,n,r){return r.format||(r.format="HH:mm"),de.call(this,e,t,i,s,o,n,r)},datetime:de,boolean:function(e,t,i,s,o,n,r){return(!0===e||"true"===e||"True"===e||1===e?1:0)-(!0===t||"true"===t||"True"===t||1===t?1:0)},array:function(e,t,i,s,o,n,r){var a=r.type||"length",l=r.alignEmptyValues,h=0;function d(e){var t;switch(a){case"length":t=e.length;break;case"sum":t=e.reduce((function(e,t){return e+t}));break;case"max":t=Math.max.apply(null,e);break;case"min":t=Math.min.apply(null,e);break;case"avg":t=e.reduce((function(e,t){return e+t}))/e.length}return t}if(Array.isArray(e)){if(Array.isArray(t))return d(t)-d(e);h=1}else h=Array.isArray(t)?-1:0;return("top"===l&&"desc"===n||"bottom"===l&&"asc"===n)&&(h*=-1),h},exists:function(e,t,i,s,o,n,r){return(void 0===e?0:1)-(void 0===t?0:1)},alphanum:function(e,t,i,s,o,n,r){var a,l,h,d,c,u=0,m=/(\d+)|(\D+)/g,p=/\d/,g=r.alignEmptyValues,b=0;if(e||0===e){if(t||0===t){if(isFinite(e)&&isFinite(t))return e-t;if((a=String(e).toLowerCase())===(l=String(t).toLowerCase()))return 0;if(!p.test(a)||!p.test(l))return a>l?1:-1;for(a=a.match(m),l=l.match(m),c=a.length>l.length?l.length:a.length;ud?1:-1;return a.length>l.length}b=1}else b=t||0===t?-1:0;return("top"===g&&"desc"===n||"bottom"===g&&"asc"===n)&&(b*=-1),b}};class ue extends s{constructor(e){super(e),this.sortList=[],this.changed=!1,this.registerTableOption("sortMode","local"),this.registerTableOption("initialSort",!1),this.registerTableOption("columnHeaderSortMulti",!0),this.registerTableOption("sortOrderReverse",!1),this.registerTableOption("headerSortElement","
"),this.registerColumnOption("sorter"),this.registerColumnOption("sorterParams"),this.registerColumnOption("headerSort",!0),this.registerColumnOption("headerSortStartingDir"),this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this)),this.subscribe("table-built",this.tableBuilt.bind(this)),this.registerDataHandler(this.sort.bind(this),20),this.registerTableFunction("setSort",this.userSetSort.bind(this)),this.registerTableFunction("getSorters",this.getSort.bind(this)),this.registerTableFunction("clearSort",this.clearSort.bind(this)),"remote"===this.table.options.sortMode&&this.subscribe("data-params",this.remoteSortParams.bind(this))}tableBuilt(){this.table.options.initialSort&&this.setSort(this.table.options.initialSort)}remoteSortParams(e,t,i,s){var o=this.getSort();return o.forEach((e=>{delete e.column})),s.sort=o,s}userSetSort(e,t){this.setSort(e,t),this.refreshSort()}clearSort(){this.clear(),this.refreshSort()}initializeColumn(e){var t,i,s=!1;switch(typeof e.definition.sorter){case"string":ue.sorters[e.definition.sorter]?s=ue.sorters[e.definition.sorter]:console.warn("Sort Error - No such sorter found: ",e.definition.sorter);break;case"function":s=e.definition.sorter}if(e.modules.sort={sorter:s,dir:"none",params:e.definition.sorterParams||{},startingDir:e.definition.headerSortStartingDir||"asc",tristate:e.definition.headerSortTristate},!1!==e.definition.headerSort){switch((t=e.getElement()).classList.add("tabulator-sortable"),(i=document.createElement("div")).classList.add("tabulator-col-sorter"),this.table.options.headerSortElement){case"function":break;case"object":i.appendChild(this.table.options.headerSortElement);break;default:i.innerHTML=this.table.options.headerSortElement}e.titleHolderElement.appendChild(i),e.modules.sort.element=i,this.setColumnHeaderSortIcon(e,"none"),t.addEventListener("click",(t=>{var i="",s=[],o=!1;if(e.modules.sort){if(e.modules.sort.tristate)i="none"==e.modules.sort.dir?e.modules.sort.startingDir:e.modules.sort.dir==e.modules.sort.startingDir?"asc"==e.modules.sort.dir?"desc":"asc":"none";else switch(e.modules.sort.dir){case"asc":i="desc";break;case"desc":i="asc";break;default:i=e.modules.sort.startingDir}this.table.options.columnHeaderSortMulti&&(t.shiftKey||t.ctrlKey)?((o=(s=this.getSort()).findIndex((t=>t.field===e.getField())))>-1?(s[o].dir=i,o=s.splice(o,1)[0],"none"!=i&&s.push(o)):"none"!=i&&s.push({column:e,dir:i}),this.setSort(s)):"none"==i?this.clear():this.setSort(e,i),this.refreshSort()}}))}}refreshSort(){"remote"===this.table.options.sortMode?this.reloadData(null,!1,!1):this.refreshData(!0)}hasChanged(){var e=this.changed;return this.changed=!1,e}getSort(){var e=[];return this.sortList.forEach((function(t){t.column&&e.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})})),e}setSort(e,t){var i=this,s=[];Array.isArray(e)||(e=[{column:e,dir:t}]),e.forEach((function(e){var t;(t=i.table.columnManager.findColumn(e.column))?(e.column=t,s.push(e),i.changed=!0):console.warn("Sort Warning - Sort field does not exist and is being ignored: ",e.column)})),i.sortList=s,this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(e){var t,i=this.table.rowManager.activeRows[0],s="string";if(i&&(i=i.getData(),e.getField()))switch(typeof(t=e.getFieldValue(i))){case"undefined":s="string";break;case"boolean":s="boolean";break;default:isNaN(t)||""===t?t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)&&(s="alphanum"):s="number"}return ue.sorters[s]}sort(e){var t=this,i=this.table.options.sortOrderReverse?t.sortList.slice().reverse():t.sortList,s=[],o=[];return this.subscribedExternal("dataSorting")&&this.dispatchExternal("dataSorting",t.getSort()),t.clearColumnHeaders(),"remote"!==this.table.options.sortMode?(i.forEach((function(e,i){var o;e.column&&((o=e.column.modules.sort)&&(o.sorter||(o.sorter=t.findSorter(e.column)),e.params="function"==typeof o.params?o.params(e.column.getComponent(),e.dir):o.params,s.push(e)),t.setColumnHeader(e.column,e.dir))})),s.length&&t._sortItems(e,s)):i.forEach((function(e,i){t.setColumnHeader(e.column,e.dir)})),this.subscribedExternal("dataSorted")&&(e.forEach((e=>{o.push(e.getComponent())})),this.dispatchExternal("dataSorted",t.getSort(),o)),e}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((e=>{e.modules.sort&&(e.modules.sort.dir="none",e.getElement().setAttribute("aria-sort","none"),this.setColumnHeaderSortIcon(e,"none"))}))}setColumnHeader(e,t){e.modules.sort.dir=t,e.getElement().setAttribute("aria-sort","asc"===t?"ascending":"descending"),this.setColumnHeaderSortIcon(e,t)}setColumnHeaderSortIcon(e,t){var i,s=e.modules.sort.element;if(e.definition.headerSort&&"function"==typeof this.table.options.headerSortElement){for(;s.firstChild;)s.removeChild(s.firstChild);"object"==typeof(i=this.table.options.headerSortElement.call(this.table,e.getComponent(),t))?s.appendChild(i):s.innerHTML=i}}_sortItems(e,t){var i=t.length-1;e.sort(((e,s)=>{for(var o,n=i;n>=0;n--){let i=t[n];if(0!==(o=this._sortRow(e,s,i.column,i.dir,i.params)))break}return o}))}_sortRow(e,t,i,s,o){var n,r,a="asc"==s?e:t,l="asc"==s?t:e;return e=void 0!==(e=i.getFieldValue(a.getData()))?e:"",t=void 0!==(t=i.getFieldValue(l.getData()))?t:"",n=a.getComponent(),r=l.getComponent(),i.modules.sort.sorter.call(this,e,t,n,r,i.getComponent(),s,o)}}ue.moduleName="sort",ue.sorters=ce;class me extends s{constructor(e){super(e),this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null,this.popupInstance=null,this.registerTableOption("tooltipGenerationMode",void 0),this.registerTableOption("tooltipDelay",300),this.registerColumnOption("tooltip"),this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck(),this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){this.deprecationCheckMsg("tooltipGenerationMode","This option is no longer needed as tooltips are always generated on hover now")}initializeColumn(e){e.definition.headerTooltip&&!this.headerSubscriber&&(this.headerSubscriber=!0,this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip")),this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))),e.definition.tooltip&&!this.tooltipSubscriber&&(this.tooltipSubscriber=!0,this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip")),this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip")))}mousemoveCheck(e,t,i){var s="tooltip"===e?i.column.definition.tooltip:i.definition.headerTooltip;s&&(this.clearPopup(),this.timeout=setTimeout(this.loadTooltip.bind(this,t,i,s),this.table.options.tooltipDelay))}mouseoutCheck(e,t,i){this.popupInstance||this.clearPopup()}clearPopup(e,t,i){clearTimeout(this.timeout),this.timeout=null,this.popupInstance&&this.popupInstance.hide()}loadTooltip(e,t,i){var s,o,n;"function"==typeof i&&(i=i(e,t.getComponent(),(function(e){o=e}))),i instanceof HTMLElement?s=i:(s=document.createElement("div"),!0===i&&(t instanceof p?i=t.value:t.definition.field?this.langBind("columns|"+t.definition.field,(e=>{s.innerHTML=i=e||t.definition.title})):i=t.definition.title),s.innerHTML=i),(i||0===i||!1===i)&&(s.classList.add("tabulator-tooltip"),s.addEventListener("mousemove",(e=>e.preventDefault())),this.popupInstance=this.popup(s),"function"==typeof o&&this.popupInstance.renderCallback(o),n=this.popupInstance.containerEventCoords(e),this.popupInstance.show(n.x+15,n.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",t.getComponent()),this.popupInstance=null})),this.dispatchExternal("TooltipOpened",t.getComponent()))}}me.moduleName="tooltip";var pe={integer:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&Math.floor(t)===t)},float:function(e,t,i){return""===t||null==t||(t=Number(t),!isNaN(t)&&isFinite(t)&&t%1!=0)},numeric:function(e,t,i){return""===t||null==t||!isNaN(t)},string:function(e,t,i){return""===t||null==t||isNaN(t)},max:function(e,t,i){return""===t||null==t||parseFloat(t)<=i},min:function(e,t,i){return""===t||null==t||parseFloat(t)>=i},starts:function(e,t,i){return""===t||null==t||String(t).toLowerCase().startsWith(String(i).toLowerCase())},ends:function(e,t,i){return""===t||null==t||String(t).toLowerCase().endsWith(String(i).toLowerCase())},minLength:function(e,t,i){return""===t||null==t||String(t).length>=i},maxLength:function(e,t,i){return""===t||null==t||String(t).length<=i},in:function(e,t,i){return""===t||null==t||("string"==typeof i&&(i=i.split("|")),i.indexOf(t)>-1)},regex:function(e,t,i){return""===t||null==t||new RegExp(i).test(t)},unique:function(e,t,i){if(""===t||null==t)return!0;var s=!0,o=e.getData(),n=e.getColumn()._getSelf();return this.table.rowManager.rows.forEach((function(e){var i=e.getData();i!==o&&t==n.getFieldValue(i)&&(s=!1)})),s},required:function(e,t,i){return""!==t&&null!=t}};class ge extends s{constructor(e){super(e),this.invalidCells=[],this.registerTableOption("validationMode","blocking"),this.registerColumnOption("validator"),this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this)),this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this)),this.registerTableFunction("validate",this.userValidate.bind(this)),this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this)),this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this)),this.registerComponentFunction("cell","validate",this.cellValidate.bind(this)),this.registerComponentFunction("column","validate",this.columnValidate.bind(this)),this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this)),this.subscribe("column-layout",this.initializeColumnCheck.bind(this)),this.subscribe("edit-success",this.editValidate.bind(this)),this.subscribe("edit-editor-clear",this.editorClear.bind(this)),this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(e,t,i){var s="manual"===this.table.options.validationMode||this.validate(e.column.modules.validate,e,t);return!0!==s&&setTimeout((()=>{e.getElement().classList.add("tabulator-validation-fail"),this.dispatchExternal("validationFailed",e.getComponent(),t,s)})),s}editorClear(e,t){t&&e.column.modules.validate&&this.cellValidate(e),e.getElement().classList.remove("tabulator-validation-fail")}editedClear(e){e.modules.validate&&(e.modules.validate.invalid=!1)}cellIsValid(e){return e.modules.validate&&e.modules.validate.invalid||!0}cellValidate(e){return this.validate(e.column.modules.validate,e,e.getValue())}columnValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}rowValidate(e){var t=[];return e.cells.forEach((e=>{!0!==this.cellValidate(e)&&t.push(e.getComponent())})),!t.length||t}userClearCellValidation(e){e||(e=this.getInvalidCells()),Array.isArray(e)||(e=[e]),e.forEach((e=>{this.clearValidation(e._getSelf())}))}userValidate(e){var t=[];return this.table.rowManager.rows.forEach((e=>{var i=(e=e.getComponent()).validate();!0!==i&&(t=t.concat(i))})),!t.length||t}initializeColumnCheck(e){void 0!==e.definition.validator&&this.initializeColumn(e)}initializeColumn(e){var t,i=this,s=[];e.definition.validator&&(Array.isArray(e.definition.validator)?e.definition.validator.forEach((e=>{(t=i._extractValidator(e))&&s.push(t)})):(t=this._extractValidator(e.definition.validator))&&s.push(t),e.modules.validate=!!s.length&&s)}_extractValidator(e){var t,i,s;switch(typeof e){case"string":return(s=e.indexOf(":"))>-1?(t=e.substring(0,s),i=e.substring(s+1)):t=e,this._buildValidator(t,i);case"function":return this._buildValidator(e);case"object":return this._buildValidator(e.type,e.parameters)}}_buildValidator(e,t){var i="function"==typeof e?e:ge.validators[e];return i?{type:"function"==typeof e?"function":e,func:i,params:t}:(console.warn("Validator Setup Error - No matching validator found:",e),!1)}validate(e,t,i){var s=this,o=[],n=this.invalidCells.indexOf(t);return e&&e.forEach((e=>{e.func.call(s,t.getComponent(),i,e.params)||o.push({type:e.type,parameters:e.params})})),t.modules.validate||(t.modules.validate={}),o.length?(t.modules.validate.invalid=o,"manual"!==this.table.options.validationMode&&t.getElement().classList.add("tabulator-validation-fail"),-1==n&&this.invalidCells.push(t)):(t.modules.validate.invalid=!1,t.getElement().classList.remove("tabulator-validation-fail"),n>-1&&this.invalidCells.splice(n,1)),!o.length||o}getInvalidCells(){var e=[];return this.invalidCells.forEach((t=>{e.push(t.getComponent())})),e}clearValidation(e){var t;e.modules.validate&&e.modules.validate.invalid&&(e.getElement().classList.remove("tabulator-validation-fail"),e.modules.validate.invalid=!1,(t=this.invalidCells.indexOf(e))>-1&&this.invalidCells.splice(t,1))}}ge.moduleName="validate",ge.validators=pe;var be=Object.freeze({__proto__:null,AccessorModule:o,AjaxModule:d,ClipboardModule:c,ColumnCalcsModule:E,DataTreeModule:y,DownloadModule:x,EditModule:k,ExportModule:P,FilterModule:F,FormatModule:A,FrozenColumnsModule:_,FrozenRowsModule:O,GroupRowsModule:V,HistoryModule:N,HtmlTableImportModule:W,ImportModule:G,InteractionModule:U,KeybindingsModule:X,MenuModule:q,MoveColumnsModule:K,MoveRowsModule:J,MutatorModule:Y,PageModule:Z,PersistenceModule:te,PopupModule:ie,PrintModule:se,ReactiveDataModule:oe,ResizeColumnsModule:ne,ResizeRowsModule:re,ResizeTableModule:ae,ResponsiveLayoutModule:le,SelectRowModule:he,SortModule:ue,TooltipModule:me,ValidateModule:ge});class fe{constructor(e,t,i={}){this.table=e,this.msgType=t,this.registeredDefaults=Object.assign({},i)}register(e,t){this.registeredDefaults[e]=t}generate(e,t={}){var i=Object.assign({},this.registeredDefaults);if(Object.assign(i,e),!1!==t.debugInvalidOptions||this.table.options.debugInvalidOptions)for(let e in t)i.hasOwnProperty(e)||console.warn("Invalid "+this.msgType+" option:",e);for(let e in i)e in t?i[e]=t[e]:Array.isArray(i[e])?i[e]=Object.assign([],i[e]):"object"==typeof i[e]&&null!==i[e]?i[e]=Object.assign({},i[e]):void 0===i[e]&&delete i[e];return i}}class ve extends e{constructor(e){super(e),this.elementVertical=e.rowManager.element,this.elementHorizontal=e.columnManager.element,this.tableElement=e.rowManager.tableElement,this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(e){}renderRows(){}renderColumns(){}rerenderRows(e){e&&e()}rerenderColumns(e,t){}renderRowCells(e){}rerenderRowCells(e,t){}scrollColumns(e,t){}scrollRows(e,t){}resize(){}scrollToRow(e){}scrollToRowNearestTop(e){}visibleRows(e){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}clear(){this.clearRows(),this.clearColumns()}render(){this.renderRows(),this.renderColumns()}rerender(e){this.rerenderRows(),this.rerenderColumns()}scrollToRowPosition(e,i,s){var o=this.rows().indexOf(e),n=e.getElement(),r=0;return new Promise(((a,l)=>{if(o>-1){if(void 0===s&&(s=this.table.options.scrollToRowIfVisible),!s&&t.elVisible(n)&&(r=t.elOffset(n).top-t.elOffset(this.elementVertical).top)>0&&r{e.element.appendChild(t.getElement()),t.cellRendered()}))}reinitializeColumnWidths(e){e.forEach((function(e){e.reinitializeWidth()}))}}class Ce extends ve{constructor(e){super(e),this.leftCol=0,this.rightCol=0,this.scrollLeft=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0,this.fitDataColAvg=0,this.windowBuffer=200,this.visibleRows=null,this.initialized=!1,this.isFitData=!1,this.columns=[]}initialize(){this.compatibilityCheck(),this.layoutCheck(),this.vertScrollListen()}compatibilityCheck(){var e=this.options("columns"),t=!0;return"fitDataTable"==this.options("layout")&&(console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode"),t=!1),this.options("responsiveLayout")&&(console.warn("Horizontal Virtual DOM is not compatible with responsive columns"),t=!1),this.options("rtl")&&(console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction"),t=!1),e&&e.find((e=>e.frozen))&&(console.warn("Horizontal Virtual DOM is not compatible with frozen columns"),t=!1),t}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this)),this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(e,t){this.dataChange()}scrollColumns(e,t){this.scrollLeft!=e&&(this.scrollLeft=e,this.scroll(e-(this.vDomScrollPosLeft+this.windowBuffer)))}calcWindowBuffer(){var e=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((t=>{if(t.visible){var i=t.getWidth();i>e&&(e=i)}})),this.windowBuffer=2*e}rerenderColumns(e,t){var i={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;e&&!this.initialized||(this.clear(),this.calcWindowBuffer(),this.scrollLeft=this.elementVertical.scrollLeft,this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer,this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,this.table.columnManager.columnsByIndex.forEach((e=>{var t={};if(e.visible){var i=e.getWidth();t.leftPos=s,t.rightPos=s+i,t.width=i,this.isFitData&&(t.fitDataCheck=!e.modules.vdomHoz||e.modules.vdomHoz.fitDataCheck),s+i>this.vDomScrollPosLeft&&s{e.element.appendChild(t.getElement()),t.cellRendered()}))}rerenderRowCells(e,t){this.reinitializeRow(e,t)}reinitializeColumnWidths(e){for(let e=this.leftCol;e<=this.rightCol;e++)this.columns[e].reinitializeWidth()}deinitialize(){this.initialized=!1}clear(){this.columns=[],this.leftCol=-1,this.rightCol=0,this.vDomScrollPosLeft=0,this.vDomScrollPosRight=0,this.vDomPadLeft=0,this.vDomPadRight=0}dataChange(){var e,t,i=!1;if(this.isFitData){if(this.table.columnManager.columnsByIndex.forEach((e=>{!e.definition.width&&e.visible&&(i=!0)})),i&&this.table.rowManager.getDisplayRows().length&&(this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer,e=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0])){t=e.getElement(),e.generateCells(),this.tableElement.appendChild(t);for(let i=0;i{e!==this.columns[i]&&(t=!1)})),!t)}reinitializeRows(){this.getVisibleRows().forEach((e=>{this.reinitializeRow(e,!0)}))}getVisibleRows(){return this.visibleRows||(this.visibleRows=this.table.rowManager.getVisibleRows()),this.visibleRows}scroll(e){this.vDomScrollPosLeft+=e,this.vDomScrollPosRight+=e,Math.abs(e)>this.windowBuffer/2?this.rerenderColumns():e>0?(this.addColRight(),this.removeColLeft()):(this.addColLeft(),this.removeColRight())}colPositionAdjust(e,t,i){for(let s=e;s{if("group"!==e.type){var t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}})),this.fitDataColActualWidthCheck(i),this.rightCol++,this.rightCol>=this.columns.length-1?this.vDomPadRight=0:this.vDomPadRight-=i.getWidth()):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}addColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol-1];if(i)if(i.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);e.getElement().prepend(t.getElement()),t.cellRendered()}})),this.leftCol--,this.leftCol<=0?this.vDomPadLeft=0:this.vDomPadLeft-=i.getWidth();let t=this.fitDataColActualWidthCheck(i);t&&(this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+t,this.vDomPadRight-=t)}else t=!1;else t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}removeColRight(){for(var e=!1,t=!0;t;){let i=this.columns[this.rightCol];i&&i.modules.vdomHoz.leftPos>this.vDomScrollPosRight?(e=!0,this.getVisibleRows().forEach((e=>{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColRight",e.message)}}})),this.vDomPadRight+=i.getWidth(),this.rightCol--):t=!1}e&&(this.tableElement.style.paddingRight=this.vDomPadRight+"px")}removeColLeft(){for(var e=!1,t=!0;t;){let i=this.columns[this.leftCol];i&&i.modules.vdomHoz.rightPos{if("group"!==e.type){var t=e.getCell(i);try{e.getElement().removeChild(t.getElement())}catch(e){console.warn("Could not removeColLeft",e.message)}}})),this.vDomPadLeft+=i.getWidth(),this.leftCol++):t=!1}e&&(this.tableElement.style.paddingLeft=this.vDomPadLeft+"px")}fitDataColActualWidthCheck(e){var t,i;return e.modules.vdomHoz.fitDataCheck&&(e.reinitializeWidth(),(i=(t=e.getWidth())-e.modules.vdomHoz.width)&&(e.modules.vdomHoz.rightPos+=i,e.modules.vdomHoz.width=t,this.colPositionAdjust(this.columns.indexOf(e)+1,this.columns.length,i)),e.modules.vdomHoz.fitDataCheck=!1),i}initializeRow(e){if("group"!==e.type){e.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};for(let t=this.leftCol;t<=this.rightCol;t++){let i=this.columns[t];if(i&&i.visible){let t=e.getCell(i);e.getElement().appendChild(t.getElement()),t.cellRendered()}}}}reinitializeRow(e,t){if("group"!==e.type&&(t||!e.modules.vdomHoz||e.modules.vdomHoz.leftCol!==this.leftCol||e.modules.vdomHoz.rightCol!==this.rightCol)){for(var i=e.getElement();i.firstChild;)i.removeChild(i.firstChild);this.initializeRow(e)}}}class Ee extends e{constructor(e){super(e),this.blockHozScrollEvent=!1,this.headersElement=null,this.element=null,this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.scrollLeft=0,this.optionsList=new fe(this.table,"column definition",b),this.redrawBlock=!1,this.redrawBlockUpdate=null,this.renderer=null}initialize(){this.initializeRenderer(),this.headersElement=this.createHeadersElement(),this.element=this.createHeaderElement(),this.element.insertBefore(this.headersElement,this.element.firstChild),this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this))}initializeRenderer(){var e,t={virtual:Ce,basic:we};(e="string"==typeof this.table.options.renderHorizontal?t[this.table.options.renderHorizontal]:this.table.options.renderHorizontal)?(this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize()):console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}createHeadersElement(){var e=document.createElement("div");return e.classList.add("tabulator-headers"),e.setAttribute("role","row"),e}createHeaderElement(){var e=document.createElement("div");return e.classList.add("tabulator-header"),e.setAttribute("role","rowgroup"),this.table.options.headerVisible||e.classList.add("tabulator-header-hidden"),e}getElement(){return this.element}getHeadersElement(){return this.headersElement}scrollHorizontal(e){var t=0,i=this.element.scrollWidth-this.table.element.clientWidth;this.element.scrollLeft=e,e>i?(t=e-i,this.element.style.marginLeft=-t+"px"):this.element.style.marginLeft=0,this.scrollLeft=e,this.renderer.scrollColumns(e)}generateColumnsFromRowData(e){var t,i,s=[],o=this.table.options.autoColumnsDefinitions;if(e&&e.length){for(var n in t=e[0]){let e={field:n,title:n},o=t[n];switch(typeof o){case"undefined":i="string";break;case"boolean":i="boolean";break;case"object":i=Array.isArray(o)?"array":"string";break;default:i=isNaN(o)||""===o?o.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)?"alphanum":"string":"number"}e.sorter=i,s.push(e)}if(o)switch(typeof o){case"function":this.table.options.columns=o.call(this.table,s);break;case"object":Array.isArray(o)?s.forEach((e=>{var t=o.find((t=>t.field===e.field));t&&Object.assign(e,t)})):s.forEach((e=>{o[e.field]&&Object.assign(e,o[e.field])})),this.table.options.columns=s}else this.table.options.columns=s;this.setColumns(this.table.options.columns)}}setColumns(e,t){for(;this.headersElement.firstChild;)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[],this.columnsByIndex=[],this.columnsByField={},this.dispatch("columns-loading"),e.forEach(((e,t)=>{this._addColumn(e)})),this._reIndexColumns(),this.dispatch("columns-loaded"),this.rerenderColumns(!1,!0),this.redraw(!0)}_addColumn(e,t,i){var s=new f(e,this),o=s.getElement(),n=i?this.findColumnIndex(i):i;if(i&&n>-1){var r=i.getTopColumn(),a=this.columns.indexOf(r),l=r.getElement();t?(this.columns.splice(a,0,s),l.parentNode.insertBefore(o,l)):(this.columns.splice(a+1,0,s),l.parentNode.insertBefore(o,l.nextSibling))}else t?(this.columns.unshift(s),this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)):(this.columns.push(s),this.headersElement.appendChild(s.getElement()));return s.columnRendered(),s}registerColumnField(e){e.definition.field&&(this.columnsByField[e.definition.field]=e)}registerColumnPosition(e){this.columnsByIndex.push(e)}_reIndexColumns(){this.columnsByIndex=[],this.columns.forEach((function(e){e.reRegisterPosition()}))}verticalAlignHeaders(){var e=0;this.redrawBlock||(this.headersElement.style.height="",this.columns.forEach((e=>{e.clearVerticalAlign()})),this.columns.forEach((t=>{var i=t.getHeight();i>e&&(e=i)})),this.headersElement.style.height=e+"px",this.columns.forEach((t=>{t.verticalAlign(this.table.options.columnHeaderVertAlign,e)})),this.table.rowManager.adjustTableSize())}findColumn(e){var t;if("object"!=typeof e)return this.columnsByField[e]||!1;if(e instanceof f)return e;if(e instanceof g)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return t=[],this.columns.forEach((e=>{t.push(e),t=t.concat(e.getColumns(!0))})),t.find((t=>t.element===e))||!1}return!1}getColumnByField(e){return this.columnsByField[e]}getColumnsByFieldRoot(e){var t=[];return Object.keys(this.columnsByField).forEach((i=>{i.split(".")[0]===e&&t.push(this.columnsByField[i])})),t}getColumnByIndex(e){return this.columnsByIndex[e]}getFirstVisibleColumn(){var e=this.columnsByIndex.findIndex((e=>e.visible));return e>-1&&this.columnsByIndex[e]}getColumns(){return this.columns}findColumnIndex(e){return this.columnsByIndex.findIndex((t=>e===t))}getRealColumns(){return this.columnsByIndex}traverse(e){this.columnsByIndex.forEach(((t,i)=>{e(t,i)}))}getDefinitions(e){var t=[];return this.columnsByIndex.forEach((i=>{(!e||e&&i.visible)&&t.push(i.getDefinition())})),t}getDefinitionTree(){var e=[];return this.columns.forEach((t=>{e.push(t.getDefinition(!0))})),e}getComponents(e){var t=[];return(e?this.columns:this.columnsByIndex).forEach((e=>{t.push(e.getComponent())})),t}getWidth(){var e=0;return this.columnsByIndex.forEach((t=>{t.visible&&(e+=t.getWidth())})),e}moveColumn(e,t,i){t.element.parentNode.insertBefore(e.element,t.element),i&&t.element.parentNode.insertBefore(t.element,e.element),this.moveColumnActual(e,t,i),this.verticalAlignHeaders(),this.table.rowManager.reinitialize()}moveColumnActual(e,t,i){e.parent.isGroup?this._moveColumnInArray(e.parent.columns,e,t,i):this._moveColumnInArray(this.columns,e,t,i),this._moveColumnInArray(this.columnsByIndex,e,t,i,!0),this.rerenderColumns(!0),this.dispatch("column-moved",e,t,i),this.subscribedExternal("columnMoved")&&this.dispatchExternal("columnMoved",e.getComponent(),this.table.columnManager.getComponents())}_moveColumnInArray(e,t,i,s,o){var n,r=e.indexOf(t);r>-1&&(e.splice(r,1),(n=e.indexOf(i))>-1?s&&(n+=1):n=r,e.splice(n,0,t),o&&(this.chain("column-moving-rows",[t,i,s],null,[])||[]).concat(this.table.rowManager.rows).forEach((function(e){if(e.cells.length){var t=e.cells.splice(r,1)[0];e.cells.splice(n,0,t)}})))}scrollToColumn(e,t,i){var s=0,o=0,n=0,r=e.getElement();return new Promise(((a,l)=>{if(void 0===t&&(t=this.table.options.scrollToColumnPosition),void 0===i&&(i=this.table.options.scrollToColumnIfVisible),e.visible){switch(t){case"middle":case"center":n=-this.element.clientWidth/2;break;case"right":n=r.clientWidth-this.headersElement.clientWidth}if(!i&&(o=r.offsetLeft)>0&&o+r.offsetWidth{t.push(i.generateCell(e))})),t}getFlexBaseWidth(){var e=this.table.element.clientWidth,t=0;return this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight&&(e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),this.columnsByIndex.forEach((function(i){var s,o,n;i.visible&&(s=i.definition.width||0,o=parseInt(i.minWidth),n="string"==typeof s?s.indexOf("%")>-1?e/100*parseInt(s):parseInt(s):s,t+=n>o?n:o)})),t}addColumn(e,t,i){return new Promise(((s,o)=>{var n=this._addColumn(e,t,i);this._reIndexColumns(),this.dispatch("column-add",e,t,i),"fitColumns"!=this.layoutMode()&&n.reinitializeWidth(),this.redraw(!0),this.table.rowManager.reinitialize(),this.rerenderColumns(),s(n)}))}deregisterColumn(e){var t,i=e.getField();i&&delete this.columnsByField[i],(t=this.columnsByIndex.indexOf(e))>-1&&this.columnsByIndex.splice(t,1),(t=this.columns.indexOf(e))>-1&&this.columns.splice(t,1),this.verticalAlignHeaders(),this.redraw()}rerenderColumns(e,t){this.redrawBlock?(!1===e||!0===e&&null===this.redrawBlockUpdate)&&(this.redrawBlockUpdate=e):this.renderer.rerenderColumns(e,t)}blockRedraw(){this.redrawBlock=!0,this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=!1,this.verticalAlignHeaders(),this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(e){t.elVisible(this.element)&&this.verticalAlignHeaders(),e&&(this.table.rowManager.resetScroll(),this.table.rowManager.reinitialize()),this.confirm("table-redrawing",e)||this.layoutRefresh(e),this.dispatch("table-redraw",e),this.table.footerManager.redraw()}}class ye extends ve{constructor(e){super(e),this.verticalFillMode="fill",this.scrollTop=0,this.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.scrollTop=0,e.scrollLeft=0,e.style.minWidth="",e.style.minHeight="",e.style.display="",e.style.visibility=""}renderRows(){var e=this.tableElement,t=!0;this.rows().forEach(((i,s)=>{this.styleRow(i,s),e.appendChild(i.getElement()),i.initialize(!0),"group"!==i.type&&(t=!1)})),e.style.minWidth=t?this.table.columnManager.getWidth()+"px":""}rerenderRows(e){this.clearRows(),this.renderRows(),e&&e()}scrollToRowNearestTop(e){var i=t.elOffset(e.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(e){var i=e.getElement();this.elementVertical.scrollTop=t.elOffset(i).top-t.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(e){return this.rows()}}class Re extends ve{constructor(e){super(e),this.verticalFillMode="fill",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=[]}clearRows(){for(var e=this.tableElement;e.firstChild;)e.removeChild(e.firstChild);e.style.paddingTop="",e.style.paddingBottom="",e.style.minHeight="",e.style.display="",e.style.visibility="",this.elementVertical.scrollTop=0,this.elementVertical.scrollLeft=0,this.scrollTop=0,this.scrollLeft=0,this.vDomTop=0,this.vDomBottom=0,this.vDomTopPad=0,this.vDomBottomPad=0,this.vDomScrollPosTop=0,this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(e){for(var t=this.elementVertical.scrollTop,i=!1,s=!1,o=this.table.rowManager.scrollLeft,n=this.rows(),r=this.vDomTop;r<=this.vDomBottom;r++)if(n[r]){var a=t-n[r].getElement().offsetTop;if(!(!1===s||Math.abs(a){e.deinitializeHeight()})),e&&e(),this.rows().length?this._virtualRenderFill(!1===i?this.rows.length-1:i,!0,s||0):(this.clear(),this.table.rowManager._showPlaceholder()),this.scrollColumns(o)}scrollColumns(e){this.table.rowManager.scrollHorizontal(e)}scrollRows(e,t){var i=e-this.vDomScrollPosTop,s=e-this.vDomScrollPosBottom,o=2*this.vDomWindowBuffer,n=this.rows();if(this.scrollTop=e,-i>o||s>o){var r=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*n.length)),this.scrollColumns(r)}else t?(i<0&&this._addTopRow(n,-i),s<0&&(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer?this._removeBottomRow(n,-s):this.vDomScrollPosBottom=this.scrollTop)):(s>=0&&this._addBottomRow(n,s),i>=0&&(this.scrollTop>this.vDomWindowBuffer?this._removeTopRow(n,i):this.vDomScrollPosTop=this.scrollTop))}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(e){var t=this.rows().indexOf(e);return!(Math.abs(this.vDomTop-t)>Math.abs(this.vDomBottom-t))}scrollToRow(e){var t=this.rows().indexOf(e);t>-1&&this._virtualRenderFill(t,!0)}visibleRows(e){var t=this.elementVertical.scrollTop,i=this.elementVertical.clientHeight+t,s=!1,o=0,n=0,r=this.rows();if(e)o=this.vDomTop,n=this.vDomBottom;else for(var a=this.vDomTop;a<=this.vDomBottom;a++)if(r[a])if(s){if(!(i-r[a].getElement().offsetTop>=0))break;n=a}else if(t-r[a].getElement().offsetTop>=0)o=a;else{if(s=!0,!(i-r[a].getElement().offsetTop>=0))break;n=a}return r.slice(o,n+1)}_virtualRenderFill(e,i,s){var o=this.tableElement,n=this.elementVertical,r=0,a=0,l=0,h=0,d=0,c=this.rows(),u=c.length,m=this.elementVertical.clientHeight;if(s=s||0,e=e||0){for(;o.firstChild;)o.removeChild(o.firstChild);(l=(u-e+1)*this.vDomRowHeight)this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*p),this.vDomBottom++,d++}e?(this.vDomTopPad=i?this.vDomRowHeight*this.vDomTop+s:this.scrollTop-h,this.vDomBottomPad=this.vDomBottom==u-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-a-h,0)):(this.vDomTopPad=0,this.vDomRowHeight=Math.floor((a+h)/d),this.vDomBottomPad=this.vDomRowHeight*(u-this.vDomBottom-1),this.vDomScrollHeight=h+a+this.vDomBottomPad-m),o.style.paddingTop=this.vDomTopPad+"px",o.style.paddingBottom=this.vDomBottomPad+"px",i&&(this.scrollTop=this.vDomTopPad+h+s-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-m:0)),this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-m),this.elementVertical.scrollWidth>this.elementVertical.offsetWidth&&i&&(this.scrollTop+=this.elementVertical.offsetHeight-m),this.vDomScrollPosTop=this.scrollTop,this.vDomScrollPosBottom=this.scrollTop,n.scrollTop=this.scrollTop,this.dispatch("render-virtual-fill")}}_addTopRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomTop-1,r=0,a=!0;a;)if(this.vDomTop){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.insertBefore(d.getElement(),i.firstChild),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomTop--,n--,r++):a=!1):a=!1}else a=!1;for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomTopPad-=o,this.vDomTopPad<0&&(this.vDomTopPad=n*this.vDomRowHeight),n<1&&(this.vDomTopPad=0),i.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop-=o)}_removeTopRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomTop];a&&o=r?(this.vDomTop++,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomTopPad+=s,this.tableElement.style.paddingTop=this.vDomTopPad+"px",this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer)}_addBottomRow(e,t){for(var i=this.tableElement,s=[],o=0,n=this.vDomBottom+1,r=0,a=!0;a;){let l,h,d=e[n];d&&r=l?(this.styleRow(d,n),i.appendChild(d.getElement()),d.initialized&&d.heightInitialized||s.push(d),d.initialize(),h||(l=d.getElement().offsetHeight,l>this.vDomWindowBuffer&&(this.vDomWindowBuffer=2*l)),t-=l,o+=l,this.vDomBottom++,n++,r++):a=!1):a=!1}for(let e of s)e.clearCellHeight();this._quickNormalizeRowHeight(s),o&&(this.vDomBottomPad-=o,(this.vDomBottomPad<0||n==e.length-1)&&(this.vDomBottomPad=0),i.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom+=o)}_removeBottomRow(e,t){for(var i=[],s=0,o=0,n=!0;n;){let r,a=e[this.vDomBottom];a&&o=r?(this.vDomBottom--,t-=r,s+=r,i.push(a),o++):n=!1):n=!1}for(let e of i){let t=e.getElement();t.parentNode&&t.parentNode.removeChild(t)}s&&(this.vDomBottomPad+=s,this.vDomBottomPad<0&&(this.vDomBottomPad=0),this.tableElement.style.paddingBottom=this.vDomBottomPad+"px",this.vDomScrollPosBottom-=s)}_quickNormalizeRowHeight(e){for(let t of e)t.calcHeight();for(let t of e)t.setCellHeight()}}class xe extends e{constructor(e){super(e),this.element=this.createHolderElement(),this.tableElement=this.createTableElement(),this.heightFixer=this.createTableElement(),this.placeholder=null,this.placeholderContents=null,this.firstRender=!1,this.renderMode="virtual",this.fixedHeight=!1,this.rows=[],this.activeRowsPipeline=[],this.activeRows=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.scrollTop=0,this.scrollLeft=0,this.redrawBlock=!1,this.redrawBlockRestoreConfig=!1,this.redrawBlockRenderInPosition=!1,this.dataPipeline=[],this.displayPipeline=[],this.renderer=null}createHolderElement(){var e=document.createElement("div");return e.classList.add("tabulator-tableholder"),e.setAttribute("tabindex",0),e}createTableElement(){var e=document.createElement("div");return e.classList.add("tabulator-table"),e.setAttribute("role","rowgroup"),e}initializePlaceholder(){if("string"==typeof this.table.options.placeholder){let e=document.createElement("div");e.classList.add("tabulator-placeholder");let t=document.createElement("div");t.classList.add("tabulator-placeholder-contents"),t.innerHTML=this.table.options.placeholder,e.appendChild(t),this.placeholderContents=t,this.placeholder=e}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder(),this.initializeRenderer(),this.element.appendChild(this.tableElement),this.firstRender=!0,this.element.addEventListener("scroll",(()=>{var e=this.element.scrollLeft,t=this.scrollLeft>e,i=this.element.scrollTop,s=this.scrollTop>i;this.scrollLeft!=e&&(this.scrollLeft=e,this.dispatch("scroll-horizontal",e,t),this.dispatchExternal("scrollHorizontal",e,t),this._positionPlaceholder()),this.scrollTop!=i&&(this.scrollTop=i,this.renderer.scrollRows(i,s),this.dispatch("scroll-vertical",i,s),this.dispatchExternal("scrollVertical",i,s))}))}findRow(e){if("object"!=typeof e){if(void 0===e)return!1;return this.rows.find((t=>t.data[this.table.options.index]==e))||!1}if(e instanceof w)return e;if(e instanceof v)return e._getSelf()||!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement){return this.rows.find((t=>t.getElement()===e))||!1}return!1}getRowFromDataObject(e){return this.rows.find((t=>t.data===e))||!1}getRowFromPosition(e){return this.getDisplayRows().find((t=>t.getPosition()===e&&t.isDisplayed()))}scrollToRow(e,t,i){return this.renderer.scrollToRowPosition(e,t,i)}setData(e,t,i){return new Promise(((s,o)=>{t&&this.getDisplayRows().length?this.table.options.pagination?this._setDataActual(e,!0):this.reRenderInPosition((()=>{this._setDataActual(e)})):(this.table.options.autoColumns&&i&&this.table.initialized&&this.table.columnManager.generateColumnsFromRowData(e),this.resetScroll(),this._setDataActual(e)),s()}))}_setDataActual(e,t){this.dispatchExternal("dataProcessing",e),this._wipeElements(),Array.isArray(e)?(this.dispatch("data-processing",e),e.forEach(((e,t)=>{if(e&&"object"==typeof e){var i=new w(e,this);this.rows.push(i)}else console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",e)})),this.refreshActiveData(!1,!1,t),this.dispatch("data-processed",e),this.dispatchExternal("dataProcessed",e)):console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof e,"\nData: ",e)}_wipeElements(){this.dispatch("rows-wipe"),this.rows.forEach((e=>{e.wipe()})),this.rows=[],this.activeRows=[],this.activeRowsPipeline=[],this.activeRowsCount=0,this.displayRows=[],this.displayRowsCount=0,this.adjustTableSize()}deleteRow(e,t){var i=this.rows.indexOf(e),s=this.activeRows.indexOf(e);s>-1&&this.activeRows.splice(s,1),i>-1&&this.rows.splice(i,1),this.setActiveRows(this.activeRows),this.displayRowIterator((t=>{var i=t.indexOf(e);i>-1&&t.splice(i,1)})),t||this.reRenderInPosition(),this.regenerateRowPositions(),this.dispatchExternal("rowDeleted",e.getComponent()),this.displayRowsCount||this._showPlaceholder(),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.getData())}addRow(e,t,i,s){return this.addRowActual(e,t,i,s)}addRows(e,t,i){var s=[];return new Promise(((o,n)=>{t=this.findAddRowPos(t),Array.isArray(e)||(e=[e]),(void 0===i&&t||void 0!==i&&!t)&&e.reverse(),e.forEach(((o,n)=>{var r=this.addRow(o,t,i,!0);s.push(r),this.dispatch("row-added",r,e,t,i)})),this.refreshActiveData(!1,!1,!0),this.regenerateRowPositions(),s.length&&this._clearPlaceholder(),o(s)}))}findAddRowPos(e){return void 0===e&&(e=this.table.options.addRowPos),"pos"===e&&(e=!0),"bottom"===e&&(e=!1),e}addRowActual(e,t,i,s){var o,n,r=e instanceof w?e:new w(e||{},this),a=this.findAddRowPos(t),l=-1;return i||(n=this.chain("row-adding-position",[r,a],null,{index:i,top:a}),i=n.index,a=n.top),void 0!==i&&(i=this.findRow(i)),(i=this.chain("row-adding-index",[r,i,a],null,i))&&(l=this.rows.indexOf(i)),i&&l>-1?(o=this.activeRows.indexOf(i),this.displayRowIterator((function(e){var t=e.indexOf(i);t>-1&&e.splice(a?t:t+1,0,r)})),o>-1&&this.activeRows.splice(a?o:o+1,0,r),this.rows.splice(a?l:l+1,0,r)):a?(this.displayRowIterator((function(e){e.unshift(r)})),this.activeRows.unshift(r),this.rows.unshift(r)):(this.displayRowIterator((function(e){e.push(r)})),this.activeRows.push(r),this.rows.push(r)),this.setActiveRows(this.activeRows),this.dispatchExternal("rowAdded",r.getComponent()),this.subscribedExternal("dataChanged")&&this.dispatchExternal("dataChanged",this.table.rowManager.getData()),s||this.reRenderInPosition(),r}moveRow(e,t,i){this.dispatch("row-move",e,t,i),this.moveRowActual(e,t,i),this.regenerateRowPositions(),this.dispatch("row-moved",e,t,i),this.dispatchExternal("rowMoved",e.getComponent())}moveRowActual(e,t,i){this.moveRowInArray(this.rows,e,t,i),this.moveRowInArray(this.activeRows,e,t,i),this.displayRowIterator((s=>{this.moveRowInArray(s,e,t,i)})),this.dispatch("row-moving",e,t,i)}moveRowInArray(e,t,i,s){var o,n,r;if(t!==i&&((o=e.indexOf(t))>-1&&(e.splice(o,1),(n=e.indexOf(i))>-1?s?e.splice(n+1,0,t):e.splice(n,0,t):e.splice(o,0,t)),e===this.getDisplayRows())){r=n>o?n:o+1;for(let t=o-1&&t}nextDisplayRow(e,t){var i=this.getDisplayRowIndex(e),s=!1;return!1!==i&&i-1)&&i}getData(e,t){var i=[];return this.getRows(e).forEach((function(e){"row"==e.type&&i.push(e.getData(t||"data"))})),i}getComponents(e){var t=[];return this.getRows(e).forEach((function(e){t.push(e.getComponent())})),t}getDataCount(e){return this.getRows(e).length}scrollHorizontal(e){this.scrollLeft=e,this.element.scrollLeft=e,this.dispatch("scroll-horizontal",e)}registerDataPipelineHandler(e,t){void 0!==t?(this.dataPipeline.push({handler:e,priority:t}),this.dataPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Data pipeline handlers must have a priority in order to be registered")}registerDisplayPipelineHandler(e,t){void 0!==t?(this.displayPipeline.push({handler:e,priority:t}),this.displayPipeline.sort(((e,t)=>e.priority-t.priority))):console.error("Display pipeline handlers must have a priority in order to be registered")}refreshActiveData(e,i,s){var o=this.table,n="",r=0,a=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if("function"==typeof e)if((r=this.dataPipeline.findIndex((t=>t.handler===e)))>-1)n="dataPipeline",i&&(r==this.dataPipeline.length-1?n="display":r++);else{if(!((r=this.displayPipeline.findIndex((t=>t.handler===e)))>-1))return void console.error("Unable to refresh data, invalid handler provided",e);n="displayPipeline",i&&(r==this.displayPipeline.length-1?n="end":r++)}else n=e||"all",r=0;if(this.redrawBlock)return void((!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===n&&r{"row"===e.type&&(e.setPosition(t),t++)}))}setActiveRows(e){this.activeRows=e,this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[],this.displayRows.push(this.activeRows.slice(0)),this.displayRowsCount=this.displayRows[0].length}setDisplayRows(e,t){this.displayRows[t]=e,t==this.displayRows.length-1&&(this.displayRowsCount=this.displayRows[this.displayRows.length-1].length)}getDisplayRows(e){return void 0===e?this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]:this.displayRows[e]||[]}getVisibleRows(e,t){var i=Object.assign([],this.renderer.visibleRows(!t));return e&&(i=this.chain("rows-visible",[t],i,i)),i}displayRowIterator(e){this.activeRowsPipeline.forEach(e),this.displayRows.forEach(e),this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(e){var t=[];if(e&&!0!==e)switch(e){case"active":t=this.activeRows;break;case"display":t=this.table.rowManager.getDisplayRows();break;case"visible":t=this.getVisibleRows(!1,!0)}else t=this.chain("rows-retrieve",e,null,this.rows)||this.rows;return t}reRenderInPosition(e){this.redrawBlock?e?e():this.redrawBlockRenderInPosition=!0:(this.dispatchExternal("renderStarted"),this.renderer.rerenderRows(e),this.fixedHeight||this.adjustTableSize(),this.dispatchExternal("renderComplete"))}initializeRenderer(){var e,t={virtual:Re,basic:ye};(e="string"==typeof this.table.options.renderVertical?t[this.table.options.renderVertical]:this.table.options.renderVertical)?(this.renderMode=this.table.options.renderVertical,this.renderer=new e(this.table,this.element,this.tableElement),this.renderer.initialize(),this.table.element.clientHeight||this.table.options.height?this.fixedHeight=!0:this.fixedHeight=!1):console.error("Unable to find matching renderer:",this.table.options.renderVertical)}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted"),this.element.scrollTop=0,this._clearTable(),this.displayRowsCount?(this.renderer.renderRows(),this.firstRender&&(this.firstRender=!1,this.layoutRefresh(!0))):this.renderEmptyScroll(),this.fixedHeight||this.adjustTableSize(),this.dispatch("table-layout"),this.displayRowsCount||this._showPlaceholder(),this.dispatchExternal("renderComplete")}renderEmptyScroll(){this.placeholder?this.tableElement.style.display="none":this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}_clearTable(){this._clearPlaceholder(),this.scrollTop=0,this.scrollLeft=0,this.renderer.clearRows()}_showPlaceholder(){this.placeholder&&(this.placeholder.setAttribute("tabulator-render-mode",this.renderMode),this.getElement().appendChild(this.placeholder),this._positionPlaceholder())}_clearPlaceholder(){this.placeholder&&this.placeholder.parentNode&&this.placeholder.parentNode.removeChild(this.placeholder),this.tableElement.style.minWidth=""}_positionPlaceholder(){this.placeholder&&this.placeholder.parentNode&&(this.placeholder.style.width=this.table.columnManager.getWidth()+"px",this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px",this.placeholderContents.style.marginLeft=this.scrollLeft+"px")}styleRow(e,t){var i=e.getElement();t%2?(i.classList.add("tabulator-row-even"),i.classList.remove("tabulator-row-odd")):(i.classList.add("tabulator-row-odd"),i.classList.remove("tabulator-row-even"))}normalizeHeight(){this.activeRows.forEach((function(e){e.normalizeHeight()}))}adjustTableSize(){var e,t=this.element.clientHeight;if("fill"===this.renderer.verticalFillMode){let i=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));this.fixedHeight?(e=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px",this.element.style.minHeight=e||"calc(100% - "+i+"px)",this.element.style.height="calc(100% - "+i+"px)",this.element.style.maxHeight="calc(100% - "+i+"px)"):(this.element.style.height="",this.element.style.height=this.table.element.clientHeight-i+"px",this.element.scrollTop=this.scrollTop),this.renderer.resize(),this.fixedHeight||t==this.element.clientHeight||(this.subscribed("table-resize")?this.dispatch("table-resize"):this.redraw())}this._positionPlaceholder()}reinitialize(){this.rows.forEach((function(e){e.reinitialize(!0)}))}blockRedraw(){this.redrawBlock=!0,this.redrawBlockRestoreConfig=!1}restoreRedraw(){this.redrawBlock=!1,this.redrawBlockRestoreConfig?(this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition),this.redrawBlockRestoreConfig=!1):this.redrawBlockRenderInPosition&&this.reRenderInPosition(),this.redrawBlockRenderInPosition=!1}redraw(e){var t=this.scrollLeft;this.adjustTableSize(),this.table.tableWidth=this.table.element.clientWidth,e?this.renderTable():(this.reRenderInPosition(),this.scrollHorizontal(t))}resetScroll(){if(this.element.scrollLeft=0,this.element.scrollTop=0,"ie"===this.table.browser){var e=document.createEvent("Event");e.initEvent("scroll",!1,!0),this.element.dispatchEvent(e)}else this.element.dispatchEvent(new Event("scroll"))}}class Te extends e{constructor(e){super(e),this.active=!1,this.element=this.createElement(),this.containerElement=this.createContainerElement(),this.external=!1}initialize(){this.initializeElement()}createElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer"),e}createContainerElement(){var e=document.createElement("div");return e.classList.add("tabulator-footer-contents"),this.element.appendChild(e),e}initializeElement(){if(this.table.options.footerElement)switch(typeof this.table.options.footerElement){case"string":"<"===this.table.options.footerElement[0]?this.containerElement.innerHTML=this.table.options.footerElement:(this.external=!0,this.containerElement=document.querySelector(this.table.options.footerElement));break;default:this.element=this.table.options.footerElement}}getElement(){return this.element}append(e){this.activate(),this.containerElement.appendChild(e),this.table.rowManager.adjustTableSize()}prepend(e){this.activate(),this.element.insertBefore(e,this.element.firstChild),this.table.rowManager.adjustTableSize()}remove(e){e.parentNode.removeChild(e),this.deactivate()}deactivate(e){this.element.firstChild&&!e||(this.external||this.element.parentNode.removeChild(this.element),this.active=!1)}activate(){this.active||(this.active=!0,this.external||(this.table.element.appendChild(this.getElement()),this.table.element.style.display=""))}redraw(){this.dispatch("footer-redraw")}}class Me extends e{constructor(e){super(e),this.el=null,this.abortClasses=["tabulator-headers","tabulator-table"],this.previousTargets={},this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","touchstart","touchend"],this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"},this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}},this.pseudoTracking=!1}initialize(){this.el=this.table.element,this.buildListenerMap(),this.bindSubscriptionWatchers()}buildListenerMap(){var e={};this.listeners.forEach((t=>{e[t]={handler:null,components:[]}})),this.listeners=e}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((e=>{this.pseudoTrackers[e].subscriber=this.pseudoMouseEnter.bind(this,e),this.subscribe(e+"-mouseover",this.pseudoTrackers[e].subscriber)})),this.pseudoTracking=!0}pseudoMouseEnter(e,t,i){this.pseudoTrackers[e].target!==i&&(this.pseudoTrackers[e].target&&this.dispatch(e+"-mouseleave",t,this.pseudoTrackers[e].target),this.pseudoMouseLeave(e,t),this.pseudoTrackers[e].target=i,this.dispatch(e+"-mouseenter",t,i))}pseudoMouseLeave(e,t){var i=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};(i=i.filter((t=>{var i=s[e];return t!==e&&(!i||i&&!i.includes(t))}))).forEach((e=>{var i=this.pseudoTrackers[e].target;this.pseudoTrackers[e].target&&(this.dispatch(e+"-mouseleave",t,i),this.pseudoTrackers[e].target=null)}))}bindSubscriptionWatchers(){var e=Object.keys(this.listeners),t=Object.values(this.componentMap);for(let i of t)for(let t of e){let e=i+"-"+t;this.subscriptionChange(e,this.subscriptionChanged.bind(this,i,t))}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(e,t,i){var s=this.listeners[t].components,o=s.indexOf(e),n=!1;i?-1===o&&(s.push(e),n=!0):this.subscribed(e+"-"+t)||o>-1&&(s.splice(o,1),n=!0),"mouseenter"!==t&&"mouseleave"!==t||this.pseudoTracking||this.bindPseudoEvents(),n&&this.updateEventListeners()}updateEventListeners(){for(let e in this.listeners){let t=this.listeners[e];t.components.length?t.handler||(t.handler=this.track.bind(this,e),this.el.addEventListener(e,t.handler)):t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}track(e,t){var i=t.composedPath&&t.composedPath()||t.path,s=this.findTargets(i);s=this.bindComponents(e,s),this.triggerEvents(e,t,s),!this.pseudoTracking||"mouseover"!=e&&"mouseleave"!=e||Object.keys(s).length||this.pseudoMouseLeave("none",t)}findTargets(e){var t={};let i=Object.keys(this.componentMap);for(let s of e){let e=s.classList?[...s.classList]:[];if(e.filter((e=>this.abortClasses.includes(e))).length)break;let o=e.filter((e=>i.includes(e)));for(let e of o)t[this.componentMap[e]]||(t[this.componentMap[e]]=s)}return t.group&&t.group===t.row&&delete t.row,t}bindComponents(e,t){var i=Object.keys(t).reverse(),s=this.listeners[e],o={},n={};for(let e of i){let i,r=t[e],a=this.previousTargets[e];if(a&&a.target===r)i=a.component;else switch(e){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){i=this.table.rowManager.getVisibleRows(!0).find((e=>e.getElement()===r)),t.row&&t.row.parentNode&&t.row.parentNode.closest(".tabulator-row")&&(t[e]=!1)}break;case"column":s.components.includes("column")&&(i=this.table.columnManager.findColumn(r));break;case"cell":s.components.includes("cell")&&(o.row instanceof w?i=o.row.findCell(r):t.row&&console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?"))}i&&(o[e]=i,n[e]={target:r,component:i})}return this.previousTargets=n,o}triggerEvents(e,t,i){var s=this.listeners[e];for(let o in i)i[o]&&s.components.includes(o)&&this.dispatch(o+"-"+e,t,i[o])}clearWatchers(){for(let e in this.listeners){let t=this.listeners[e];t.handler&&(this.el.removeEventListener(e,t.handler),t.handler=null)}}}class Le{constructor(e){this.table=e,this.bindings={}}bind(e,t,i){this.bindings[e]||(this.bindings[e]={}),this.bindings[e][t]?console.warn("Unable to bind component handler, a matching function name is already bound",e,t,i):this.bindings[e][t]=i}handle(e,t,i){if(this.bindings[e]&&this.bindings[e][i]&&"function"==typeof this.bindings[e][i].bind)return this.bindings[e][i].bind(null,t);"then"===i||"string"!=typeof i||i.startsWith("_")||this.table.options.debugInvalidComponentFuncs&&console.error("The "+e+" component does not have a "+i+" function, have you checked that you have the correct Tabulator module installed?")}}class ke extends e{constructor(e){super(e),this.requestOrder=0,this.loading=!1}initialize(){}load(e,t,i,s,o,n){var r=++this.requestOrder;return this.dispatchExternal("dataLoading",e),!e||0!=e.indexOf("{")&&0!=e.indexOf("[")||(e=JSON.parse(e)),this.confirm("data-loading",[e,t,i,o])?(this.loading=!0,o||this.alertLoader(),t=this.chain("data-params",[e,i,o],t||{},t||{}),t=this.mapParams(t,this.table.options.dataSendParams),this.chain("data-load",[e,t,i,o],!1,Promise.resolve([])).then((e=>{Array.isArray(e)||"object"!=typeof e||(e=this.mapParams(e,this.objectInvert(this.table.options.dataReceiveParams)));var t=this.chain("data-loaded",e,null,e);r==this.requestOrder?(this.clearAlert(),!1!==t&&(this.dispatchExternal("dataLoaded",t),this.table.rowManager.setData(t,s,void 0===n?!s:n))):console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")})).catch((e=>{console.error("Data Load Error: ",e),this.dispatchExternal("dataLoadError",e),o||this.alertError(),setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=!1}))):(this.dispatchExternal("dataLoaded",e),e||(e=[]),this.table.rowManager.setData(e,s,void 0===n?!s:n),Promise.resolve())}mapParams(e,t){var i={};for(let s in e)i[t.hasOwnProperty(s)?t[s]:s]=e[s];return i}objectInvert(e){var t={};for(let i in e)t[e[i]]=i;return t}blockActiveLoad(){this.requestOrder++}alertLoader(){("function"==typeof this.table.options.dataLoader?this.table.options.dataLoader():this.table.options.dataLoader)&&this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Se{constructor(e,t,i){this.table=e,this.events={},this.optionsList=t||{},this.subscriptionNotifiers={},this.dispatch=i?this._debugDispatch.bind(this):this._dispatch.bind(this),this.debug=i}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}else delete this.events[e];this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e,t=Array.from(arguments),i=t.shift();return this.events[i]&&this.events[i].forEach(((i,s)=>{let o=i.apply(this.table,t);s||(e=o)})),e}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="ExternalEvent:"+e[0],(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}}class De{constructor(e){this.events={},this.subscriptionNotifiers={},this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this),this.chain=e?this._debugChain.bind(this):this._chain.bind(this),this.confirm=e?this._debugConfirm.bind(this):this._confirm.bind(this),this.debug=e}subscriptionChange(e,t){this.subscriptionNotifiers[e]||(this.subscriptionNotifiers[e]=[]),this.subscriptionNotifiers[e].push(t),this.subscribed(e)&&this._notifySubscriptionChange(e,!0)}subscribe(e,t,i=1e4){this.events[e]||(this.events[e]=[]),this.events[e].push({callback:t,priority:i}),this.events[e].sort(((e,t)=>e.priority-t.priority)),this._notifySubscriptionChange(e,!0)}unsubscribe(e,t){var i;if(this.events[e]){if(t){if(!((i=this.events[e].findIndex((e=>e.callback===t)))>-1))return void console.warn("Cannot remove event, no matching event found:",e,t);this.events[e].splice(i,1)}this._notifySubscriptionChange(e,!1)}else console.warn("Cannot remove event, no events set on:",e)}subscribed(e){return this.events[e]&&this.events[e].length}_chain(e,t,i,s){var o=i;return Array.isArray(t)||(t=[t]),this.subscribed(e)?(this.events[e].forEach(((e,i)=>{o=e.callback.apply(this,t.concat([o]))})),o):"function"==typeof s?s():s}_confirm(e,t){var i=!1;return Array.isArray(t)||(t=[t]),this.subscribed(e)&&this.events[e].forEach(((e,s)=>{e.callback.apply(this,t)&&(i=!0)})),i}_notifySubscriptionChange(e,t){var i=this.subscriptionNotifiers[e];i&&i.forEach((e=>{e(t)}))}_dispatch(){var e=Array.from(arguments),t=e.shift();this.events[t]&&this.events[t].forEach((t=>{t.callback.apply(this,e)}))}_debugDispatch(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._dispatch(...arguments)}_debugChain(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._chain(...arguments)}_debugConfirm(){var e=Array.from(arguments),t=e[0];return e[0]="InternalEvent:"+t,(!0===this.debug||this.debug.includes(t))&&console.log(...e),this._confirm(...arguments)}}class Pe extends e{constructor(e){super(e)}_warnUser(){this.options("debugDeprecation")&&console.warn(...arguments)}check(e,t){var i="";return void 0===this.options(e)||(i="Deprecated Setup Option - Use of the %c"+e+"%c option is now deprecated",t?(i=i+", Please use the %c"+t+"%c option instead",this._warnUser(i,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;")):this._warnUser(i,"font-weight: bold;","font-weight: normal;"),!1)}checkMsg(e,t){return void 0===this.options(e)||(this._warnUser("%cDeprecated Setup Option - Use of the %c"+e+" %c option is now deprecated, "+t,"font-weight: normal;","font-weight: bold;","font-weight: normal;"),!1)}msg(e){this._warnUser(e)}}class ze{static register(e){ze.tables.push(e)}static deregister(e){var t=ze.tables.indexOf(e);t>-1&&ze.tables.splice(t,1)}static lookupTable(e,t){var i,s,o=[];if("string"==typeof e){if((i=document.querySelectorAll(e)).length)for(var n=0;n{e.widthFixed||e.reinitializeWidth(),(this.table.options.responsiveLayout?e.modules.responsive.visible:e.visible)&&(n=e),e.visible&&(i+=e.getWidth())})),n?(o=s-i+n.getWidth(),this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&(n.setWidth(0),this.table.modules.responsiveLayout.update()),o>0?n.setWidth(o):n.reinitializeWidth()):this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",!0)&&this.table.modules.responsiveLayout.update()},fitColumns:function(e,t){var i,s,o=this.table.rowManager.element.getBoundingClientRect().width,n=0,r=0,a=0,l=[],h=[],d=0,c=0;function u(e){return"string"==typeof e?e.indexOf("%")>-1?o/100*parseInt(e):parseInt(e):e}function m(e,t,i,s){var o=[],n=0,r=0,l=0,h=a,d=0,c=0,p=[];function g(e){return i*(e.column.definition.widthGrow||1)}function b(e){return u(e.width)-i*(e.column.definition.widthShrink||0)}return e.forEach((function(e,n){var r=s?b(e):g(e);e.column.minWidth>=r?o.push(e):e.column.maxWidth&&e.column.maxWidththis.table.rowManager.element.clientHeight&&(o-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth),e.forEach((function(e){var t,i,s;e.visible&&(t=e.definition.width,i=parseInt(e.minWidth),t?(s=u(t),n+=s>i?s:i,e.definition.widthShrink&&(h.push({column:e,width:s>i?s:i}),d+=e.definition.widthShrink)):(l.push({column:e,width:0}),a+=e.definition.widthGrow||1))})),r=o-n,i=Math.floor(r/a),c=m(l,r,i,!1),l.length&&c>0&&(l[l.length-1].width+=c),l.forEach((function(e){r-=e.width})),(s=Math.abs(c)+r)>0&&d&&(c=m(h,s,Math.floor(s/d),!0)),c&&h.length&&(h[h.length-1].width-=c),l.forEach((function(e){e.column.setWidth(e.width)})),h.forEach((function(e){e.column.setWidth(e.width)}))}};class Ae extends s{constructor(e){super(e,"layout"),this.mode=null,this.registerTableOption("layout","fitData"),this.registerTableOption("layoutColumnsOnNewData",!1),this.registerColumnOption("widthGrow"),this.registerColumnOption("widthShrink")}initialize(){var e=this.table.options.layout;Ae.modes[e]?this.mode=e:(console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+e),this.mode="fitData"),this.table.element.setAttribute("tabulator-layout",this.mode)}getMode(){return this.mode}layout(e){this.dispatch("layout-refreshing"),Ae.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,e),this.dispatch("layout-refreshed")}}Ae.moduleName="layout",Ae.modes=He;class _e extends s{constructor(e){super(e),this.locale="default",this.lang=!1,this.bindings={},this.langList={},this.registerTableOption("locale",!1),this.registerTableOption("langs",{})}initialize(){this.langList=t.deepClone(_e.langs),!1!==this.table.options.columnDefaults.headerFilterPlaceholder&&this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);for(let e in this.table.options.langs)this.installLang(e,this.table.options.langs[e]);this.setLocale(this.table.options.locale),this.registerTableFunction("setLocale",this.setLocale.bind(this)),this.registerTableFunction("getLocale",this.getLocale.bind(this)),this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(e){this.langList.default.headerFilters.default=e}setHeaderFilterColumnPlaceholder(e,t){this.langList.default.headerFilters.columns[e]=t,this.lang&&!this.lang.headerFilters.columns[e]&&(this.lang.headerFilters.columns[e]=t)}installLang(e,t){this.langList[e]?this._setLangProp(this.langList[e],t):this.langList[e]=t}_setLangProp(e,t){for(let i in t)e[i]&&"object"==typeof e[i]?this._setLangProp(e[i],t[i]):e[i]=t[i]}setLocale(e){if(!0===(e=e||"default")&&navigator.language&&(e=navigator.language.toLowerCase()),e&&!this.langList[e]){let t=e.split("-")[0];this.langList[t]?(console.warn("Localization Error - Exact matching locale not found, using closest match: ",e,t),e=t):(console.warn("Localization Error - Matching locale not found, using default: ",e),e="default")}this.locale=e,this.lang=t.deepClone(this.langList.default||{}),"default"!=e&&function e(t,i){for(var s in t)"object"==typeof t[s]?(i[s]||(i[s]={}),e(t[s],i[s])):i[s]=t[s]}(this.langList[e],this.lang),this.dispatchExternal("localized",this.locale,this.lang),this._executeBindings()}getLocale(e){return this.locale}getLang(e){return e?this.langList[e]:this.lang}getText(e,t){var i=(t?e+"|"+t:e).split("|");return this._getLangElement(i,this.locale)||""}_getLangElement(e,t){var i=this.lang;return e.forEach((function(e){var t;i&&(t=i[e],i=void 0!==t&&t)})),i}bind(e,t){this.bindings[e]||(this.bindings[e]=[]),this.bindings[e].push(t),t(this.getText(e),this.lang)}_executeBindings(){for(let e in this.bindings)this.bindings[e].forEach((t=>{t(this.getText(e),this.lang)}))}}_e.moduleName="localize",_e.langs={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class Oe extends s{constructor(e){super(e)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(e){var t=[];return ze.lookupTable(e).forEach((e=>{this.table!==e&&t.push(e)})),t}send(e,t,i,s){var o=this.getConnections(e);o.forEach((e=>{e.tableComms(this.table.element,t,i,s)})),!o.length&&e&&console.warn("Table Connection Error - No tables matching selector found",e)}receive(e,t,i,s){if(this.table.modExists(t))return this.table.modules[t].commsReceived(e,i,s);console.warn("Inter-table Comms Error - no such module:",t)}}Oe.moduleName="comms";var Be=Object.freeze({__proto__:null,LayoutModule:Ae,LocalizeModule:_e,CommsModule:Oe});class Ie{constructor(e,t){this.bindStaticFunctionality(e),this.bindModules(e,Be,!0),t&&this.bindModules(e,t)}bindStaticFunctionality(e){e.moduleBindings={},e.extendModule=function(t,i,s){if(e.moduleBindings[t]){var o=e.moduleBindings[t][i];if(o)if("object"==typeof s)for(let e in s)o[e]=s[e];else console.warn("Module Error - Invalid value type, it must be an object");else console.warn("Module Error - property does not exist:",i)}else console.warn("Module Error - module does not exist:",t)},e.registerModule=function(t){Array.isArray(t)||(t=[t]),t.forEach((t=>{e.registerModuleBinding(t)}))},e.registerModuleBinding=function(t){e.moduleBindings[t.moduleName]=t},e.findTable=function(e){var t=ze.lookupTable(e,!0);return!(Array.isArray(t)&&!t.length)&&t},e.prototype.bindModules=function(){var t=[],i=[],s=[];for(var o in this.modules={},e.moduleBindings){let n=e.moduleBindings[o],r=new n(this);this.modules[o]=r,n.prototype.moduleCore?this.modulesCore.push(r):n.moduleInitOrder?n.moduleInitOrder<0?t.push(r):i.push(r):s.push(r)}t.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),i.sort(((e,t)=>e.moduleInitOrder>t.moduleInitOrder?1:-1)),this.modulesRegular=t.concat(s.concat(i))}}bindModules(e,t,i){var s=Object.values(t);i&&s.forEach((e=>{e.prototype.moduleCore=!0})),e.registerModule(s)}}class Ve extends e{constructor(e){super(e),this.element=this._createAlertElement(),this.msgElement=this._createMsgElement(),this.type=null,this.element.appendChild(this.msgElement)}_createAlertElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert"),e}_createMsgElement(){var e=document.createElement("div");return e.classList.add("tabulator-alert-msg"),e.setAttribute("role","alert"),e}_typeClass(){return"tabulator-alert-state-"+this.type}alert(e,t="msg"){if(e){for(this.clear(),this.type=t;this.msgElement.firstChild;)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass()),"function"==typeof e&&(e=e()),e instanceof HTMLElement?this.msgElement.appendChild(e):this.msgElement.innerHTML=e,this.table.element.appendChild(this.element)}}clear(){this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.msgElement.classList.remove(this._typeClass())}}class Ne{constructor(e,t){this.options={},this.columnManager=null,this.rowManager=null,this.footerManager=null,this.alertManager=null,this.vdomHoz=null,this.externalEvents=null,this.eventBus=null,this.interactionMonitor=!1,this.browser="",this.browserSlow=!1,this.browserMobile=!1,this.rtl=!1,this.originalElement=null,this.componentFunctionBinder=new Le(this),this.dataLoader=!1,this.modules={},this.modulesCore=[],this.modulesRegular=[],this.deprecationAdvisor=new Pe(this),this.optionsList=new fe(this,"table constructor"),this.initialized=!1,this.destroyed=!1,this.initializeElement(e)&&(this.initializeCoreSystems(t),setTimeout((()=>{this._create()}))),ze.register(this)}initializeElement(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement?(this.element=e,!0):"string"==typeof e?(this.element=document.querySelector(e),!!this.element||(console.error("Tabulator Creation Error - no element found matching selector: ",e),!1)):(console.error("Tabulator Creation Error - Invalid element provided:",e),!1)}initializeCoreSystems(e){this.columnManager=new Ee(this),this.rowManager=new xe(this),this.footerManager=new Te(this),this.dataLoader=new ke(this),this.alertManager=new Ve(this),this.bindModules(),this.options=this.optionsList.generate(Ne.defaultOptions,e),this._clearObjectPointers(),this._mapDeprecatedFunctionality(),this.externalEvents=new Se(this,this.options,this.options.debugEventsExternal),this.eventBus=new De(this.options.debugEventsInternal),this.interactionMonitor=new Me(this),this.dataLoader.initialize(),this.footerManager.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select"),window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():document.selection&&document.selection.empty(),this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding"),this.eventBus.dispatch("table-building"),this._rtlCheck(),this._buildElement(),this._initializeTable(),this._loadInitialData(),this.initialized=!0,this.externalEvents.dispatch("tableBuilt")}_rtlCheck(){var e=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if("rtl"!==e.direction)break;case"rtl":this.element.classList.add("tabulator-rtl"),this.rtl=!0;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=!1}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0),Array.isArray(this.options.data)&&!this.options.reactiveData&&(this.options.data=this.options.data.slice(0))}_buildElement(){var e,t=this.element,i=this.options;if("TABLE"===t.tagName){this.originalElement=this.element,e=document.createElement("div");var s=t.attributes;for(var o in s)"object"==typeof s[o]&&e.setAttribute(s[o].name,s[o].value);t.parentNode.replaceChild(e,t),this.element=t=e}for(t.classList.add("tabulator"),t.setAttribute("role","grid");t.firstChild;)t.removeChild(t.firstChild);i.height&&(i.height=isNaN(i.height)?i.height:i.height+"px",t.style.height=i.height),!1!==i.minHeight&&(i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px",t.style.minHeight=i.minHeight),!1!==i.maxHeight&&(i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px",t.style.maxHeight=i.maxHeight)}_initializeTable(){var e=this.element,t=this.options;this.interactionMonitor.initialize(),this.columnManager.initialize(),this.rowManager.initialize(),this._detectBrowser(),this.modulesCore.forEach((e=>{e.initialize()})),e.appendChild(this.columnManager.getElement()),e.appendChild(this.rowManager.getElement()),t.footerElement&&this.footerManager.activate(),t.autoColumns&&t.data&&this.columnManager.generateColumnsFromRowData(this.options.data),this.modulesRegular.forEach((e=>{e.initialize()})),this.columnManager.setColumns(t.columns),this.eventBus.dispatch("table-built")}_loadInitialData(){this.dataLoader.load(this.options.data)}destroy(){var e=this.element;for(this.destroyed=!0,ze.deregister(this),this.eventBus.dispatch("table-destroy"),this.rowManager.rows.forEach((function(e){e.wipe()})),this.rowManager.rows=[],this.rowManager.activeRows=[],this.rowManager.displayRows=[];e.firstChild;)e.removeChild(e.firstChild);e.classList.remove("tabulator"),this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var e=navigator.userAgent||navigator.vendor||window.opera;e.indexOf("Trident")>-1?(this.browser="ie",this.browserSlow=!0):e.indexOf("Edge")>-1?(this.browser="edge",this.browserSlow=!0):e.indexOf("Firefox")>-1?(this.browser="firefox",this.browserSlow=!1):(this.browser="other",this.browserSlow=!1),this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e.slice(0,4))}initGuard(e,t){var i,s;return this.options.debugInitialization&&!this.initialized&&(e||(e=" "==(s="Error"==(i=(new Error).stack.split("\n"))[0]?i[2]:i[1])[0]?s.trim().split(" ")[1].split(".")[1]:s.trim().split("@")[0]),console.warn("Table Not Initialized - Calling the "+e+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(t?" "+t:""))),this.initialized}blockRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-blocking"),this.rowManager.blockRedraw(),this.columnManager.blockRedraw(),this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard(),this.eventBus.dispatch("redraw-restoring"),this.rowManager.restoreRedraw(),this.columnManager.restoreRedraw(),this.eventBus.dispatch("redraw-restored")}setData(e,t,i){return this.initGuard(!1,"To set initial data please use the 'data' property in the table constructor."),this.dataLoader.load(e,t,i,!1)}clearData(){this.initGuard(),this.dataLoader.blockActiveLoad(),this.rowManager.clearData()}getData(e){return this.rowManager.getData(e)}getDataCount(e){return this.rowManager.getDataCount(e)}replaceData(e,t,i){return this.initGuard(),this.dataLoader.load(e,t,i,!0,!0)}updateData(e){var t=0;return this.initGuard(),new Promise(((i,s)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var s=this.rowManager.findRow(e[this.options.index]);s&&(t++,s.updateData(e).then((()=>{--t||i()})))})):(console.warn("Update Error - No data provided"),s("Update Error - No data provided"))}))}addData(e,t,i){return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e?this.rowManager.addRows(e,t,i).then((e=>{var t=[];e.forEach((function(e){t.push(e.getComponent())})),s(t)})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}updateOrAddData(e){var t=[],i=0;return this.initGuard(),new Promise(((s,o)=>{this.dataLoader.blockActiveLoad(),"string"==typeof e&&(e=JSON.parse(e)),e&&e.length>0?e.forEach((e=>{var o=this.rowManager.findRow(e[this.options.index]);i++,o?o.updateData(e).then((()=>{i--,t.push(o.getComponent()),i||s(t)})):this.rowManager.addRows(e).then((e=>{i--,t.push(e[0].getComponent()),i||s(t)}))})):(console.warn("Update Error - No data provided"),o("Update Error - No data provided"))}))}getRow(e){var t=this.rowManager.findRow(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}getRowFromPosition(e){var t=this.rowManager.getRowFromPosition(e);return t?t.getComponent():(console.warn("Find Error - No matching row found:",e),!1)}deleteRow(e){var t=[];this.initGuard(),Array.isArray(e)||(e=[e]);for(let i of e){let e=this.rowManager.findRow(i,!0);if(!e)return console.error("Delete Error - No matching row found:",i),Promise.reject("Delete Error - No matching row found");t.push(e)}return t.sort(((e,t)=>this.rowManager.rows.indexOf(e)>this.rowManager.rows.indexOf(t)?1:-1)),t.forEach((e=>{e.delete()})),this.rowManager.reRenderInPosition(),Promise.resolve()}addRow(e,t,i){return this.initGuard(),"string"==typeof e&&(e=JSON.parse(e)),this.rowManager.addRows(e,t,i).then((e=>e[0].getComponent()))}updateOrAddRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>i.getComponent())):this.rowManager.addRows(t).then((e=>e[0].getComponent()))}updateRow(e,t){var i=this.rowManager.findRow(e);return this.initGuard(),"string"==typeof t&&(t=JSON.parse(t)),i?i.updateData(t).then((()=>Promise.resolve(i.getComponent()))):(console.warn("Update Error - No matching row found:",e),Promise.reject("Update Error - No matching row found"))}scrollToRow(e,t,i){var s=this.rowManager.findRow(e);return s?this.rowManager.scrollToRow(s,t,i):(console.warn("Scroll Error - No matching row found:",e),Promise.reject("Scroll Error - No matching row found"))}moveRow(e,t,i){var s=this.rowManager.findRow(e);this.initGuard(),s?s.moveToRow(t,i):console.warn("Move Error - No matching row found:",e)}getRows(e){return this.rowManager.getComponents(e)}getRowPosition(e){var t=this.rowManager.findRow(e);return t?t.getPosition():(console.warn("Position Error - No matching row found:",e),!1)}setColumns(e){this.initGuard(!1,"To set initial columns please use the 'columns' property in the table constructor"),this.columnManager.setColumns(e)}getColumns(e){return this.columnManager.getComponents(e)}getColumn(e){var t=this.columnManager.findColumn(e);return t?t.getComponent():(console.warn("Find Error - No matching column found:",e),!1)}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Show Error - No matching column found:",e),!1;t.show()}hideColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Hide Error - No matching column found:",e),!1;t.hide()}toggleColumn(e){var t=this.columnManager.findColumn(e);if(this.initGuard(),!t)return console.warn("Column Visibility Toggle Error - No matching column found:",e),!1;t.visible?t.hide():t.show()}addColumn(e,t,i){var s=this.columnManager.findColumn(i);return this.initGuard(),this.columnManager.addColumn(e,t,s).then((e=>e.getComponent()))}deleteColumn(e){var t=this.columnManager.findColumn(e);return this.initGuard(),t?t.delete():(console.warn("Column Delete Error - No matching column found:",e),Promise.reject())}updateColumnDefinition(e,t){var i=this.columnManager.findColumn(e);return this.initGuard(),i?i.updateDefinition(t):(console.warn("Column Update Error - No matching column found:",e),Promise.reject())}moveColumn(e,t,i){var s=this.columnManager.findColumn(e),o=this.columnManager.findColumn(t);this.initGuard(),s?o?this.columnManager.moveColumn(s,o,i):console.warn("Move Error - No matching column found:",o):console.warn("Move Error - No matching column found:",e)}scrollToColumn(e,t,i){return new Promise(((s,o)=>{var n=this.columnManager.findColumn(e);return n?this.columnManager.scrollToColumn(n,t,i):(console.warn("Scroll Error - No matching column found:",e),Promise.reject("Scroll Error - No matching column found"))}))}redraw(e){this.initGuard(),this.columnManager.redraw(e),this.rowManager.redraw(e)}setHeight(e){this.options.height=isNaN(e)?e:e+"px",this.element.style.height=this.options.height,this.rowManager.initializeRenderer(),this.rowManager.redraw()}on(e,t){this.externalEvents.subscribe(e,t)}off(e,t){this.externalEvents.unsubscribe(e,t)}dispatchEvent(){Array.from(arguments).shift(),this.externalEvents.dispatch(...arguments)}alert(e,t){this.initGuard(),this.alertManager.alert(e,t)}clearAlert(){this.initGuard(),this.alertManager.clear()}modExists(e,t){return!!this.modules[e]||(t&&console.error("Tabulator Module Not Installed: "+e),!1)}module(e){var t=this.modules[e];return t||console.error("Tabulator module not installed: "+e),t}}Ne.defaultOptions={debugEventsExternal:!1,debugEventsInternal:!1,debugInvalidOptions:!0,debugInvalidComponentFuncs:!0,debugInitialization:!0,debugDeprecation:!0,height:!1,minHeight:!1,maxHeight:!1,columnHeaderVertAlign:"top",popupContainer:!1,columns:[],columnDefaults:{},data:!1,autoColumns:!1,autoColumnsDefinitions:!1,nestedFieldSeparator:".",footerElement:!1,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:!0,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:!0,scrollToColumnPosition:"left",scrollToColumnIfVisible:!0,rowFormatter:!1,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:!1,dataLoader:!0,dataLoaderLoading:!1,dataLoaderError:!1,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{}},new Ie(Ne);class We extends Ne{}new Ie(We,be);class je{constructor(e){this.type=e,this.element=this._createElement()}_createElement(){var e=document.createElement("div");return e.classList.add("tabulator-row"),e}getElement(){return this.element}getComponent(){return!1}getData(){return{}}getHeight(){return this.element.outerHeight}initialize(){}reinitialize(){}normalizeHeight(){}generateCells(){}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}}export{o as AccessorModule,d as AjaxModule,u as CalcComponent,m as CellComponent,c as ClipboardModule,E as ColumnCalcsModule,g as ColumnComponent,y as DataTreeModule,x as DownloadModule,k as EditModule,P as ExportModule,F as FilterModule,A as FormatModule,_ as FrozenColumnsModule,O as FrozenRowsModule,B as GroupComponent,V as GroupRowsModule,N as HistoryModule,W as HtmlTableImportModule,G as ImportModule,U as InteractionModule,X as KeybindingsModule,q as MenuModule,s as Module,K as MoveColumnsModule,J as MoveRowsModule,Y as MutatorModule,Z as PageModule,te as PersistenceModule,ie as PopupModule,se as PrintModule,je as PseudoRow,oe as ReactiveDataModule,ve as Renderer,ne as ResizeColumnsModule,re as ResizeRowsModule,ae as ResizeTableModule,le as ResponsiveLayoutModule,v as RowComponent,he as SelectRowModule,ue as SortModule,Ne as Tabulator,We as TabulatorFull,me as TooltipModule,ge as ValidateModule}; //# sourceMappingURL=tabulator_esm.min.js.map diff --git a/dist/js/tabulator_esm.min.js.map b/dist/js/tabulator_esm.min.js.map index 7da1311f8..7588804e5 100644 --- a/dist/js/tabulator_esm.min.js.map +++ b/dist/js/tabulator_esm.min.js.map @@ -1 +1 @@ -{"version":3,"file":"tabulator_esm.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/column/Column.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/core/TabulatorFull.js","../../src/js/core/row/PseudoRow.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ?\r\n\t\tthis.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.element.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.element.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t\t\r\n\t\t\t// clear empty table placeholder min\r\n\t\t\tthis.tableElement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;","export default class PseudoRow {\r\n\r\n\tconstructor (type){\r\n\t\tthis.type = type;\r\n\t\tthis.element = this._createElement();\r\n\t}\r\n\r\n\t_createElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetComponent(){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn {};\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.element.outerHeight;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\treinitialize(){}\r\n\r\n\tnormalizeHeight(){}\r\n\r\n\tgenerateCells(){}\r\n\r\n\treinitializeHeight(){}\r\n\r\n\tcalcHeight(){}\r\n\r\n\tsetCellHeight(){}\r\n\r\n\tclearCellHeight(){}\r\n}"],"names":["CoreFeature","[object Object]","table","this","data","silent","columnsChanged","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","Helpers","el","offsetWidth","offsetHeight","box","getBoundingClientRect","top","window","pageYOffset","document","documentElement","clientTop","left","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","i","Object","assign","Array","isArray","match","copy","subject","findIndex","item","unshift","deepClone","Popup","element","parent","super","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","visible","hideable","classList","add","blurEvent","hide","escEvent","_escapeCheck","destroyBinding","tableDestroyed","destroyed","popupContainer","querySelector","console","warn","_checkContainerIsParent","body","parentNode","callback","e","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","elOffset","position","containerOffset","offset","origin","parentEl","coords","HTMLElement","elementPositionCoords","containerEventCoords","style","appendChild","_fitToScreen","addEventListener","stopPropagation","scrollTop","right","Math","max","scrollHeight","parseInt","setTimeout","rowManager","keyCode","removeEventListener","removeChild","Module","name","_handler","optionsList","register","columnManager","func","args","initGuard","component","handler","componentFunctionBinder","priority","registerDataPipelineHandler","registerDisplayPipelineHandler","adjust","lookupIndex","index","displayRows","length","displayPipeline","getDisplayRows","activeRows","renderInPosition","refreshActiveData","footerManager","append","prepend","remove","menuEl","menuContainer","content","type","alertManager","alert","clear","Accessor","allowedTypes","registerColumnOption","initializeColumn","transformRow","column","config","forEach","accessor","charAt","toUpperCase","slice","definition","lookupAccessor","params","accessors","row","rowComponent","getComponent","traverse","colComponent","getFieldValue","setFieldValue","moduleName","generateParamsList","prefix","output","concat","push","serializeParams","encoded","encodeURIComponent","join","url","keys","method","toLowerCase","includes","json","headers","Content-Type","JSON","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","registerTableOption","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","registerTableFunction","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","call","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","then","ajaxResponse","Promise","reject","contentType","resolve","ajaxContentType","Accept","mode","location","credentials","fetch","response","ok","catch","error","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","export","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","setData","originalEvent","dispatchExternal","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","rowData","columns","col","getKey","range","internal","sel","textRange","getSelection","createRange","selectNodeContents","toString","removeAllRanges","addRange","selection","createTextRange","moveToElementText","select","execCommand","action","pasteActions","parser","pasteParsers","rows","checkPaseOrigin","getPasteData","modExists","mutateData","mutator","valid","target","tagName","edit","currentCell","getData","replace","update","updateOrAddData","insert","addData","headerFindSuccess","columnMap","split","find","title","trim","field","columnsByIndex","shift","CalcComponent","_row","Proxy","get","receiver","handle","transform","getElement","cells","getCells","cell","getCell","CellComponent","_cell","getValue","getOldValue","initialValue","getField","mutate","setValue","setValueActual","checkHeight","Cell","oldValue","height","width","minWidth","loaded","build","generateElement","setWidth","_configureCell","createElement","className","setAttribute","textAlign","hozAlign","vertAlign","display","alignItems","bottom","middle","justifyContent","center","cssClass","val","innerHTML","Node","firstChild","containerOnly","layoutElement","setValueProcessData","cellRendered","cellEdited","subscribedExternal","changed","_generateContents","widthStyled","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","redrawBlock","deleteCell","calcs","getCellIndex","ColumnComponent","_column","getDefinition","getTitleDownload","isGroup","show","delete","Column","scrollToColumn","to","after","toColumn","findColumn","moveColumn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","result","reinitializeWidth","rerenderColumns","maxInitialWidth","variableHeight","headerVertical","headerHozAlign","editableTitle","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","widthFixed","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","columnHeaderVertAlign","defaults","columnDefaults","generate","defaultOptionList","indexOf","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","setMinWidth","setMaxWidth","_buildColumnHeaderTitle","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","floor","clientWidth","min","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","addColumn","defaultOptions","RowComponent","getPosition","watchPosition","scrollToRow","moveToRow","updateData","normalizeHeight","reinitialize","nextRow","prevRow","Row","manualHeight","outerHeight","initialized","positionWatchers","created","create","generateCells","deleteCells","renderer","renderRowCells","rowFormatter","rerenderRowCells","children","initialize","maxHeight","rowHeight","resizableRows","getHeight","setHeight","clearHeight","updatedData","newRowData","elVisible","tempData","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","before","toRow","findRow","moveRowActual","deleteActual","blockRedraw","detachModules","deleteRow","isDisplayed","group","avg","values","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","count","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","topRow","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","scrollHorizontal","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","visibleRows","getResults","userRecalc","recalc","redraw","viewable","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","adjustTableSize","insertBefore","headersElement","nextSibling","footerPrepend","rtl","marginRight","marginLeft","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","pos","disable","enable","format","formatter","getFormatter","paramKey","results","getGroups","getGroupResults","groupObj","_getSelf","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","initializeRow","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","getRows","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","paddingRight","getComputedStyle","getPropertyValue","paddingLeft","oldControl","replaceChild","getChildren","allChildren","generateChildren","dataTreeFilter","filter","dataTreeSort","sort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","a","b","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","active","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","navigator","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","placeholder","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","startsWith","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","map","_parseListItem","option","level","_parseListGroup","itemParams","selected","original","sorter","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","test","_defaultFilterFunc","_filterItem","matches","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","resize","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","number","step","blurFunc","date","inputFormat","DT","DateTime","luxon","convertDate","isDateTime","fromISO","fromFormat","toFormat","time","newDatetime","datetime","deprecationMsg","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","browser","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","addRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","topEdge","bottomEdge","rowEl","offsetTop","leftEdge","scrollLeft","rightEdge","leftMargin","rightMargin","renderHorizontal","vDomPadLeft","offsetLeft","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","getVisibleRows","selectRow","selectedRows","pagination","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","holder","htmlOutputConfig","from","props","lookup","background-color","color","font-weight","font-family","font-size","text-align","border-top","border-left","border-right","border-bottom","padding-top","padding-left","padding-right","padding-bottom","fromStyle","prop","=","filterVal","rowVal","filterParams","<","<=",">",">=","!=","regex","RegExp","like","keywords","separator","keyword","matchAll","starts","ends","endsWith","in","Filter","filterList","headerFilters","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","headerFilterPlaceholder","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","langText","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","abs","link","urlPrefix","labelField","labelTraverse","path","urlField","image","src","urlSuffix","empty","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","datetimediff","suffix","humanize","now","diff","toHuman","traffic","percentValue","colors","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","innerText","responsiveCollapse","responsiveLayout","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","&","\"","'","/","`","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","margin","edge","frozenCheck","frozen","calcMargins","layoutColumnPosition","layoutCalcRows","reinitializeRows","scroll","_calcSpace","tableElement","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","styleRow","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","old","elementContents","arrowElement","createElements","addBindings","createValueGroups","wipe","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","toIndex","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","lang","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","moveRowInArray","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","onlyGroupHeaders","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","getRowIndex","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","addRowActual","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","originalElement","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","attributes","optionsArr","attrib","_attribValue","exists","_findCol","textContent","registeredDefaults","inQuote","nextChar","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","autoColumns","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscriptionChanged","added","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","dispatchEvent","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","bindings","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","binding","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","displayRowsCount","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","colEl","mousemove","which","startMove","bindTouchEvents","nextColWidth","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","moveColumnActual","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connection","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connections","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","query","prototype","querySelectorAll","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromRow","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","links","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","visibility","generatePageSizeSelectList","setPageSize","dir","loading","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","start","end","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","finally","last_page","last_row","addRows","progressiveLoadDelay","footer","containerElement","scrollWidth","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retrievedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","setColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","definitions","excludedKeys","defStore","colDef","moduleInitOrder","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","reactiveData","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","apply","getRowFromDataObject","pop","startRow","newRows","reverse","oldRows","reRenderInPosition","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","colWidth","browserSlow","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","tableWidth","containerHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","browserMobile","nodeHeight","contentRect","nodeWidth","redrawTable","observe","fixedHeight","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","layoutMode","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","responsive","order","generateCollapsedContent","colCount","working","getFlexBaseWidth","headerVisible","hideColumn","showColumn","activeRowsCount","renderEmptyScroll","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","getDisplayRowIndex","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","locale","langLocale","localeCompare","boolean","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","float","numeric","minLength","maxLength","unique","cellData","required","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","OptionsList","msgType","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","verticalFillMode","includingBuffer","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","ifVisible","rowIndex","scrollToRowIfVisible","scrollToRowPosition","scrollToRowNearestTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","vDomScrollPosLeft","vDomScrollPosRight","vDomPadRight","fitDataColAvg","windowBuffer","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","clearVisRowCache","dataChange","buffer","cols","colPos","calcWindowBuffer","leftPos","rightPos","fitDataCheck","vdomHoz","reinitChanged","reinitializeRow","change","colEnd","layoutRefresh","addColRight","removeColLeft","addColLeft","removeColRight","changes","fitDataColActualWidthCheck","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","columnsByField","defaultColumnOptions","redrawBlockUpdate","initializeRenderer","createHeadersElement","createHeaderElement","renderClass","renderers","virtual","RendererVirtualDomHorizontal","basic","RendererBasicHorizontal","hozAdjust","scrollColumns","autoColumnsDefinitions","_addColumn","_reIndexColumns","nextToColumn","topColumn","parentIndex","nextEl","root","structured","_moveColumnInArray","getComponents","updateRows","fromIndex","scrollToColumnPosition","scrollToColumnIfVisible","generateCell","totalWidth","fixedWidth","resetScroll","BasicVertical","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topFound","bottomRow","forceMove","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","activeRowsPipeline","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","_setDataActual","generateColumnsFromRowData","_wipeElements","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","findAddRowPos","_clearPlaceholder","addRowPos","chainResult","findRowIndex","rowOnly","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","initialHeight","otherHeight","external","event","createEvent","initEvent","Event","FooterManager","createContainerElement","initializeElement","footerElement","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","tabulator-cell","tabulator-row","tabulator-group","tabulator-col","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","comp","clearWatchers","bindPseudoEvents","updateEventListeners","track","composedPath","targets","findTargets","bindComponents","triggerEvents","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","funcName","debugInvalidComponentFuncs","DataLoader","requestOrder","requestNo","alertLoader","mapParams","dataSendParams","objectInvert","dataReceiveParams","clearAlert","alertError","dataLoaderErrorTimeout","dataLoaderLoading","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","callResult","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","matchElement","Tabulator","lookupTable","forced","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","modes","dataChanged","defaultModes","Localize","langList","langs","setHeaderFilterPlaceholder","installLang","setLocale","getLang","default","_setLangProp","desiredLocale","language","traverseLang","trans","_executeBindings","pathArray","_getLangElement","rootPath","page_size","page_title","first","first_title","last","last_title","prev_title","next","next_title","showing","of","Comms","receive","selectors","con","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","textDirection","direction","newElement","_detectBrowser","deregister","ua","userAgent","vendor","opera","stack","line","debugInitialization","Error","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","getRowFromPosition","foundRows","getDefinitionTree","fromColumn","plugin","debugDeprecation","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","TabulatorFull","PseudoRow","_createElement"],"mappings":";AAAe,MAAMA,EAEpBC,YAAYC,GACXC,KAAKD,MAAQA,EAOdD,WAAWG,EAAMC,EAAQC,GACxB,OAAOH,KAAKD,MAAMK,WAAWC,KAAKJ,OAAMK,OAAWA,OAAWA,EAAWJ,EAAQC,GAOlFL,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASC,WAAWC,WAG/CZ,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASG,QAAQD,WAG5CZ,aACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASI,aAAaF,WAQjDZ,mBACC,OAAO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9C,EAGRzC,aACC,OAAOE,KAAKwE,QAGb1E,eACC,OAAO,EAGRA,UACC,MAAO,GAGRA,YACC,OAAOE,KAAKwE,QAAQ6c,YAGrBvhB,cAEAA,gBAEAA,mBAEAA,iBAEAA,sBAEAA,cAEAA,iBAEAA"} \ No newline at end of file +{"version":3,"file":"tabulator_esm.min.js","sources":["../../src/js/core/CoreFeature.js","../../src/js/core/tools/Helpers.js","../../src/js/core/tools/Popup.js","../../src/js/core/Module.js","../../src/js/modules/Accessor/Accessor.js","../../src/js/modules/Accessor/defaults/accessors.js","../../src/js/modules/Ajax/defaults/urlGenerator.js","../../src/js/modules/Ajax/defaults/contentTypeFormatters.js","../../src/js/modules/Ajax/Ajax.js","../../src/js/modules/Ajax/defaults/config.js","../../src/js/modules/Ajax/defaults/loaderPromise.js","../../src/js/modules/Clipboard/Clipboard.js","../../src/js/modules/Clipboard/defaults/pasteActions.js","../../src/js/modules/Clipboard/defaults/pasteParsers.js","../../src/js/modules/ColumnCalcs/CalcComponent.js","../../src/js/core/cell/CellComponent.js","../../src/js/core/cell/Cell.js","../../src/js/core/column/ColumnComponent.js","../../src/js/core/column/defaults/options.js","../../src/js/core/column/Column.js","../../src/js/core/row/RowComponent.js","../../src/js/core/row/Row.js","../../src/js/modules/ColumnCalcs/defaults/calculations.js","../../src/js/modules/ColumnCalcs/ColumnCalcs.js","../../src/js/modules/DataTree/DataTree.js","../../src/js/modules/Download/defaults/downloaders.js","../../src/js/modules/Download/defaults/downloaders/csv.js","../../src/js/modules/Download/defaults/downloaders/json.js","../../src/js/modules/Download/defaults/downloaders/jsonLines.js","../../src/js/modules/Download/defaults/downloaders/pdf.js","../../src/js/modules/Download/defaults/downloaders/xlsx.js","../../src/js/modules/Download/defaults/downloaders/html.js","../../src/js/modules/Download/Download.js","../../src/js/modules/Edit/inputMask.js","../../src/js/modules/Edit/List.js","../../src/js/modules/Edit/defaults/editors.js","../../src/js/modules/Edit/defaults/editors/input.js","../../src/js/modules/Edit/defaults/editors/textarea.js","../../src/js/modules/Edit/defaults/editors/number.js","../../src/js/modules/Edit/defaults/editors/range.js","../../src/js/modules/Edit/defaults/editors/date.js","../../src/js/modules/Edit/defaults/editors/time.js","../../src/js/modules/Edit/defaults/editors/datetime.js","../../src/js/modules/Edit/defaults/editors/select.js","../../src/js/modules/Edit/defaults/editors/list.js","../../src/js/modules/Edit/defaults/editors/autocomplete.js","../../src/js/modules/Edit/defaults/editors/star.js","../../src/js/modules/Edit/defaults/editors/progress.js","../../src/js/modules/Edit/defaults/editors/tickCross.js","../../src/js/modules/Edit/Edit.js","../../src/js/modules/Export/ExportRow.js","../../src/js/modules/Export/ExportColumn.js","../../src/js/modules/Export/Export.js","../../src/js/modules/Filter/defaults/filters.js","../../src/js/modules/Filter/Filter.js","../../src/js/modules/Format/defaults/formatters.js","../../src/js/modules/Format/defaults/formatters/plaintext.js","../../src/js/modules/Format/defaults/formatters/html.js","../../src/js/modules/Format/defaults/formatters/textarea.js","../../src/js/modules/Format/defaults/formatters/money.js","../../src/js/modules/Format/defaults/formatters/link.js","../../src/js/modules/Format/defaults/formatters/image.js","../../src/js/modules/Format/defaults/formatters/tickCross.js","../../src/js/modules/Format/defaults/formatters/datetime.js","../../src/js/modules/Format/defaults/formatters/datetimediff.js","../../src/js/modules/Format/defaults/formatters/lookup.js","../../src/js/modules/Format/defaults/formatters/star.js","../../src/js/modules/Format/defaults/formatters/traffic.js","../../src/js/modules/Format/defaults/formatters/progress.js","../../src/js/modules/Format/defaults/formatters/color.js","../../src/js/modules/Format/defaults/formatters/buttonTick.js","../../src/js/modules/Format/defaults/formatters/buttonCross.js","../../src/js/modules/Format/defaults/formatters/rownum.js","../../src/js/modules/Format/defaults/formatters/handle.js","../../src/js/modules/Format/defaults/formatters/responsiveCollapse.js","../../src/js/modules/Format/defaults/formatters/rowSelection.js","../../src/js/modules/Format/Format.js","../../src/js/modules/FrozenColumns/FrozenColumns.js","../../src/js/modules/FrozenRows/FrozenRows.js","../../src/js/modules/GroupRows/GroupComponent.js","../../src/js/modules/GroupRows/Group.js","../../src/js/modules/GroupRows/GroupRows.js","../../src/js/modules/History/History.js","../../src/js/modules/History/defaults/undoers.js","../../src/js/modules/History/defaults/redoers.js","../../src/js/modules/HtmlTableImport/HtmlTableImport.js","../../src/js/modules/Import/defaults/importers.js","../../src/js/modules/Import/defaults/importers/csv.js","../../src/js/modules/Import/defaults/importers/json.js","../../src/js/modules/Import/defaults/importers/array.js","../../src/js/modules/Import/Import.js","../../src/js/modules/Interaction/Interaction.js","../../src/js/modules/Keybindings/Keybindings.js","../../src/js/modules/Keybindings/defaults/bindings.js","../../src/js/modules/Keybindings/defaults/actions.js","../../src/js/modules/Menu/Menu.js","../../src/js/modules/MoveColumns/MoveColumns.js","../../src/js/modules/MoveRows/MoveRows.js","../../src/js/modules/Mutator/Mutator.js","../../src/js/modules/Mutator/defaults/mutators.js","../../src/js/modules/Page/defaults/pageCounters.js","../../src/js/modules/Page/defaults/pageCounters/rows.js","../../src/js/modules/Page/defaults/pageCounters/pages.js","../../src/js/modules/Page/Page.js","../../src/js/modules/Persistence/defaults/readers.js","../../src/js/modules/Persistence/defaults/writers.js","../../src/js/modules/Persistence/Persistence.js","../../src/js/modules/Popup/Popup.js","../../src/js/modules/Print/Print.js","../../src/js/modules/ReactiveData/ReactiveData.js","../../src/js/modules/ResizeColumns/ResizeColumns.js","../../src/js/modules/ResizeRows/ResizeRows.js","../../src/js/modules/ResizeTable/ResizeTable.js","../../src/js/modules/ResponsiveLayout/ResponsiveLayout.js","../../src/js/modules/SelectRow/SelectRow.js","../../src/js/modules/Sort/defaults/sorters/datetime.js","../../src/js/modules/Sort/defaults/sorters.js","../../src/js/modules/Sort/defaults/sorters/number.js","../../src/js/modules/Sort/defaults/sorters/string.js","../../src/js/modules/Sort/defaults/sorters/date.js","../../src/js/modules/Sort/defaults/sorters/time.js","../../src/js/modules/Sort/defaults/sorters/boolean.js","../../src/js/modules/Sort/defaults/sorters/array.js","../../src/js/modules/Sort/defaults/sorters/exists.js","../../src/js/modules/Sort/defaults/sorters/alphanum.js","../../src/js/modules/Sort/Sort.js","../../src/js/modules/Tooltip/Tooltip.js","../../src/js/modules/Validate/defaults/validators.js","../../src/js/modules/Validate/Validate.js","../../src/js/core/tools/OptionsList.js","../../src/js/core/rendering/Renderer.js","../../src/js/core/rendering/renderers/BasicHorizontal.js","../../src/js/core/rendering/renderers/VirtualDomHorizontal.js","../../src/js/core/ColumnManager.js","../../src/js/core/rendering/renderers/BasicVertical.js","../../src/js/core/rendering/renderers/VirtualDomVertical.js","../../src/js/core/RowManager.js","../../src/js/core/FooterManager.js","../../src/js/core/tools/InteractionMonitor.js","../../src/js/core/tools/ComponentFunctionBinder.js","../../src/js/core/tools/DataLoader.js","../../src/js/core/tools/ExternalEventBus.js","../../src/js/core/tools/InternalEventBus.js","../../src/js/core/tools/DeprecationAdvisor.js","../../src/js/core/tools/TableRegistry.js","../../src/js/modules/Layout/defaults/modes/fitDataGeneral.js","../../src/js/modules/Layout/defaults/modes.js","../../src/js/modules/Layout/defaults/modes/fitData.js","../../src/js/modules/Layout/defaults/modes/fitDataStretch.js","../../src/js/modules/Layout/defaults/modes/fitColumns.js","../../src/js/modules/Layout/Layout.js","../../src/js/modules/Localize/Localize.js","../../src/js/modules/Localize/defaults/langs.js","../../src/js/modules/Comms/Comms.js","../../src/js/core/tools/ModuleBinder.js","../../src/js/core/tools/Alert.js","../../src/js/core/Tabulator.js","../../src/js/core/defaults/options.js","../../src/js/core/TabulatorFull.js","../../src/js/core/row/PseudoRow.js"],"sourcesContent":["export default class CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// DataLoad /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\treloadData(data, silent, columnsChanged){\r\n\t\treturn this.table.dataLoader.load(data, undefined, undefined, undefined, silent, columnsChanged);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t///////////// Localization ///////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlangText(){\r\n\t\treturn this.table.modules.localize.getText(...arguments);\r\n\t}\r\n\r\n\tlangBind(){\r\n\t\treturn this.table.modules.localize.bind(...arguments);\r\n\t}\r\n\r\n\tlangLocale(){\r\n\t\treturn this.table.modules.localize.getLocale(...arguments);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t////////// Inter Table Comms /////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tcommsConnections(){\r\n\t\treturn this.table.modules.comms.getConnections(...arguments);\r\n\t}\r\n\r\n\tcommsSend(){\r\n\t\treturn this.table.modules.comms.send(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Layout /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tlayoutMode(){\r\n\t\treturn this.table.modules.layout.getMode();\r\n\t}\r\n\r\n\tlayoutRefresh(force){\r\n\t\treturn this.table.modules.layout.layout(force);\r\n\t}\r\n\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////////// Event Bus ////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tsubscribe(){\r\n\t\treturn this.table.eventBus.subscribe(...arguments);\r\n\t}\r\n\r\n\tunsubscribe(){\r\n\t\treturn this.table.eventBus.unsubscribe(...arguments);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.table.eventBus.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChange(){\r\n\t\treturn this.table.eventBus.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\tdispatch(){\r\n\t\treturn this.table.eventBus.dispatch(...arguments);\r\n\t}\r\n\r\n\tchain(){\r\n\t\treturn this.table.eventBus.chain(...arguments);\r\n\t}\r\n\r\n\tconfirm(){\r\n\t\treturn this.table.eventBus.confirm(...arguments);\r\n\t}\r\n\r\n\tdispatchExternal(){\r\n\t\treturn this.table.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\tsubscribedExternal(key){\r\n\t\treturn this.table.externalEvents.subscribed(key);\r\n\t}\r\n\r\n\tsubscriptionChangeExternal(){\r\n\t\treturn this.table.externalEvents.subscriptionChange(...arguments);\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t//////////////// Options /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\toptions(key){\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\tsetOption(key, value){\r\n\t\tif(typeof value !== \"undefined\"){\r\n\t\t\tthis.table.options[key] = value;\r\n\t\t}\r\n\r\n\t\treturn this.table.options[key];\r\n\t}\r\n\r\n\t//////////////////////////////////////////\r\n\t/////////// Deprecation Checks ///////////\r\n\t//////////////////////////////////////////\r\n\r\n\tdeprecationCheck(oldOption, newOption){\r\n\t\treturn this.table.deprecationAdvisor.check(oldOption, newOption);\r\n\t}\r\n\r\n\tdeprecationCheckMsg(oldOption, msg){\r\n\t\treturn this.table.deprecationAdvisor.checkMsg(oldOption, msg);\r\n\t}\r\n\r\n\tdeprecationMsg(msg){\r\n\t\treturn this.table.deprecationAdvisor.msg(msg);\r\n\t}\r\n\t//////////////////////////////////////////\r\n\t//////////////// Modules /////////////////\r\n\t//////////////////////////////////////////\r\n\r\n\tmodule(key){\r\n\t\treturn this.table.module(key);\r\n\t}\r\n}","export default class Helpers{\r\n\r\n\tstatic elVisible(el){\r\n\t\treturn !(el.offsetWidth <= 0 && el.offsetHeight <= 0);\r\n\t}\r\n\r\n\tstatic elOffset(el){\r\n\t\tvar box = el.getBoundingClientRect();\r\n\r\n\t\treturn {\r\n\t\t\ttop: box.top + window.pageYOffset - document.documentElement.clientTop,\r\n\t\t\tleft: box.left + window.pageXOffset - document.documentElement.clientLeft\r\n\t\t};\r\n\t}\r\n\r\n\tstatic deepClone(obj, clone, list = []){\r\n\t\tvar objectProto = {}.__proto__,\r\n\t\tarrayProto = [].__proto__;\r\n\r\n\t\tif (!clone){\r\n\t\t\tclone = Object.assign(Array.isArray(obj) ? [] : {}, obj);\r\n\t\t}\r\n\r\n\t\tfor(var i in obj) {\r\n\t\t\tlet subject = obj[i],\r\n\t\t\tmatch, copy;\r\n\r\n\t\t\tif(subject != null && typeof subject === \"object\" && (subject.__proto__ === objectProto || subject.__proto__ === arrayProto)){\r\n\t\t\t\tmatch = list.findIndex((item) => {\r\n\t\t\t\t\treturn item.subject === subject;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(match > -1){\r\n\t\t\t\t\tclone[i] = list[match].copy;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcopy = Object.assign(Array.isArray(subject) ? [] : {}, subject);\r\n\r\n\t\t\t\t\tlist.unshift({subject, copy});\r\n\r\n\t\t\t\t\tclone[i] = this.deepClone(subject, copy, list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn clone;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from './Helpers.js';\r\n\r\nexport default class Popup extends CoreFeature{\r\n\tconstructor(table, element, parent){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = element;\r\n\t\tthis.container = this._lookupContainer();\r\n \r\n\t\tthis.parent = parent;\r\n \r\n\t\tthis.reversedX = false;\r\n\t\tthis.childPopup = null;\r\n\t\tthis.blurable = false;\r\n\t\tthis.blurCallback = null;\r\n\t\tthis.renderedCallback = null;\r\n \r\n\t\tthis.visible = false;\r\n\t\tthis.hideable = true;\r\n \r\n\t\tthis.element.classList.add(\"tabulator-popup-container\");\r\n \r\n\t\tthis.blurEvent = this.hide.bind(this, false);\r\n\t\tthis.escEvent = this._escapeCheck.bind(this);\r\n\r\n\t\tthis.destroyBinding = this.tableDestroyed;\r\n\t\tthis.destroyed = false;\r\n\t}\r\n\r\n\ttableDestroyed(){\r\n\t\tthis.destroyed = true;\r\n\t\tthis.hide(true);\r\n\t}\r\n \r\n\t_lookupContainer(){\r\n\t\tvar container = this.table.options.popupContainer;\r\n \r\n\t\tif(typeof container === \"string\"){\r\n\t\t\tcontainer = document.querySelector(container);\r\n \r\n\t\t\tif(!container){\r\n\t\t\t\tconsole.warn(\"Menu Error - no container element found matching selector:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t\t}\r\n\t\t}else if (container === true){\r\n\t\t\tcontainer = this.table.element;\r\n\t\t}\r\n \r\n\t\tif(container && !this._checkContainerIsParent(container)){\r\n\t\t\tcontainer = false;\r\n\t\t\tconsole.warn(\"Menu Error - container element does not contain this table:\", this.table.options.popupContainer , \"(defaulting to document body)\");\r\n\t\t}\r\n \r\n\t\tif(!container){\r\n\t\t\tcontainer = document.body;\r\n\t\t}\r\n \r\n\t\treturn container;\r\n\t}\r\n \r\n\t_checkContainerIsParent(container, element = this.table.element){\r\n\t\tif(container === element){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn element.parentNode ? this._checkContainerIsParent(container, element.parentNode) : false;\r\n\t\t}\r\n\t}\r\n \r\n\trenderCallback(callback){\r\n\t\tthis.renderedCallback = callback;\r\n\t}\r\n \r\n\tcontainerEventCoords(e){\r\n\t\tvar touch = !(e instanceof MouseEvent);\r\n \r\n\t\tvar x = touch ? e.touches[0].pageX : e.pageX;\r\n\t\tvar y = touch ? e.touches[0].pageY : e.pageY;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tlet parentOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\tx -= parentOffset.left;\r\n\t\t\ty -= parentOffset.top;\r\n\t\t}\r\n \r\n\t\treturn {x, y};\r\n\t}\r\n \r\n\telementPositionCoords(element, position = \"right\"){\r\n\t\tvar offset = Helpers.elOffset(element),\r\n\t\tcontainerOffset, x, y;\r\n \r\n\t\tif(this.container !== document.body){\r\n\t\t\tcontainerOffset = Helpers.elOffset(this.container);\r\n \r\n\t\t\toffset.left -= containerOffset.left;\r\n\t\t\toffset.top -= containerOffset.top;\r\n\t\t}\r\n \r\n\t\tswitch(position){\r\n\t\t\tcase \"right\":\r\n\t\t\t\tx = offset.left + element.offsetWidth;\r\n\t\t\t\ty = offset.top - 1;\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tx = offset.left;\r\n\t\t\t\ty = offset.top + element.offsetHeight;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n \r\n\t\treturn {x, y, offset};\r\n\t}\r\n \r\n\tshow(origin, position){\r\n\t\tvar x, y, parentEl, parentOffset, coords;\r\n\r\n\t\tif(this.destroyed || this.table.destroyed){\r\n\t\t\treturn this;\r\n\t\t}\r\n \r\n\t\tif(origin instanceof HTMLElement){\r\n\t\t\tparentEl = origin;\r\n\t\t\tcoords = this.elementPositionCoords(origin, position);\r\n \r\n\t\t\tparentOffset = coords.offset;\r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t}else if(typeof origin === \"number\"){\r\n\t\t\tparentOffset = {top:0, left:0};\r\n\t\t\tx = origin;\r\n\t\t\ty = position;\r\n\t\t}else{\r\n\t\t\tcoords = this.containerEventCoords(origin);\r\n \r\n\t\t\tx = coords.x;\r\n\t\t\ty = coords.y;\r\n \r\n\t\t\tthis.reversedX = false;\r\n\t\t}\r\n \r\n\t\tthis.element.style.top = y + \"px\";\r\n\t\tthis.element.style.left = x + \"px\";\r\n \r\n\t\tthis.container.appendChild(this.element);\r\n \r\n\t\tif(typeof this.renderedCallback === \"function\"){\r\n\t\t\tthis.renderedCallback();\r\n\t\t}\r\n \r\n\t\tthis._fitToScreen(x, y, parentEl, parentOffset, position);\r\n \r\n\t\tthis.visible = true;\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.destroyBinding);\r\n\r\n\t\tthis.element.addEventListener(\"mousedown\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_fitToScreen(x, y, parentEl, parentOffset, position){\r\n\t\tvar scrollTop = this.container === document.body ? document.documentElement.scrollTop : this.container.scrollTop;\r\n\r\n\t\t//move menu to start on right edge if it is too close to the edge of the screen\r\n\t\tif((x + this.element.offsetWidth) >= this.container.offsetWidth || this.reversedX){\r\n\t\t\tthis.element.style.left = \"\";\r\n \r\n\t\t\tif(parentEl){\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - parentOffset.left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.right = (this.container.offsetWidth - x) + \"px\";\r\n\t\t\t}\r\n \r\n\t\t\tthis.reversedX = true;\r\n\t\t}\r\n\r\n\t\t//move menu to start on bottom edge if it is too close to the edge of the screen\r\n\t\tif((y + this.element.offsetHeight) > Math.max(this.container.offsetHeight, scrollTop ? this.container.scrollHeight : 0)) {\r\n\t\t\tif(parentEl){\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"bottom\":\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight - parentEl.offsetHeight - 1) + \"px\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight + parentEl.offsetHeight + 1) + \"px\";\r\n\t\t\t\t}\r\n \r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.top = (parseInt(this.element.style.top) - this.element.offsetHeight) + \"px\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n \r\n\tisVisible(){\r\n\t\treturn this.visible;\r\n\t}\r\n \r\n\thideOnBlur(callback){\r\n\t\tthis.blurable = true;\r\n \r\n\t\tif(this.visible){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.table.rowManager.element.addEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.subscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.addEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tdocument.body.addEventListener(\"keydown\", this.escEvent);\r\n\r\n\t\t\t}, 100);\r\n \r\n\t\t\tthis.blurCallback = callback;\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\t_escapeCheck(e){\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\tblockHide(){\r\n\t\tthis.hideable = false;\r\n\t}\r\n\r\n\trestoreHide(){\r\n\t\tthis.hideable = true;\r\n\t}\r\n \r\n\thide(silent = false){\r\n\t\tif(this.visible && this.hideable){\r\n\t\t\tif(this.blurable){\r\n\t\t\t\tdocument.body.removeEventListener(\"keydown\", this.escEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"click\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"contextmenu\", this.blurEvent);\r\n\t\t\t\tdocument.body.removeEventListener(\"mousedown\", this.blurEvent);\r\n\t\t\t\twindow.removeEventListener(\"resize\", this.blurEvent);\r\n\t\t\t\tthis.table.rowManager.element.removeEventListener(\"scroll\", this.blurEvent);\r\n\t\t\t\tthis.unsubscribe(\"cell-editing\", this.blurEvent);\r\n\t\t\t}\r\n \r\n\t\t\tif(this.childPopup){\r\n\t\t\t\tthis.childPopup.hide();\r\n\t\t\t}\r\n \r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.childPopup = null;\r\n\t\t\t}\r\n \r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tif(this.blurCallback && !silent){\r\n\t\t\t\tthis.blurCallback();\r\n\t\t\t}\r\n\r\n\t\t\tthis.unsubscribe(\"table-destroy\", this.destroyBinding);\r\n\t\t}\r\n \r\n\t\treturn this;\r\n\t}\r\n \r\n\tchild(element){\r\n\t\tif(this.childPopup){\r\n\t\t\tthis.childPopup.hide();\r\n\t\t}\r\n \r\n\t\tthis.childPopup = new Popup(this.table, element, this);\r\n \r\n\t\treturn this.childPopup;\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Popup from './tools/Popup.js';\r\n\r\nclass Module extends CoreFeature{\r\n\t\r\n\tconstructor(table, name){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis._handler = null;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\t// setup module when table is initialized, to be overridden in module\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Options Registration ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableOption(key, value){\r\n\t\tthis.table.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\tregisterColumnOption(key, value){\r\n\t\tthis.table.columnManager.optionsList.register(key, value);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t/// Public Function Registration ///\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterTableFunction(name, func){\r\n\t\tif(typeof this.table[name] === \"undefined\"){\r\n\t\t\tthis.table[name] = (...args) => {\r\n\t\t\t\tthis.table.initGuard(name);\r\n\t\t\t\t\r\n\t\t\t\treturn func(...args);\r\n\t\t\t};\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Unable to bind table function, name already in use\", name);\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterComponentFunction(component, func, handler){\r\n\t\treturn this.table.componentFunctionBinder.bind(component, func, handler);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Data Pipeline //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tregisterDataHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDataPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tregisterDisplayHandler(handler, priority){\r\n\t\tthis.table.rowManager.registerDisplayPipelineHandler(handler, priority);\r\n\t\tthis._handler = handler;\r\n\t}\r\n\t\r\n\tdisplayRows(adjust){\r\n\t\tvar index = this.table.rowManager.displayRows.length - 1, \r\n\t\tlookupIndex;\r\n\t\t\r\n\t\tif(this._handler){\r\n\t\t\tlookupIndex = this.table.rowManager.displayPipeline.findIndex((item) => {\r\n\t\t\t\treturn item.handler === this._handler;\r\n\t\t\t});\r\n\r\n\t\t\tif(lookupIndex > -1){\r\n\t\t\t\tindex = lookupIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(adjust){\r\n\t\t\tindex = index + adjust;\r\n\t\t}\r\n\r\n\t\tif(this._handler){\r\n\t\t\tif(index > -1){\r\n\t\t\t\treturn this.table.rowManager.getDisplayRows(index);\r\n\t\t\t}else{\r\n\t\t\t\treturn this.activeRows();\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tactiveRows(){\r\n\t\treturn this.table.rowManager.activeRows;\r\n\t}\r\n\t\r\n\trefreshData(renderInPosition, handler){\r\n\t\tif(!handler){\r\n\t\t\thandler = this._handler;\r\n\t\t}\r\n\t\t\r\n\t\tif(handler){\r\n\t\t\tthis.table.rowManager.refreshActiveData(handler, false, renderInPosition);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Footer Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tfooterAppend(element){\r\n\t\treturn this.table.footerManager.append(element);\r\n\t}\r\n\t\r\n\tfooterPrepend(element){\r\n\t\treturn this.table.footerManager.prepend(element);\r\n\t}\r\n\t\r\n\tfooterRemove(element){\r\n\t\treturn this.table.footerManager.remove(element);\r\n\t} \r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Popups Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tpopup(menuEl, menuContainer){\r\n\t\treturn new Popup(this.table, menuEl, menuContainer);\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t//////// Alert Management ////////\r\n\t///////////////////////////////////\r\n\t\r\n\talert(content, type){\r\n\t\treturn this.table.alertManager.alert(content, type);\r\n\t}\r\n\t\r\n\tclearAlert(){\r\n\t\treturn this.table.alertManager.clear();\r\n\t}\r\n\t\r\n}\r\n\r\nexport default Module;","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultAccessors from './defaults/accessors.js';\r\n\r\nclass Accessor extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"download\", \"clipboard\", \"print\", \"htmlOutput\"]; //list of accessor types\r\n\r\n\t\tthis.registerColumnOption(\"accessor\");\r\n\t\tthis.registerColumnOption(\"accessorParams\");\r\n\t\tthis.registerColumnOption(\"accessorData\");\r\n\t\tthis.registerColumnOption(\"accessorDataParams\");\r\n\t\tthis.registerColumnOption(\"accessorDownload\");\r\n\t\tthis.registerColumnOption(\"accessorDownloadParams\");\r\n\t\tthis.registerColumnOption(\"accessorClipboard\");\r\n\t\tthis.registerColumnOption(\"accessorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"accessorPrint\");\r\n\t\tthis.registerColumnOption(\"accessorPrintParams\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"accessorHtmlOutputParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-retrieve\", this.transformRow.bind(this));\r\n\t}\r\n\r\n\t//initialize column accessor\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\taccessor;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\taccessor = this.lookupAccessor(column.definition[key]);\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\taccessor:accessor,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.accessor = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupAccessor(value){\r\n\t\tvar accessor = false;\r\n\r\n\t\t//set column accessor\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Accessor.accessors[value]){\r\n\t\t\t\t\taccessor = Accessor.accessors[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Accessor Error - No such accessor found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\taccessor = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn accessor;\r\n\t}\r\n\r\n\t//apply accessor to row\r\n\ttransformRow(row, type){\r\n\t\tvar key = \"accessor\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\trowComponent = row.getComponent();\r\n\r\n\t\t//clone data object with deep copy to isolate internal data from returned result\r\n\t\tvar data = Helpers.deepClone(row.data || {});\r\n\r\n\t\tthis.table.columnManager.traverse(function(column){\r\n\t\t\tvar value, accessor, params, colComponent;\r\n\r\n\t\t\tif(column.modules.accessor){\r\n\r\n\t\t\t\taccessor = column.modules.accessor[key] || column.modules.accessor.accessor || false;\r\n\r\n\t\t\t\tif(accessor){\r\n\t\t\t\t\tvalue = column.getFieldValue(data);\r\n\r\n\t\t\t\t\tif(value != \"undefined\"){\r\n\t\t\t\t\t\tcolComponent = column.getComponent();\r\n\t\t\t\t\t\tparams = typeof accessor.params === \"function\" ? accessor.params(value, data, type, colComponent, rowComponent) : accessor.params;\r\n\t\t\t\t\t\tcolumn.setFieldValue(data, accessor.accessor(value, data, type, params, colComponent, rowComponent));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\n//load defaults\r\nAccessor.moduleName = \"accessor\";\r\nAccessor.accessors = defaultAccessors;\r\n\r\nexport default Accessor;","export default {};","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nfunction serializeParams(params){\r\n\tvar output = generateParamsList(params),\r\n\tencoded = [];\r\n\r\n\toutput.forEach(function(item){\r\n\t\tencoded.push(encodeURIComponent(item.key) + \"=\" + encodeURIComponent(item.value));\r\n\t});\r\n\r\n\treturn encoded.join(\"&\");\r\n}\r\n\r\nexport default function(url, config, params){\r\n\tif(url){\r\n\t\tif(params && Object.keys(params).length){\r\n\t\t\tif(!config.method || config.method.toLowerCase() == \"get\"){\r\n\t\t\t\tconfig.method = \"get\";\r\n\r\n\t\t\t\turl += (url.includes(\"?\") ? \"&\" : \"?\") + serializeParams(params);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn url;\r\n}","function generateParamsList(data, prefix){\r\n\tvar output = [];\r\n\r\n\tprefix = prefix || \"\";\r\n\r\n\tif(Array.isArray(data)){\r\n\t\tdata.forEach((item, i) => {\r\n\t\t\toutput = output.concat(generateParamsList(item, prefix ? prefix + \"[\" + i + \"]\" : i));\r\n\t\t});\r\n\t}else if (typeof data === \"object\"){\r\n\t\tfor (var key in data){\r\n\t\t\toutput = output.concat(generateParamsList(data[key], prefix ? prefix + \"[\" + key + \"]\" : key));\r\n\t\t}\r\n\t}else{\r\n\t\toutput.push({key:prefix, value:data});\r\n\t}\r\n\r\n\treturn output;\r\n}\r\n\r\nexport default {\r\n\t\"json\":{\r\n\t\theaders:{\r\n\t\t\t'Content-Type': 'application/json',\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\t\t\treturn JSON.stringify(params);\r\n\t\t},\r\n\t},\r\n\t\"form\":{\r\n\t\theaders:{\r\n\t\t},\r\n\t\tbody:function(url, config, params){\r\n\r\n\t\t\tvar output = generateParamsList(params),\r\n\t\t\tform = new FormData();\r\n\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tform.append(item.key, item.value);\r\n\t\t\t});\r\n\r\n\t\t\treturn form;\r\n\t\t},\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultConfig from './defaults/config.js';\r\nimport defaultURLGenerator from './defaults/urlGenerator.js';\r\nimport defaultLoaderPromise from './defaults/loaderPromise.js';\r\nimport defaultContentTypeFormatters from './defaults/contentTypeFormatters.js';\r\n\r\nclass Ajax extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.config = {}; //hold config object for ajax request\r\n\t\tthis.url = \"\"; //request URL\r\n\t\tthis.urlGenerator = false;\r\n\t\tthis.params = false; //request parameters\r\n\t\t\r\n\t\tthis.loaderPromise = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxURL\", false); //url for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxURLGenerator\", false);\r\n\t\tthis.registerTableOption(\"ajaxParams\", {}); //params for ajax loading\r\n\t\tthis.registerTableOption(\"ajaxConfig\", \"get\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxContentType\", \"form\"); //ajax request type\r\n\t\tthis.registerTableOption(\"ajaxRequestFunc\", false); //promise function\r\n\t\t\r\n\t\tthis.registerTableOption(\"ajaxRequesting\", function(){});\r\n\t\tthis.registerTableOption(\"ajaxResponse\", false);\r\n\t\t\r\n\t\tthis.contentTypeFormatters = Ajax.contentTypeFormatters;\r\n\t}\r\n\t\r\n\t//initialize setup options\r\n\tinitialize(){\r\n\t\tthis.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;\r\n\t\tthis.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;\r\n\t\t\r\n\t\tif(this.table.options.ajaxURL){\r\n\t\t\tthis.setUrl(this.table.options.ajaxURL);\r\n\t\t}\r\n\r\n\r\n\t\tthis.setDefaultConfig(this.table.options.ajaxConfig);\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getAjaxUrl\", this.getUrl.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"data-loading\", this.requestDataCheck.bind(this));\r\n\t\tthis.subscribe(\"data-params\", this.requestParams.bind(this));\r\n\t\tthis.subscribe(\"data-load\", this.requestData.bind(this));\r\n\t}\r\n\t\r\n\trequestParams(data, config, silent, params){\r\n\t\tvar ajaxParams = this.table.options.ajaxParams;\r\n\t\t\r\n\t\tif(ajaxParams){\r\n\t\t\tif(typeof ajaxParams === \"function\"){\r\n\t\t\t\tajaxParams = ajaxParams.call(this.table);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tparams = Object.assign(params, ajaxParams);\r\n\t\t}\t\t\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\trequestDataCheck(data, params, config, silent){\r\n\t\treturn !!((!data && this.url) || typeof data === \"string\");\r\n\t}\r\n\t\r\n\trequestData(url, params, config, silent, previousData){\r\n\t\tvar ajaxConfig;\r\n\t\t\r\n\t\tif(!previousData && this.requestDataCheck(url)){\r\n\t\t\tif(url){\r\n\t\t\t\tthis.setUrl(url);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tajaxConfig = this.generateConfig(config);\r\n\t\t\t\r\n\t\t\treturn this.sendRequest(this.url, params, ajaxConfig);\r\n\t\t}else{\r\n\t\t\treturn previousData;\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetDefaultConfig(config = {}){\r\n\t\tthis.config = Object.assign({}, Ajax.defaultConfig);\r\n\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tthis.config.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(this.config, config);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//load config object\r\n\tgenerateConfig(config = {}){\r\n\t\tvar ajaxConfig = Object.assign({}, this.config);\r\n\t\t\r\n\t\tif(typeof config == \"string\"){\r\n\t\t\tajaxConfig.method = config;\r\n\t\t}else{\r\n\t\t\tObject.assign(ajaxConfig, config);\r\n\t\t}\r\n\t\t\r\n\t\treturn ajaxConfig;\r\n\t}\r\n\t\r\n\t//set request url\r\n\tsetUrl(url){\r\n\t\tthis.url = url;\r\n\t}\r\n\t\r\n\t//get request url\r\n\tgetUrl(){\r\n\t\treturn this.url;\r\n\t}\r\n\t\r\n\t//send ajax request\r\n\tsendRequest(url, params, config){\r\n\t\tif(this.table.options.ajaxRequesting.call(this.table, url, params) !== false){\r\n\t\t\treturn this.loaderPromise(url, config, params)\r\n\t\t\t\t.then((data)=>{\r\n\t\t\t\t\tif(this.table.options.ajaxResponse){\r\n\t\t\t\t\t\tdata = this.table.options.ajaxResponse.call(this.table, url, params, data);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nAjax.moduleName = \"ajax\";\r\n\r\n//load defaults\r\nAjax.defaultConfig = defaultConfig;\r\nAjax.defaultURLGenerator = defaultURLGenerator;\r\nAjax.defaultLoaderPromise = defaultLoaderPromise;\r\nAjax.contentTypeFormatters = defaultContentTypeFormatters;\r\n\r\nexport default Ajax;","export default {\r\n\tmethod: \"GET\",\r\n};","export default function(url, config, params){\r\n\tvar contentType;\r\n\r\n\treturn new Promise((resolve, reject) => {\r\n\t\t//set url\r\n\t\turl = this.urlGenerator.call(this.table, url, config, params);\r\n\r\n\t\t//set body content if not GET request\r\n\t\tif(config.method.toUpperCase() != \"GET\"){\r\n\t\t\tcontentType = typeof this.table.options.ajaxContentType === \"object\" ? this.table.options.ajaxContentType : this.contentTypeFormatters[this.table.options.ajaxContentType];\r\n\t\t\tif(contentType){\r\n\r\n\t\t\t\tfor(var key in contentType.headers){\r\n\t\t\t\t\tif(!config.headers){\r\n\t\t\t\t\t\tconfig.headers = {};\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof config.headers[key] === \"undefined\"){\r\n\t\t\t\t\t\tconfig.headers[key] = contentType.headers[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconfig.body = contentType.body.call(this, url, config, params);\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Ajax Error - Invalid ajaxContentType value:\", this.table.options.ajaxContentType);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(url){\r\n\t\t\t//configure headers\r\n\t\t\tif(typeof config.headers === \"undefined\"){\r\n\t\t\t\tconfig.headers = {};\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers.Accept === \"undefined\"){\r\n\t\t\t\tconfig.headers.Accept = \"application/json\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.headers[\"X-Requested-With\"] === \"undefined\"){\r\n\t\t\t\tconfig.headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n\t\t\t}\r\n\r\n\t\t\tif(typeof config.mode === \"undefined\"){\r\n\t\t\t\tconfig.mode = \"cors\";\r\n\t\t\t}\r\n\r\n\t\t\tif(config.mode == \"cors\"){\r\n\t\t\t\tif(typeof config.headers[\"Origin\"] === \"undefined\"){\r\n\t\t\t\t\tconfig.headers[\"Origin\"] = window.location.origin;\r\n\t\t\t\t}\r\n \r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'same-origin';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(typeof config.credentials === \"undefined\"){\r\n\t\t\t\t\tconfig.credentials = 'include';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//send request\r\n\t\t\tfetch(url, config)\r\n\t\t\t\t.then((response)=>{\r\n\t\t\t\t\tif(response.ok) {\r\n\t\t\t\t\t\tresponse.json()\r\n\t\t\t\t\t\t\t.then((data)=>{\r\n\t\t\t\t\t\t\t\tresolve(data);\r\n\t\t\t\t\t\t\t}).catch((error)=>{\r\n\t\t\t\t\t\t\t\treject(error);\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\t\treject(response);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\tconsole.error(\"Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\t\treject(error);\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Ajax Load Error - No URL Set\");\r\n\t\t\tresolve([]);\r\n\t\t}\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPasteActions from './defaults/pasteActions.js';\r\nimport defaultPasteParsers from './defaults/pasteParsers.js';\r\n\r\nclass Clipboard extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = true;\r\n\t\tthis.pasteParser = function(){};\r\n\t\tthis.pasteAction = function(){};\r\n\t\tthis.customSelection = false;\r\n\t\tthis.rowRange = false;\r\n\t\tthis.blocked = true; //block copy actions not originating from this command\r\n\r\n\t\tthis.registerTableOption(\"clipboard\", false); //enable clipboard\r\n\t\tthis.registerTableOption(\"clipboardCopyStyled\", true); //formatted table data\r\n\t\tthis.registerTableOption(\"clipboardCopyConfig\", false); //clipboard config\r\n\t\tthis.registerTableOption(\"clipboardCopyFormatter\", false); //DEPRECATED - REMOVE in 5.0\r\n\t\tthis.registerTableOption(\"clipboardCopyRowRange\", \"active\"); //restrict clipboard to visible rows only\r\n\t\tthis.registerTableOption(\"clipboardPasteParser\", \"table\"); //convert pasted clipboard data to rows\r\n\t\tthis.registerTableOption(\"clipboardPasteAction\", \"insert\"); //how to insert pasted data into the table\r\n\r\n\t\tthis.registerColumnOption(\"clipboard\");\r\n\t\tthis.registerColumnOption(\"titleClipboard\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.mode = this.table.options.clipboard;\r\n\r\n\t\tthis.rowRange = this.table.options.clipboardCopyRowRange;\r\n\r\n\t\tif(this.mode === true || this.mode === \"copy\"){\r\n\t\t\tthis.table.element.addEventListener(\"copy\", (e) => {\r\n\t\t\t\tvar plain, html, list;\r\n\r\n\t\t\t\tif(!this.blocked){\r\n\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\tif(this.customSelection){\r\n\t\t\t\t\t\tplain = this.customSelection;\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\r\n\t\t\t\t\t\tlist = this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig, this.table.options.clipboardCopyStyled, this.rowRange, \"clipboard\");\r\n\r\n\t\t\t\t\t\thtml = this.table.modules.export.generateHTMLTable(list);\r\n\t\t\t\t\t\tplain = html ? this.generatePlainContent(list) : \"\";\r\n\r\n\t\t\t\t\t\tif(this.table.options.clipboardCopyFormatter){\r\n\t\t\t\t\t\t\tplain = this.table.options.clipboardCopyFormatter(\"plain\", plain);\r\n\t\t\t\t\t\t\thtml = this.table.options.clipboardCopyFormatter(\"html\", html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (window.clipboardData && window.clipboardData.setData) {\r\n\t\t\t\t\t\twindow.clipboardData.setData('Text', plain);\r\n\t\t\t\t\t} else if (e.clipboardData && e.clipboardData.setData) {\r\n\t\t\t\t\t\te.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.setData) {\r\n\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/plain', plain);\r\n\t\t\t\t\t\tif(html){\r\n\t\t\t\t\t\t\te.originalEvent.clipboardData.setData('text/html', html);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.dispatchExternal(\"clipboardCopied\", plain, html);\r\n\r\n\t\t\t\t\tthis.reset();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.mode === true || this.mode === \"paste\"){\r\n\t\t\tthis.table.element.addEventListener(\"paste\", (e) => {\r\n\t\t\t\tthis.paste(e);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setPasteParser(this.table.options.clipboardPasteParser);\r\n\t\tthis.setPasteAction(this.table.options.clipboardPasteAction);\r\n\r\n\t\tthis.registerTableFunction(\"copyToClipboard\", this.copy.bind(this));\r\n\t}\r\n\r\n\treset(){\r\n\t\tthis.blocked = true;\r\n\t\tthis.customSelection = false;\r\n\t}\r\n\r\n\tgeneratePlainContent (list) {\r\n\t\tvar output = [];\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\tvar value = \"\";\r\n\r\n\t\t\t\tif(col){\r\n\r\n\t\t\t\t\tif(row.type === \"group\"){\r\n\t\t\t\t\t\tcol.value = col.component.getKey();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(col.value === null){\r\n\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tvalue = JSON.stringify(col.value);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tvalue = col.value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput.push(rowData.join(\"\\t\"));\r\n\t\t});\r\n\r\n\t\treturn output.join(\"\\n\");\r\n\t}\r\n\r\n\tcopy (range, internal) {\r\n\t\tvar sel, textRange;\r\n\t\tthis.blocked = false;\r\n\t\tthis.customSelection = false;\r\n\r\n\t\tif (this.mode === true || this.mode === \"copy\") {\r\n\r\n\t\t\tthis.rowRange = range || this.table.options.clipboardCopyRowRange;\r\n\r\n\t\t\tif (typeof window.getSelection != \"undefined\" && typeof document.createRange != \"undefined\") {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNodeContents(this.table.element);\r\n\t\t\t\tsel = window.getSelection();\r\n\r\n\t\t\t\tif (sel.toString() && internal) {\r\n\t\t\t\t\tthis.customSelection = sel.toString();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t\tsel.addRange(range);\r\n\t\t\t} else if (typeof document.selection != \"undefined\" && typeof document.body.createTextRange != \"undefined\") {\r\n\t\t\t\ttextRange = document.body.createTextRange();\r\n\t\t\t\ttextRange.moveToElementText(this.table.element);\r\n\t\t\t\ttextRange.select();\r\n\t\t\t}\r\n\r\n\t\t\tdocument.execCommand('copy');\r\n\r\n\t\t\tif (sel) {\r\n\t\t\t\tsel.removeAllRanges();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//PASTE EVENT HANDLING\r\n\tsetPasteAction(action){\r\n\r\n\t\tswitch(typeof action){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteAction = Clipboard.pasteActions[action];\r\n\r\n\t\t\t\tif(!this.pasteAction){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste action found:\", action);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteAction = action;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tsetPasteParser(parser){\r\n\t\tswitch(typeof parser){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tthis.pasteParser = Clipboard.pasteParsers[parser];\r\n\r\n\t\t\t\tif(!this.pasteParser){\r\n\t\t\t\t\tconsole.warn(\"Clipboard Error - No such paste parser found:\", parser);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tthis.pasteParser = parser;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tpaste(e){\r\n\t\tvar data, rowData, rows;\r\n\r\n\t\tif(this.checkPaseOrigin(e)){\r\n\r\n\t\t\tdata = this.getPasteData(e);\r\n\r\n\t\t\trowData = this.pasteParser.call(this, data);\r\n\r\n\t\t\tif(rowData){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\t\t\trowData = this.mutateData(rowData);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trows = this.pasteAction.call(this, rowData);\r\n\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasted\", data, rowData, rows);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"clipboardPasteError\", data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmutateData(data){\r\n\t\tvar output = [];\r\n\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\toutput.push(this.table.modules.mutator.transformRow(row, \"clipboard\"));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\toutput = data;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\r\n\tcheckPaseOrigin(e){\r\n\t\tvar valid = true;\r\n\r\n\t\tif(e.target.tagName != \"DIV\" || this.table.modules.edit.currentCell){\r\n\t\t\tvalid = false;\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n\r\n\tgetPasteData(e){\r\n\t\tvar data;\r\n\r\n\t\tif (window.clipboardData && window.clipboardData.getData) {\r\n\t\t\tdata = window.clipboardData.getData('Text');\r\n\t\t} else if (e.clipboardData && e.clipboardData.getData) {\r\n\t\t\tdata = e.clipboardData.getData('text/plain');\r\n\t\t} else if (e.originalEvent && e.originalEvent.clipboardData.getData) {\r\n\t\t\tdata = e.originalEvent.clipboardData.getData('text/plain');\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n}\r\n\r\nClipboard.moduleName = \"clipboard\";\r\n\r\n//load defaults\r\nClipboard.pasteActions = defaultPasteActions;\r\nClipboard.pasteParsers = defaultPasteParsers;\r\n\r\nexport default Clipboard;","export default {\r\n\treplace:function(rows){\r\n\t\treturn this.table.setData(rows);\r\n\t},\r\n\tupdate:function(rows){\r\n\t\treturn this.table.updateOrAddData(rows);\r\n\t},\r\n\tinsert:function(rows){\r\n\t\treturn this.table.addData(rows);\r\n\t},\r\n};","export default {\r\n\ttable:function(clipboard){\r\n\t\tvar data = [],\r\n\t\theaderFindSuccess = true,\r\n\t\tcolumns = this.table.columnManager.columns,\r\n\t\tcolumnMap = [],\r\n\t\trows = [];\r\n\r\n\t\t//get data from clipboard into array of columns and rows.\r\n\t\tclipboard = clipboard.split(\"\\n\");\r\n\r\n\t\tclipboard.forEach(function(row){\r\n\t\t\tdata.push(row.split(\"\\t\"));\r\n\t\t});\r\n\r\n\t\tif(data.length && !(data.length === 1 && data[0].length < 2)){\r\n\r\n\t\t\t//check if headers are present by title\r\n\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\treturn value && column.definition.title && value.trim() && column.definition.title.trim() === value.trim();\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//check if column headers are present by field\r\n\t\t\tif(!headerFindSuccess){\r\n\t\t\t\theaderFindSuccess = true;\r\n\t\t\t\tcolumnMap = [];\r\n\r\n\t\t\t\tdata[0].forEach(function(value){\r\n\t\t\t\t\tvar column = columns.find(function(column){\r\n\t\t\t\t\t\treturn value && column.field && value.trim() && column.field.trim() === value.trim();\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tcolumnMap.push(column);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\theaderFindSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(!headerFindSuccess){\r\n\t\t\t\t\tcolumnMap = this.table.columnManager.columnsByIndex;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//remove header row if found\r\n\t\t\tif(headerFindSuccess){\r\n\t\t\t\tdata.shift();\r\n\t\t\t}\r\n\r\n\t\t\tdata.forEach(function(item){\r\n\t\t\t\tvar row = {};\r\n\r\n\t\t\t\titem.forEach(function(value, i){\r\n\t\t\t\t\tif(columnMap[i]){\r\n\t\t\t\t\t\trow[columnMap[i].field] = value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\trows.push(row);\r\n\t\t\t});\r\n\r\n\t\t\treturn rows;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n};","class CalcComponent{\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n}\r\n\r\nexport default CalcComponent;","//public cell object\r\nexport default class CellComponent {\r\n\r\n\tconstructor (cell){\r\n\t\tthis._cell = cell;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._cell.table.componentFunctionBinder.handle(\"cell\", target._cell, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this._cell.getValue();\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this._cell.getOldValue();\r\n\t}\r\n\r\n\tgetInitialValue(){\r\n\t\treturn this._cell.initialValue;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._cell.getElement();\r\n\t}\r\n\r\n\tgetRow(){\r\n\t\treturn this._cell.row.getComponent();\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn this._cell.row.getData();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._cell.column.getField();\r\n\t}\r\n\r\n\tgetColumn(){\r\n\t\treturn this._cell.column.getComponent();\r\n\t}\r\n\r\n\tsetValue(value, mutate){\r\n\t\tif(typeof mutate == \"undefined\"){\r\n\t\t\tmutate = true;\r\n\t\t}\r\n\r\n\t\tthis._cell.setValue(value, mutate);\r\n\t}\r\n\r\n\trestoreOldValue(){\r\n\t\tthis._cell.setValueActual(this._cell.getOldValue());\r\n\t}\r\n\r\n\trestoreInitialValue(){\r\n\t\tthis._cell.setValueActual(this._cell.initialValue);\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\tthis._cell.checkHeight();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._cell.table;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._cell;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport CellComponent from './CellComponent.js';\r\n\r\nexport default class Cell extends CoreFeature{\r\n\tconstructor(column, row){\r\n\t\tsuper(column.table);\r\n\r\n\t\tthis.table = column.table;\r\n\t\tthis.column = column;\r\n\t\tthis.row = row;\r\n\t\tthis.element = null;\r\n\t\tthis.value = null;\r\n\t\tthis.initialValue;\r\n\t\tthis.oldValue = null;\r\n\t\tthis.modules = {};\r\n\r\n\t\tthis.height = null;\r\n\t\tthis.width = null;\r\n\t\tthis.minWidth = null;\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\tthis.loaded = false; //track if the cell has been added to the DOM yet\r\n\r\n\t\tthis.build();\r\n\t}\r\n\r\n\t//////////////// Setup Functions /////////////////\r\n\t//generate element\r\n\tbuild(){\r\n\t\tthis.generateElement();\r\n\r\n\t\tthis.setWidth();\r\n\r\n\t\tthis._configureCell();\r\n\r\n\t\tthis.setValueActual(this.column.getFieldValue(this.row.data));\r\n\r\n\t\tthis.initialValue = this.value;\r\n\t}\r\n\r\n\tgenerateElement(){\r\n\t\tthis.element = document.createElement('div');\r\n\t\tthis.element.className = \"tabulator-cell\";\r\n\t\tthis.element.setAttribute(\"role\", \"gridcell\");\r\n\t}\r\n\r\n\t_configureCell(){\r\n\t\tvar element = this.element,\r\n\t\tfield = this.column.getField(),\r\n\t\tvertAligns = {\r\n\t\t\ttop:\"flex-start\",\r\n\t\t\tbottom:\"flex-end\",\r\n\t\t\tmiddle:\"center\",\r\n\t\t},\r\n\t\thozAligns = {\r\n\t\t\tleft:\"flex-start\",\r\n\t\t\tright:\"flex-end\",\r\n\t\t\tcenter:\"center\",\r\n\t\t};\r\n\r\n\t\t//set text alignment\r\n\t\telement.style.textAlign = this.column.hozAlign;\r\n\r\n\t\tif(this.column.vertAlign){\r\n\t\t\telement.style.display = \"inline-flex\";\r\n\r\n\t\t\telement.style.alignItems = vertAligns[this.column.vertAlign] || \"\";\r\n\r\n\t\t\tif(this.column.hozAlign){\r\n\t\t\t\telement.style.justifyContent = hozAligns[this.column.hozAlign] || \"\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\t\t\telement.setAttribute(\"tabulator-field\", field);\r\n\t\t}\r\n\r\n\t\t//add class to cell if needed\r\n\t\tif(this.column.definition.cssClass){\r\n\t\t\tvar classNames = this.column.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\telement.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"cell-init\", this);\r\n\r\n\t\t//hide cell if not visible\r\n\t\tif(!this.column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//generate cell contents\r\n\t_generateContents(){\r\n\t\tvar val;\r\n\r\n\t\tval = this.chain(\"cell-format\", this, null, () => {\r\n\t\t\treturn this.element.innerHTML = this.value;\r\n\t\t});\r\n\r\n\t\tswitch(typeof val){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(val instanceof Node){\r\n\r\n\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\t\t\t\tthis.element.appendChild(val);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.element.innerHTML = \"\";\r\n\r\n\t\t\t\t\tif(val != null){\r\n\t\t\t\t\t\tconsole.warn(\"Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:\", val);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.element.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthis.element.innerHTML = val;\r\n\t\t}\r\n\t}\r\n\r\n\tcellRendered(){\r\n\t\tthis.dispatch(\"cell-rendered\", this);\r\n\t}\r\n\r\n\t//////////////////// Getters ////////////////////\r\n\tgetElement(containerOnly){\r\n\t\tif(!this.loaded){\r\n\t\t\tthis.loaded = true;\r\n\t\t\tif(!containerOnly){\r\n\t\t\t\tthis.layoutElement();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetValue(){\r\n\t\treturn this.value;\r\n\t}\r\n\r\n\tgetOldValue(){\r\n\t\treturn this.oldValue;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tsetValue(value, mutate, force){\r\n\t\tvar changed = this.setValueProcessData(value, mutate, force);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-updated\", this);\r\n\r\n\t\t\tthis.cellRendered();\r\n\r\n\t\t\tif(this.column.definition.cellEdited){\r\n\t\t\t\tthis.column.definition.cellEdited.call(this.table, this.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"cellEdited\", this.getComponent());\r\n\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tsetValueProcessData(value, mutate, force){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.value !== value || force){\r\n\r\n\t\t\tchanged = true;\r\n\r\n\t\t\tif(mutate){\r\n\t\t\t\tvalue = this.chain(\"cell-value-changing\", [this, value], null, value);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setValueActual(value);\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.dispatch(\"cell-value-changed\", this);\r\n\t\t}\r\n\r\n\t\treturn changed;\r\n\t}\r\n\r\n\tsetValueActual(value){\r\n\t\tthis.oldValue = this.value;\r\n\r\n\t\tthis.value = value;\r\n\r\n\t\tthis.dispatch(\"cell-value-save-before\", this);\r\n\r\n\t\tthis.column.setFieldValue(this.row.data, value);\r\n\r\n\t\tthis.dispatch(\"cell-value-save-after\", this);\r\n\r\n\t\tif(this.loaded){\r\n\t\t\tthis.layoutElement();\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutElement(){\r\n\t\tthis._generateContents();\r\n\r\n\t\tthis.dispatch(\"cell-layout\", this);\r\n\t}\r\n\r\n\tsetWidth(){\r\n\t\tthis.width = this.column.width;\r\n\t\tthis.element.style.width = this.column.widthStyled;\r\n\t}\r\n\r\n\tclearWidth(){\r\n\t\tthis.width = \"\";\r\n\t\tthis.element.style.width = \"\";\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this.width || this.element.offsetWidth;\r\n\t}\r\n\r\n\tsetMinWidth(){\r\n\t\tthis.minWidth = this.column.minWidth;\r\n\t\tthis.element.style.minWidth = this.column.minWidthStyled;\r\n\t}\r\n\r\n\tsetMaxWidth(){\r\n\t\tthis.maxWidth = this.column.maxWidth;\r\n\t\tthis.element.style.maxWidth = this.column.maxWidthStyled;\r\n\t}\r\n\r\n\tcheckHeight(){\r\n\t\t// var height = this.element.css(\"height\");\r\n\t\tthis.row.reinitializeHeight();\r\n\t}\r\n\r\n\tclearHeight(){\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.height = null;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, \"\");\r\n\t}\r\n\r\n\tsetHeight(){\r\n\t\tthis.height = this.row.height;\r\n\t\tthis.element.style.height = this.row.heightStyled;\r\n\r\n\t\tthis.dispatch(\"cell-height\", this, this.row.heightStyled);\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.height || this.element.offsetHeight;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis.element.style.display = this.column.vertAlign ? \"inline-flex\" : \"\";\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis.element.style.display = \"none\";\r\n\t}\r\n\r\n\tdelete(){\r\n\t\tthis.dispatch(\"cell-delete\", this);\r\n\r\n\t\tif(!this.table.rowManager.redrawBlock && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.column.deleteCell(this);\r\n\t\tthis.row.deleteCell(this);\r\n\t\tthis.calcs = {};\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this.row.getCellIndex(this);\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new CellComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n","import Column from './Column.js';\r\n\r\n//public column object\r\nexport default class ColumnComponent {\r\n\tconstructor (column){\r\n\t\tthis._column = column;\r\n\t\tthis.type = \"ColumnComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._column.table.componentFunctionBinder.handle(\"column\", target._column, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._column.getElement();\r\n\t}\r\n\r\n\tgetDefinition(){\r\n\t\treturn this._column.getDefinition();\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._column.getField();\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this._column.getTitleDownload();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._column.cells.forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._column.visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.show();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.show();\r\n\t\t}\r\n\t}\r\n\r\n\thide(){\r\n\t\tif(this._column.isGroup){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis._column.hide();\r\n\t\t}\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tif(this._column.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._column.delete();\r\n\t}\r\n\r\n\tgetSubColumns(){\r\n\t\tvar output = [];\r\n\r\n\t\tif(this._column.columns.length){\r\n\t\t\tthis._column.columns.forEach(function(column){\r\n\t\t\t\toutput.push(column.getComponent());\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetParentColumn(){\r\n\t\treturn this._column.parent instanceof Column ? this._column.parent.getComponent() : false;\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._column;\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._column.table.columnManager.scrollToColumn(this._column);\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._column.table;\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tvar toColumn = this._column.table.columnManager.findColumn(to);\r\n\r\n\t\tif(toColumn){\r\n\t\t\tthis._column.table.columnManager.moveColumn(this._column, toColumn, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t}\r\n\t}\r\n\r\n\tgetNextColumn(){\r\n\t\tvar nextCol = this._column.nextColumn();\r\n\r\n\t\treturn nextCol ? nextCol.getComponent() : false;\r\n\t}\r\n\r\n\tgetPrevColumn(){\r\n\t\tvar prevCol = this._column.prevColumn();\r\n\r\n\t\treturn prevCol ? prevCol.getComponent() : false;\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\treturn this._column.updateDefinition(updates);\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\treturn this._column.getWidth();\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tvar result;\r\n\r\n\t\tif(width === true){\r\n\t\t\tresult = this._column.reinitializeWidth(true);\r\n\t\t}else{\r\n\t\t\tresult = this._column.setWidth(width);\r\n\t\t}\r\n\r\n\t\tthis._column.table.columnManager.rerenderColumns(true);\r\n\r\n\t\treturn result;\r\n\t}\r\n}","export default {\r\n\t\"title\": undefined,\r\n\t\"field\": undefined,\r\n\t\"columns\": undefined,\r\n\t\"visible\": undefined,\r\n\t\"hozAlign\": undefined,\r\n\t\"vertAlign\": undefined,\r\n\t\"width\": undefined,\r\n\t\"minWidth\": 40,\r\n\t\"maxWidth\": undefined,\r\n\t\"maxInitialWidth\": undefined,\r\n\t\"cssClass\": undefined,\r\n\t\"variableHeight\": undefined,\r\n\t\"headerVertical\": undefined,\r\n\t\"headerHozAlign\": undefined,\r\n\t\"editableTitle\": undefined,\r\n};","import CoreFeature from '../CoreFeature.js';\r\nimport ColumnComponent from './ColumnComponent.js';\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport Cell from '../cell/Cell.js';\r\n\r\nclass Column extends CoreFeature{\r\n\r\n\tconstructor(def, parent){\r\n\t\tsuper(parent.table);\r\n\r\n\t\tthis.definition = def; //column definition\r\n\t\tthis.parent = parent; //hold parent object\r\n\t\tthis.type = \"column\"; //type of element\r\n\t\tthis.columns = []; //child columns\r\n\t\tthis.cells = []; //cells bound to this column\r\n\t\tthis.element = this.createElement(); //column header element\r\n\t\tthis.contentElement = false;\r\n\t\tthis.titleHolderElement = false;\r\n\t\tthis.titleElement = false;\r\n\t\tthis.groupElement = this.createGroupElement(); //column group holder element\r\n\t\tthis.isGroup = false;\r\n\t\tthis.hozAlign = \"\"; //horizontal text alignment\r\n\t\tthis.vertAlign = \"\"; //vert text alignment\r\n\r\n\t\t//multi dimensional filed handling\r\n\t\tthis.field =\"\";\r\n\t\tthis.fieldStructure = \"\";\r\n\t\tthis.getFieldValue = \"\";\r\n\t\tthis.setFieldValue = \"\";\r\n\r\n\t\tthis.titleDownload = null;\r\n\t\tthis.titleFormatterRendered = false;\r\n\r\n\t\tthis.mapDefinitions();\r\n\r\n\t\tthis.setField(this.definition.field);\r\n\r\n\t\tthis.modules = {}; //hold module variables;\r\n\r\n\t\tthis.width = null; //column width\r\n\t\tthis.widthStyled = \"\"; //column width pre-styled to improve render efficiency\r\n\t\tthis.maxWidth = null; //column maximum width\r\n\t\tthis.maxWidthStyled = \"\"; //column maximum pre-styled to improve render efficiency\r\n\t\tthis.maxInitialWidth = null;\r\n\t\tthis.minWidth = null; //column minimum width\r\n\t\tthis.minWidthStyled = \"\"; //column minimum pre-styled to improve render efficiency\r\n\t\tthis.widthFixed = false; //user has specified a width for this column\r\n\r\n\t\tthis.visible = true; //default visible state\r\n\r\n\t\tthis.component = null;\r\n\r\n\t\t//initialize column\r\n\t\tif(this.definition.columns){\r\n\r\n\t\t\tthis.isGroup = true;\r\n\r\n\t\t\tthis.definition.columns.forEach((def, i) => {\r\n\t\t\t\tvar newCol = new Column(def, this);\r\n\t\t\t\tthis.attachColumn(newCol);\r\n\t\t\t});\r\n\r\n\t\t\tthis.checkColumnVisibility();\r\n\t\t}else{\r\n\t\t\tparent.registerColumnField(this);\r\n\t\t}\r\n\r\n\t\tthis._initialize();\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.setAttribute(\"role\", \"columnheader\");\r\n\t\tel.setAttribute(\"aria-sort\", \"none\");\r\n\r\n\t\tswitch(this.table.options.columnHeaderVertAlign){\r\n\t\t\tcase \"middle\":\r\n\t\t\t\tel.style.justifyContent = \"center\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"bottom\":\r\n\t\t\t\tel.style.justifyContent = \"flex-end\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tcreateGroupElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-col-group-cols\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tmapDefinitions(){\r\n\t\tvar defaults = this.table.options.columnDefaults;\r\n\r\n\t\t//map columnDefaults onto column definitions\r\n\t\tif(defaults){\r\n\t\t\tfor(let key in defaults){\r\n\t\t\t\tif(typeof this.definition[key] === \"undefined\"){\r\n\t\t\t\t\tthis.definition[key] = defaults[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.definition = this.table.columnManager.optionsList.generate(Column.defaultOptionList, this.definition);\r\n\t}\r\n\r\n\tcheckDefinition(){\r\n\t\tObject.keys(this.definition).forEach((key) => {\r\n\t\t\tif(Column.defaultOptionList.indexOf(key) === -1){\r\n\t\t\t\tconsole.warn(\"Invalid column definition option in '\" + (this.field || this.definition.title) + \"' column:\", key);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tsetField(field){\r\n\t\tthis.field = field;\r\n\t\tthis.fieldStructure = field ? (this.table.options.nestedFieldSeparator ? field.split(this.table.options.nestedFieldSeparator) : [field]) : [];\r\n\t\tthis.getFieldValue = this.fieldStructure.length > 1 ? this._getNestedData : this._getFlatData;\r\n\t\tthis.setFieldValue = this.fieldStructure.length > 1 ? this._setNestedData : this._setFlatData;\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnPosition(column){\r\n\t\tthis.parent.registerColumnPosition(column);\r\n\t}\r\n\r\n\t//register column position with column manager\r\n\tregisterColumnField(column){\r\n\t\tthis.parent.registerColumnField(column);\r\n\t}\r\n\r\n\t//trigger position registration\r\n\treRegisterPosition(){\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolumn.reRegisterPosition();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.registerColumnPosition(this);\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element\r\n\t_initialize(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\r\n\t\tif(def.headerVertical){\r\n\t\t\tthis.element.classList.add(\"tabulator-col-vertical\");\r\n\r\n\t\t\tif(def.headerVertical === \"flip\"){\r\n\t\t\t\tthis.element.classList.add(\"tabulator-col-vertical-flip\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.contentElement = this._buildColumnHeaderContent();\r\n\r\n\t\tthis.element.appendChild(this.contentElement);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis._buildGroupHeader();\r\n\t\t}else{\r\n\t\t\tthis._buildColumnHeader();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-init\", this);\r\n\t}\r\n\r\n\t//build header element for header\r\n\t_buildColumnHeader(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tthis.dispatch(\"column-layout\", this);\r\n\r\n\t\t//set column visibility\r\n\t\tif(typeof def.visible != \"undefined\"){\r\n\t\t\tif(def.visible){\r\n\t\t\t\tthis.show(true);\r\n\t\t\t}else{\r\n\t\t\t\tthis.hide(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//assign additional css classes to column header\r\n\t\tif(def.cssClass){\r\n\t\t\tvar classNames = def.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(def.field){\r\n\t\t\tthis.element.setAttribute(\"tabulator-field\", def.field);\r\n\t\t}\r\n\r\n\t\t//set min width if present\r\n\t\tthis.setMinWidth(parseInt(def.minWidth));\r\n\r\n\t\tif (def.maxInitialWidth) {\r\n\t\t\tthis.maxInitialWidth = parseInt(def.maxInitialWidth);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.maxWidth){\r\n\t\t\tthis.setMaxWidth(parseInt(def.maxWidth));\r\n\t\t}\r\n\r\n\t\tthis.reinitializeWidth();\r\n\r\n\t\t//set horizontal text alignment\r\n\t\tthis.hozAlign = this.definition.hozAlign;\r\n\t\tthis.vertAlign = this.definition.vertAlign;\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\t}\r\n\r\n\t_buildColumnHeaderContent(){\r\n\t\tvar contentElement = document.createElement(\"div\");\r\n\t\tcontentElement.classList.add(\"tabulator-col-content\");\r\n\r\n\t\tthis.titleHolderElement = document.createElement(\"div\");\r\n\t\tthis.titleHolderElement.classList.add(\"tabulator-col-title-holder\");\r\n\r\n\t\tcontentElement.appendChild(this.titleHolderElement);\r\n\r\n\t\tthis.titleElement = this._buildColumnHeaderTitle();\r\n\r\n\t\tthis.titleHolderElement.appendChild(this.titleElement);\r\n\r\n\t\treturn contentElement;\r\n\t}\r\n\r\n\t//build title element of column\r\n\t_buildColumnHeaderTitle(){\r\n\t\tvar def = this.definition;\r\n\r\n\t\tvar titleHolderElement = document.createElement(\"div\");\r\n\t\ttitleHolderElement.classList.add(\"tabulator-col-title\");\r\n\r\n\t\tif(def.editableTitle){\r\n\t\t\tvar titleElement = document.createElement(\"input\");\r\n\t\t\ttitleElement.classList.add(\"tabulator-title-editor\");\r\n\r\n\t\t\ttitleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\ttitleElement.focus();\r\n\t\t\t});\r\n\r\n\t\t\ttitleElement.addEventListener(\"change\", () => {\r\n\t\t\t\tdef.title = titleElement.value;\r\n\t\t\t\tthis.dispatchExternal(\"columnTitleChanged\", this.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\ttitleHolderElement.appendChild(titleElement);\r\n\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\ttitleElement.value = text || (def.title || \" \");\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\ttitleElement.value = def.title || \" \";\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif(def.field){\r\n\t\t\t\tthis.langBind(\"columns|\" + def.field, (text) => {\r\n\t\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, text || (def.title || \" \"));\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis._formatColumnHeaderTitle(titleHolderElement, def.title || \" \");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn titleHolderElement;\r\n\t}\r\n\r\n\t_formatColumnHeaderTitle(el, title){\r\n\t\tvar contents = this.chain(\"column-format\", [this, title, el], null, () => {\r\n\t\t\treturn title;\r\n\t\t});\r\n\r\n\t\tswitch(typeof contents){\r\n\t\t\tcase \"object\":\r\n\t\t\t\tif(contents instanceof Node){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\t\tconsole.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:\", contents);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tel.innerHTML = \"\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tel.innerHTML = contents;\r\n\t\t}\r\n\t}\r\n\r\n\t//build header element for column group\r\n\t_buildGroupHeader(){\r\n\t\tthis.element.classList.add(\"tabulator-col-group\");\r\n\t\tthis.element.setAttribute(\"role\", \"columngroup\");\r\n\t\tthis.element.setAttribute(\"aria-title\", this.definition.title);\r\n\r\n\t\t//asign additional css classes to column header\r\n\t\tif(this.definition.cssClass){\r\n\t\t\tvar classNames = this.definition.cssClass.split(\" \");\r\n\t\t\tclassNames.forEach((className) => {\r\n\t\t\t\tthis.element.classList.add(className);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.titleElement.style.textAlign = this.definition.headerHozAlign;\r\n\r\n\t\tthis.element.appendChild(this.groupElement);\r\n\t}\r\n\r\n\t//flat field lookup\r\n\t_getFlatData(data){\r\n\t\treturn data[this.field];\r\n\t}\r\n\r\n\t//nested field lookup\r\n\t_getNestedData(data){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length,\r\n\t\toutput;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tdataObj = dataObj[structure[i]];\r\n\r\n\t\t\toutput = dataObj;\r\n\r\n\t\t\tif(!dataObj){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//flat field set\r\n\t_setFlatData(data, value){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = value;\r\n\t\t}\r\n\t}\r\n\r\n\t//nested field set\r\n\t_setNestedData(data, value){\r\n\t\tvar dataObj = data,\r\n\t\tstructure = this.fieldStructure,\r\n\t\tlength = structure.length;\r\n\r\n\t\tfor(let i = 0; i < length; i++){\r\n\r\n\t\t\tif(i == length -1){\r\n\t\t\t\tdataObj[structure[i]] = value;\r\n\t\t\t}else{\r\n\t\t\t\tif(!dataObj[structure[i]]){\r\n\t\t\t\t\tif(typeof value !== \"undefined\"){\r\n\t\t\t\t\t\tdataObj[structure[i]] = {};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdataObj = dataObj[structure[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//attach column to this group\r\n\tattachColumn(column){\r\n\t\tif(this.groupElement){\r\n\t\t\tthis.columns.push(column);\r\n\t\t\tthis.groupElement.appendChild(column.getElement());\r\n\r\n\t\t\tcolumn.columnRendered();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Warning - Column being attached to another column instead of column group\");\r\n\t\t}\r\n\t}\r\n\r\n\t//vertically align header in column\r\n\tverticalAlign(alignment, height){\r\n\r\n\t\t//calculate height of column header and group holder element\r\n\t\tvar parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : (height || this.parent.getHeadersElement().clientHeight);\r\n\t\t// var parentHeight = this.parent.isGroup ? this.parent.getGroupElement().clientHeight : this.parent.getHeadersElement().clientHeight;\r\n\r\n\t\tthis.element.style.height = parentHeight + \"px\";\r\n\r\n\t\tthis.dispatch(\"column-height\", this, this.element.style.height);\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.groupElement.style.minHeight = (parentHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t}\r\n\r\n\t\t//vertically align cell contents\r\n\t\t// if(!this.isGroup && alignment !== \"top\"){\r\n\t\t// \tif(alignment === \"bottom\"){\r\n\t\t// \t\tthis.element.style.paddingTop = (this.element.clientHeight - this.contentElement.offsetHeight) + \"px\";\r\n\t\t// \t}else{\r\n\t\t// \t\tthis.element.style.paddingTop = ((this.element.clientHeight - this.contentElement.offsetHeight) / 2) + \"px\";\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.verticalAlign(alignment);\r\n\t\t});\r\n\t}\r\n\r\n\t//clear vertical alignment\r\n\tclearVerticalAlign(){\r\n\t\tthis.element.style.paddingTop = \"\";\r\n\t\tthis.element.style.height = \"\";\r\n\t\tthis.element.style.minHeight = \"\";\r\n\t\tthis.groupElement.style.minHeight = \"\";\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.clearVerticalAlign();\r\n\t\t});\r\n\r\n\t\tthis.dispatch(\"column-height\", this, \"\");\r\n\t}\r\n\r\n\t//// Retrieve Column Information ////\r\n\t//return column header element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\t//return column group element\r\n\tgetGroupElement(){\r\n\t\treturn this.groupElement;\r\n\t}\r\n\r\n\t//return field name\r\n\tgetField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tgetTitleDownload() {\r\n\t\treturn this.titleDownload;\r\n\t}\r\n\r\n\t//return the first column in a group\r\n\tgetFirstColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[0].getFirstColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return the last column in a group\r\n\tgetLastColumn(){\r\n\t\tif(!this.isGroup){\r\n\t\t\treturn this;\r\n\t\t}else{\r\n\t\t\tif(this.columns.length){\r\n\t\t\t\treturn this.columns[this.columns.length -1].getLastColumn();\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetColumns(traverse){\r\n\t\tvar columns = [];\r\n\r\n\t\tif(traverse){\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\t\r\n\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumns = this.columns;\r\n\t\t}\r\n\t\t\r\n\t\treturn columns;\r\n\t}\r\n\r\n\t//return all columns in a group\r\n\tgetCells(){\r\n\t\treturn this.cells;\r\n\t}\r\n\r\n\t//retrieve the top column in a group of columns\r\n\tgetTopColumn(){\r\n\t\tif(this.parent.isGroup){\r\n\t\t\treturn this.parent.getTopColumn();\r\n\t\t}else{\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n\r\n\t//return column definition object\r\n\tgetDefinition(updateBranches){\r\n\t\tvar colDefs = [];\r\n\r\n\t\tif(this.isGroup && updateBranches){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tcolDefs.push(column.getDefinition(true));\r\n\t\t\t});\r\n\r\n\t\t\tthis.definition.columns = colDefs;\r\n\t\t}\r\n\r\n\t\treturn this.definition;\r\n\t}\r\n\r\n\t//////////////////// Actions ////////////////////\r\n\tcheckColumnVisibility(){\r\n\t\tvar visible = false;\r\n\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvisible = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(visible){\r\n\t\t\tthis.show();\r\n\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t}else{\r\n\t\t\tthis.hide();\r\n\t\t}\r\n\t}\r\n\r\n\t//show column\r\n\tshow(silent, responsiveToggle){\r\n\t\tif(!this.visible){\r\n\t\t\tthis.visible = true;\r\n\r\n\t\t\tthis.element.style.display = \"\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.show();\r\n\t\t\t});\r\n\r\n\t\t\tif(!this.isGroup && this.width === null){\r\n\t\t\t\tthis.reinitializeWidth();\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tthis.dispatch(\"column-show\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//hide column\r\n\thide(silent, responsiveToggle){\r\n\t\tif(this.visible){\r\n\t\t\tthis.visible = false;\r\n\r\n\t\t\tthis.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.columnManager.verticalAlignHeaders();\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.checkColumnVisibility();\r\n\t\t\t}\r\n\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.hide();\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatch(\"column-hide\", this, responsiveToggle);\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.dispatchExternal(\"columnVisibilityChanged\", this.getComponent(), false);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.silent){\r\n\t\t\t\tthis.table.columnManager.rerenderColumns();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmatchChildWidths(){\r\n\t\tvar childWidth = 0;\r\n\r\n\t\tif(this.contentElement && this.columns.length){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\tchildWidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.contentElement.style.maxWidth = (childWidth - 1) + \"px\";\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.matchChildWidths();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tremoveChild(child){\r\n\t\tvar index = this.columns.indexOf(child);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\r\n\t\tif(!this.columns.length){\r\n\t\t\tthis.delete();\r\n\t\t}\r\n\t}\r\n\r\n\tsetWidth(width){\r\n\t\tthis.widthFixed = true;\r\n\t\tthis.setWidthActual(width);\r\n\t}\r\n\r\n\tsetWidthActual(width){\r\n\t\tif(isNaN(width)){\r\n\t\t\twidth = Math.floor((this.table.element.clientWidth/100) * parseInt(width));\r\n\t\t}\r\n\r\n\t\twidth = Math.max(this.minWidth, width);\r\n\r\n\t\tif(this.maxWidth){\r\n\t\t\twidth = Math.min(this.maxWidth, width);\r\n\t\t}\r\n\r\n\t\tthis.width = width;\r\n\t\tthis.widthStyled = width ? width + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.width = this.widthStyled;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tcell.setWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.parent.isGroup){\r\n\t\t\tthis.parent.matchChildWidths();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width\", this);\r\n\t}\r\n\r\n\tcheckCellHeights(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tif(cell.row.heightInitialized){\r\n\t\t\t\tif(cell.row.getElement().offsetParent !== null){\r\n\t\t\t\t\trows.push(cell.row);\r\n\t\t\t\t\tcell.row.clearCellHeight();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcell.row.heightInitialized = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.calcHeight();\r\n\t\t});\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\trow.setCellHeight();\r\n\t\t});\r\n\t}\r\n\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\r\n\t\tif(this.isGroup){\r\n\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\tif(column.visible){\r\n\t\t\t\t\twidth += column.getWidth();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\twidth = this.width;\r\n\t\t}\r\n\r\n\t\treturn width;\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn Math.ceil(this.element.getBoundingClientRect().height);\r\n\t}\r\n\r\n\tsetMinWidth(minWidth){\r\n\t\tif(this.maxWidth && minWidth > this.maxWidth){\r\n\t\t\tminWidth = this.maxWidth;\r\n\r\n\t\t\tconsole.warn(\"the minWidth (\"+ minWidth + \"px) for column '\" + this.field + \"' cannot be bigger that its maxWidth (\"+ this.maxWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.minWidth = minWidth;\r\n\t\tthis.minWidthStyled = minWidth ? minWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.minWidth = this.minWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMinWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tsetMaxWidth(maxWidth){\r\n\t\tif(this.minWidth && maxWidth < this.minWidth){\r\n\t\t\tmaxWidth = this.minWidth;\r\n\r\n\t\t\tconsole.warn(\"the maxWidth (\"+ maxWidth + \"px) for column '\" + this.field + \"' cannot be smaller that its minWidth (\"+ this.minWidthStyled + \")\");\r\n\t\t}\r\n\r\n\t\tthis.maxWidth = maxWidth;\r\n\t\tthis.maxWidthStyled = maxWidth ? maxWidth + \"px\" : \"\";\r\n\r\n\t\tthis.element.style.maxWidth = this.maxWidthStyled;\r\n\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setMaxWidth();\r\n\t\t});\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(this.isGroup){\r\n\t\t\t\tthis.columns.forEach(function(column){\r\n\t\t\t\t\tcolumn.delete();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatch(\"column-delete\", this);\r\n\r\n\t\t\tvar cellCount = this.cells.length;\r\n\r\n\t\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\t\tthis.cells[0].delete();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element = false;\r\n\t\t\tthis.contentElement = false;\r\n\t\t\tthis.titleElement = false;\r\n\t\t\tthis.groupElement = false;\r\n\r\n\t\t\tif(this.parent.isGroup){\r\n\t\t\t\tthis.parent.removeChild(this);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.columnManager.deregisterColumn(this);\r\n\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\r\n\tcolumnRendered(){\r\n\t\tif(this.titleFormatterRendered){\r\n\t\t\tthis.titleFormatterRendered();\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-rendered\", this);\r\n\t}\r\n\r\n\t//////////////// Cell Management /////////////////\r\n\t//generate cell for this column\r\n\tgenerateCell(row){\r\n\t\tvar cell = new Cell(this, row);\r\n\r\n\t\tthis.cells.push(cell);\r\n\r\n\t\treturn cell;\r\n\t}\r\n\r\n\tnextColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._nextVisibleColumn(index + 1) : false;\r\n\t}\r\n\r\n\t_nextVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._nextVisibleColumn(index + 1);\r\n\t}\r\n\r\n\tprevColumn(){\r\n\t\tvar index = this.table.columnManager.findColumnIndex(this);\r\n\t\treturn index > -1 ? this._prevVisibleColumn(index - 1) : false;\r\n\t}\r\n\r\n\t_prevVisibleColumn(index){\r\n\t\tvar column = this.table.columnManager.getColumnByIndex(index);\r\n\t\treturn !column || column.visible ? column : this._prevVisibleColumn(index - 1);\r\n\t}\r\n\r\n\treinitializeWidth(force){\r\n\t\tthis.widthFixed = false;\r\n\r\n\t\t//set width if present\r\n\t\tif(typeof this.definition.width !== \"undefined\" && !force){\r\n\t\t\t// maxInitialWidth ignored here as width specified\r\n\t\t\tthis.setWidth(this.definition.width);\r\n\t\t}\r\n\r\n\t\tthis.dispatch(\"column-width-fit-before\", this);\r\n\r\n\t\tthis.fitToData(force);\r\n\r\n\t\tthis.dispatch(\"column-width-fit-after\", this);\r\n\t}\r\n\r\n\t//set column width to maximum cell width for non group columns\r\n\tfitToData(force){\r\n\t\tif(this.isGroup){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif(!this.widthFixed){\r\n\t\t\tthis.element.style.width = \"\";\r\n\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tcell.clearWidth();\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar maxWidth = this.element.offsetWidth;\r\n\r\n\t\tif(!this.width || !this.widthFixed){\r\n\t\t\tthis.cells.forEach((cell) => {\r\n\t\t\t\tvar width = cell.getWidth();\r\n\r\n\t\t\t\tif(width > maxWidth){\r\n\t\t\t\t\tmaxWidth = width;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(maxWidth){\r\n\t\t\t\tvar setTo = maxWidth + 1;\r\n\t\t\t\tif (this.maxInitialWidth && !force) {\r\n\t\t\t\t\tsetTo = Math.min(setTo, this.maxInitialWidth);\r\n\t\t\t\t}\r\n\t\t\t\tthis.setWidthActual(setTo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateDefinition(updates){\r\n\t\tvar definition;\r\n\r\n\t\tif(!this.isGroup){\r\n\t\t\tif(!this.parent.isGroup){\r\n\t\t\t\tdefinition = Object.assign({}, this.getDefinition());\r\n\t\t\t\tdefinition = Object.assign(definition, updates);\r\n\r\n\t\t\t\treturn this.table.columnManager.addColumn(definition, false, this)\r\n\t\t\t\t\t.then((column) => {\r\n\r\n\t\t\t\t\t\tif(definition.field == this.field){\r\n\t\t\t\t\t\t\tthis.field = false; //clear field name to prevent deletion of duplicate column from arrays\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn this.delete()\r\n\t\t\t\t\t\t\t.then(() => {\r\n\t\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Column Update Error - The updateDefinition function is only available on ungrouped columns\");\r\n\t\t\treturn Promise.reject(\"Column Update Error - The updateDefinition function is only available on columns, not column groups\");\r\n\t\t}\r\n\t}\r\n\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new ColumnComponent(this);\r\n\t\t}\r\n\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nColumn.defaultOptionList = defaultOptions;\r\n\r\nexport default Column;\r\n","//public row object\r\nexport default class RowComponent {\r\n\r\n\tconstructor (row){\r\n\t\tthis._row = row;\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._row.table.componentFunctionBinder.handle(\"row\", target._row, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetData(transform){\r\n\t\treturn this._row.getData(transform);\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._row.getElement();\r\n\t}\r\n\r\n\tgetCells(){\r\n\t\tvar cells = [];\r\n\r\n\t\tthis._row.getCells().forEach(function(cell){\r\n\t\t\tcells.push(cell.getComponent());\r\n\t\t});\r\n\r\n\t\treturn cells;\r\n\t}\r\n\r\n\tgetCell(column){\r\n\t\tvar cell = this._row.getCell(column);\r\n\t\treturn cell ? cell.getComponent() : false;\r\n\t}\r\n\r\n\tgetIndex(){\r\n\t\treturn this._row.getData(\"data\")[this._row.table.options.index];\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this._row.getPosition();\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\treturn this._row.watchPosition(callback);\r\n\t}\r\n\r\n\tdelete(){\r\n\t\treturn this._row.delete();\r\n\t}\r\n\r\n\tscrollTo(){\r\n\t\treturn this._row.table.rowManager.scrollToRow(this._row);\r\n\t}\r\n\r\n\tmove(to, after){\r\n\t\tthis._row.moveToRow(to, after);\r\n\t}\r\n\r\n\tupdate(data){\r\n\t\treturn this._row.updateData(data);\r\n\t}\r\n\r\n\tnormalizeHeight(){\r\n\t\tthis._row.normalizeHeight(true);\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._row;\r\n\t}\r\n\r\n\treformat(){\r\n\t\treturn this._row.reinitialize();\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._row.table;\r\n\t}\r\n\r\n\tgetNextRow(){\r\n\t\tvar row = this._row.nextRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n\r\n\tgetPrevRow(){\r\n\t\tvar row = this._row.prevRow();\r\n\t\treturn row ? row.getComponent() : row;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport RowComponent from './RowComponent.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Row extends CoreFeature{\r\n\tconstructor (data, parent, type = \"row\"){\r\n\t\tsuper(parent.table);\r\n\t\t\r\n\t\tthis.parent = parent;\r\n\t\tthis.data = {};\r\n\t\tthis.type = type; //type of element\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {}; //hold module variables;\r\n\t\tthis.cells = [];\r\n\t\tthis.height = 0; //hold element height\r\n\t\tthis.heightStyled = \"\"; //hold element height pre-styled to improve render efficiency\r\n\t\tthis.manualHeight = false; //user has manually set row height\r\n\t\tthis.outerHeight = 0; //hold elements outer height\r\n\t\tthis.initialized = false; //element has been rendered\r\n\t\tthis.heightInitialized = false; //element has resized cells to fit\r\n\t\tthis.position = 0; //store position of element in row list\r\n\t\tthis.positionWatchers = [];\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.created = false;\r\n\t\t\r\n\t\tthis.setData(data);\r\n\t}\r\n\t\r\n\tcreate(){\r\n\t\tif(!this.created){\r\n\t\t\tthis.created = true;\r\n\t\t\tthis.generateElement();\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\tthis.element = el;\r\n\t}\r\n\t\r\n\tgetElement(){\r\n\t\tthis.create();\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.createElement();\r\n\t\tthis.dispatch(\"row-init\", this);\r\n\t}\r\n\t\r\n\tgenerateCells(){\r\n\t\tthis.cells = this.table.columnManager.generateCells(this);\r\n\t}\r\n\t\r\n\t//functions to setup on first render\r\n\tinitialize(force){\r\n\t\tthis.create();\r\n\t\t\r\n\t\tif(!this.initialized || force){\r\n\t\t\t\r\n\t\t\tthis.deleteCells();\r\n\t\t\t\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-before\", this);\r\n\t\t\t\r\n\t\t\tthis.generateCells();\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t\t\r\n\t\t\tthis.table.columnManager.renderer.renderRowCells(this);\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.normalizeHeight();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout\", this);\r\n\t\t\t\r\n\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-layout-after\", this);\r\n\t\t}else{\r\n\t\t\tthis.table.columnManager.renderer.rerenderRowCells(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tdeinitializeHeight(){\r\n\t\tthis.heightInitialized = false;\r\n\t}\r\n\t\r\n\treinitialize(children){\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\t\r\n\t\tif(!this.manualHeight){\r\n\t\t\tthis.height = 0;\r\n\t\t\tthis.heightStyled = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tif(this.element && this.element.offsetParent !== null){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"row-relayout\", this);\r\n\t}\r\n\t\r\n\t//get heights when doing bulk row style calcs in virtual DOM\r\n\tcalcHeight(force){\r\n\t\tvar maxHeight = 0,\r\n\t\tminHeight;\r\n\t\t\r\n\t\tif(this.table.options.rowHeight){\r\n\t\t\tthis.height = this.table.options.rowHeight;\r\n\t\t}else{\r\n\t\t\tminHeight = this.table.options.resizableRows ? this.element.clientHeight : 0;\r\n\t\t\t\r\n\t\t\tthis.cells.forEach(function(cell){\r\n\t\t\t\tvar height = cell.getHeight();\r\n\t\t\t\tif(height > maxHeight){\r\n\t\t\t\t\tmaxHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(force){\r\n\t\t\t\tthis.height = Math.max(maxHeight, minHeight);\r\n\t\t\t}else{\r\n\t\t\t\tthis.height = this.manualHeight ? this.height : Math.max(maxHeight, minHeight);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.heightStyled = this.height ? this.height + \"px\" : \"\";\r\n\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t}\r\n\t\r\n\t//set of cells\r\n\tsetCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.setHeight();\r\n\t\t});\r\n\t\t\r\n\t\tthis.heightInitialized = true;\r\n\t}\r\n\t\r\n\tclearCellHeight(){\r\n\t\tthis.cells.forEach(function(cell){\r\n\t\t\tcell.clearHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(force){\r\n\t\tif(force && !this.table.options.rowHeight){\r\n\t\t\tthis.clearCellHeight();\r\n\t\t}\r\n\t\t\r\n\t\tthis.calcHeight(force);\r\n\t\t\r\n\t\tthis.setCellHeight();\r\n\t}\r\n\t\r\n\t//set height of rows\r\n\tsetHeight(height, force){\r\n\t\tif(this.height != height || force){\r\n\t\t\t\r\n\t\t\tthis.manualHeight = true;\r\n\t\t\t\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.heightStyled = height ? height + \"px\" : \"\";\r\n\t\t\t\r\n\t\t\tthis.setCellHeight();\r\n\t\t\t\r\n\t\t\t// this.outerHeight = this.element.outerHeight();\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\t//return rows outer Width\r\n\tgetWidth(){\r\n\t\treturn this.element.offsetWidth;\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tdeleteCell(cell){\r\n\t\tvar index = this.cells.indexOf(cell);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.cells.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Data Management /////////////////\r\n\tsetData(data){\r\n\t\tthis.data = this.chain(\"row-data-init-before\", [this, data], undefined, data);\r\n\t\t\r\n\t\tthis.dispatch(\"row-data-init-after\", this);\r\n\t}\r\n\t\r\n\t//update the rows data\r\n\tupdateData(updatedData){\r\n\t\tvar visible = this.element && Helpers.elVisible(this.element),\r\n\t\ttempData = {},\r\n\t\tnewRowData;\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof updatedData === \"string\"){\r\n\t\t\t\tupdatedData = JSON.parse(updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-before\", this);\r\n\t\t\t\r\n\t\t\tif(this.subscribed(\"row-data-changing\")){\r\n\t\t\t\ttempData = Object.assign(tempData, this.data);\r\n\t\t\t\ttempData = Object.assign(tempData, updatedData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnewRowData = this.chain(\"row-data-changing\", [this, tempData, updatedData], null, updatedData);\r\n\t\t\t\r\n\t\t\t//set data\r\n\t\t\tfor (let attrname in newRowData) {\r\n\t\t\t\tthis.data[attrname] = newRowData[attrname];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-save-after\", this);\r\n\t\t\t\r\n\t\t\t//update affected cells only\r\n\t\t\tfor (let attrname in updatedData) {\r\n\t\t\t\t\r\n\t\t\t\tlet columns = this.table.columnManager.getColumnsByFieldRoot(attrname);\r\n\t\t\t\t\r\n\t\t\t\tcolumns.forEach((column) => {\r\n\t\t\t\t\tlet cell = this.getCell(column.getField());\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\tlet value = column.getFieldValue(newRowData);\r\n\t\t\t\t\t\tif(cell.getValue() != value){\r\n\t\t\t\t\t\t\tcell.setValueProcessData(value);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(visible){\r\n\t\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Partial reinitialization if visible\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.normalizeHeight(true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.rowFormatter){\r\n\t\t\t\t\tthis.table.options.rowFormatter(this.getComponent());\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.initialized = false;\r\n\t\t\t\tthis.height = 0;\r\n\t\t\t\tthis.heightStyled = \"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"row-data-changed\", this, visible, updatedData);\r\n\t\t\t\r\n\t\t\t//this.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"rowUpdated\", this.getComponent());\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetData(transform){\r\n\t\tif(transform){\r\n\t\t\treturn this.chain(\"row-data-retrieve\", [this, transform], null, this.data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\tgetCell(column){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tcolumn = this.table.columnManager.findColumn(column);\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\tmatch = this.cells.find(function(cell){\r\n\t\t\treturn cell.column === column;\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetCellIndex(findCell){\r\n\t\treturn this.cells.findIndex(function(cell){\r\n\t\t\treturn cell === findCell;\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindCell(subject){\r\n\t\treturn this.cells.find((cell) => {\r\n\t\t\treturn cell.element === subject;\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetCells(){\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.generateCells();\r\n\t\t}\r\n\t\t\r\n\t\treturn this.cells;\r\n\t}\r\n\t\r\n\tnextRow(){\r\n\t\tvar row = this.table.rowManager.nextDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tprevRow(){\r\n\t\tvar row = this.table.rowManager.prevDisplayRow(this, true);\r\n\t\treturn row || false;\r\n\t}\r\n\t\r\n\tmoveToRow(to, before){\r\n\t\tvar toRow = this.table.rowManager.findRow(to);\r\n\t\t\r\n\t\tif(toRow){\r\n\t\t\tthis.table.rowManager.moveRowActual(this, toRow, !before);\r\n\t\t\tthis.table.rowManager.refreshActiveData(\"display\", false, true);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", to);\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////// Actions /////////////////////\r\n\tdelete(){\r\n\t\tthis.dispatch(\"row-delete\", this);\r\n\t\t\r\n\t\tthis.deleteActual();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\tdeleteActual(blockRedraw){\r\n\t\tthis.detachModules();\r\n\t\t\r\n\t\tthis.table.rowManager.deleteRow(this, blockRedraw);\r\n\t\t\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.heightInitialized = false;\r\n\t\tthis.element = false;\r\n\t\t\r\n\t\tthis.dispatch(\"row-deleted\", this);\r\n\t}\r\n\t\r\n\tdetachModules(){\r\n\t\tthis.dispatch(\"row-deleting\", this);\r\n\t}\r\n\t\r\n\tdeleteCells(){\r\n\t\tvar cellCount = this.cells.length;\r\n\t\t\r\n\t\tfor(let i = 0; i < cellCount; i++){\r\n\t\t\tthis.cells[0].delete();\r\n\t\t}\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tthis.detachModules();\r\n\t\tthis.deleteCells();\r\n\t\t\r\n\t\tif(this.element){\r\n\t\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\t\r\n\t\t\tif(this.element.parentNode){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.modules = {};\r\n\t}\r\n\r\n\tisDisplayed(){\r\n\t\treturn this.table.rowManager.getDisplayRows().includes(this);\r\n\t}\r\n\r\n\tgetPosition(){\r\n\t\treturn this.isDisplayed() ? this.position : false;\r\n\t}\r\n\r\n\tsetPosition(position){\r\n\t\tif(position != this.position){\r\n\t\t\tthis.position = position;\r\n\r\n\t\t\tthis.positionWatchers.forEach((callback) => {\r\n\t\t\t\tcallback(this.position);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twatchPosition(callback){\r\n\t\tthis.positionWatchers.push(callback);\r\n\r\n\t\tcallback(this.position);\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this.modules.group || false;\r\n\t}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new RowComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}","export default {\r\n\t\"avg\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : 2;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn Number(sum) + Number(value);\r\n\t\t\t});\r\n\r\n\t\t\toutput = output / values.length;\r\n\r\n\t\t\toutput = precision !== false ? output.toFixed(precision) : output;\r\n\t\t}\r\n\r\n\t\treturn parseFloat(output).toString();\r\n\t},\r\n\t\"max\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value > output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"min\":function(values, data, calcParams){\r\n\t\tvar output = null,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tvalues.forEach(function(value){\r\n\r\n\t\t\tvalue = Number(value);\r\n\r\n\t\t\tif(value < output || output === null){\r\n\t\t\t\toutput = value;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output !== null ? (precision !== false ? output.toFixed(precision) : output) : \"\";\r\n\t},\r\n\t\"sum\":function(values, data, calcParams){\r\n\t\tvar output = 0,\r\n\t\tprecision = typeof calcParams.precision !== \"undefined\" ? calcParams.precision : false;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tvalue = Number(value);\r\n\r\n\t\t\t\toutput += !isNaN(value) ? Number(value) : 0;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn precision !== false ? output.toFixed(precision) : output;\r\n\t},\r\n\t\"concat\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\toutput = values.reduce(function(sum, value){\r\n\t\t\t\treturn String(sum) + String(value);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n\t\"count\":function(values, data, calcParams){\r\n\t\tvar output = 0;\r\n\r\n\t\tif(values.length){\r\n\t\t\tvalues.forEach(function(value){\r\n\t\t\t\tif(value){\r\n\t\t\t\t\toutput ++;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport CalcComponent from './CalcComponent.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport defaultCalculations from './defaults/calculations.js';\r\n\r\nclass ColumnCalcs extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topCalcs = [];\r\n\t\tthis.botCalcs = [];\r\n\t\tthis.genColumn = false;\r\n\t\tthis.topElement = this.createElement();\r\n\t\tthis.botElement = this.createElement();\r\n\t\tthis.topRow = false;\r\n\t\tthis.botRow = false;\r\n\t\tthis.topInitialized = false;\r\n\t\tthis.botInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"columnCalcs\", true);\r\n\r\n\t\tthis.registerColumnOption(\"topCalc\");\r\n\t\tthis.registerColumnOption(\"topCalcParams\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"topCalcFormatterParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalc\");\r\n\t\tthis.registerColumnOption(\"bottomCalcParams\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatter\");\r\n\t\tthis.registerColumnOption(\"bottomCalcFormatterParams\");\r\n\t}\r\n\r\n\tcreateElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-calcs-holder\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.genColumn = new Column({field:\"value\"}, this);\r\n\r\n\t\tthis.subscribe(\"cell-value-changed\", this.cellValueChanged.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\tthis.subscribe(\"column-moved\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"column-add\", this.recalcActiveRows.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.recalcActiveRowsRefresh.bind(this));\r\n\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"getCalcResults\", this.getResults.bind(this));\r\n\t\tthis.registerTableFunction(\"recalc\", this.userRecalc.bind(this));\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\r\n\t\tif(force){\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tuserRecalc(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tif(this.topRow){\r\n\t\t\trows.unshift(this.topRow);\r\n\t\t}\r\n\r\n\t\tif(this.botRow){\r\n\t\t\trows.push(this.botRow);\r\n\t\t}\r\n\t\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.recalcRowGroup(row);\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRowsRefresh(){\r\n\t\tif(this.table.options.groupBy && this.table.options.dataTreeStartExpanded && this.table.options.dataTree){\r\n\t\t\tthis.recalcAll();\r\n\t\t}else{\r\n\t\t\tthis.recalcActiveRows();\r\n\t\t}\r\n\t}\r\n\r\n\trecalcActiveRows(){\r\n\t\tthis.recalc(this.table.rowManager.activeRows);\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tif(cell.column.definition.topCalc || cell.column.definition.bottomCalc){\r\n\t\t\tif(this.table.options.groupBy){\r\n\t\t\t\tif(this.table.options.columnCalcs == \"table\" || this.table.options.columnCalcs == \"both\"){\r\n\t\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\tthis.recalcRowGroup(cell.row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumnCheck(column){\r\n\t\tif(column.definition.topCalc || column.definition.bottomCalc){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column calcs\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tvar config = {\r\n\t\t\ttopCalcParams:def.topCalcParams || {},\r\n\t\t\tbotCalcParams:def.bottomCalcParams || {},\r\n\t\t};\r\n\r\n\t\tif(def.topCalc){\r\n\r\n\t\t\tswitch(typeof def.topCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.topCalc]){\r\n\t\t\t\t\t\tconfig.topCalc = ColumnCalcs.calculations[def.topCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.topCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.topCalc = def.topCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.topCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.topCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeTopRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif(def.bottomCalc){\r\n\t\t\tswitch(typeof def.bottomCalc){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(ColumnCalcs.calculations[def.bottomCalc]){\r\n\t\t\t\t\t\tconfig.botCalc = ColumnCalcs.calculations[def.bottomCalc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Column Calc Error - No such calculation found, ignoring: \", def.bottomCalc);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tconfig.botCalc = def.bottomCalc;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(config.botCalc){\r\n\t\t\t\tcolumn.modules.columnCalcs = config;\r\n\t\t\t\tthis.botCalcs.push(column);\r\n\r\n\t\t\t\tif(this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\tthis.initializeBottomRow();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//dummy functions to handle being mock column manager\r\n\tregisterColumnField(){}\r\n\r\n\tremoveCalcs(){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(this.topInitialized){\r\n\t\t\tthis.topInitialized = false;\r\n\t\t\tthis.topElement.parentNode.removeChild(this.topElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(this.botInitialized){\r\n\t\t\tthis.botInitialized = false;\r\n\t\t\tthis.footerRemove(this.botElement);\r\n\t\t\tchanged = true;\r\n\t\t}\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeTopRow(){\r\n\t\tif(!this.topInitialized){\r\n\t\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\t\t\tthis.topInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeBottomRow(){\r\n\t\tif(!this.botInitialized){\r\n\t\t\tthis.footerPrepend(this.botElement);\r\n\t\t\tthis.botInitialized = true;\r\n\t\t}\r\n\t}\r\n\r\n\tscrollHorizontal(left){\r\n\t\tif(this.botInitialized && this.botRow){\r\n\t\t\tif(this.table.rtl){\r\n\t\t\t\tthis.botRow.getElement().style.marginRight = (left) + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.botRow.getElement().style.marginLeft = (-left) + \"px\";\r\n\t\t\t}\t\r\n\t\t}\r\n\t}\r\n\r\n\trecalc(rows){\r\n\t\tvar data, row;\r\n\r\n\t\tif(this.topInitialized || this.botInitialized){\r\n\t\t\tdata = this.rowsToData(rows);\r\n\r\n\t\t\tif(this.topInitialized){\r\n\t\t\t\tif(this.topRow){\r\n\t\t\t\t\tthis.topRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"top\", data);\r\n\t\t\t\tthis.topRow = row;\r\n\t\t\t\twhile(this.topElement.firstChild) this.topElement.removeChild(this.topElement.firstChild);\r\n\t\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.botInitialized){\r\n\t\t\t\tif(this.botRow){\r\n\t\t\t\t\tthis.botRow.deleteCells();\r\n\t\t\t\t}\r\n\r\n\t\t\t\trow = this.generateRow(\"bottom\", data);\r\n\t\t\t\tthis.botRow = row;\r\n\t\t\t\twhile(this.botElement.firstChild) this.botElement.removeChild(this.botElement.firstChild);\r\n\t\t\t\tthis.botElement.appendChild(row.getElement());\r\n\t\t\t\trow.initialize(true);\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\t//set resizable handles\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tthis.table.modules.frozenColumns.layout();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcRowGroup(row){\r\n\t\tthis.recalcGroup(this.table.modules.groupRows.getRowGroup(row));\r\n\t}\r\n\r\n\trecalcAll(){\r\n\t\tif(this.topCalcs.length || this.botCalcs.length){\r\n\t\t\tif(this.table.options.columnCalcs !== \"group\"){\r\n\t\t\t\tthis.recalcActiveRows();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.groupBy && this.table.options.columnCalcs !== \"table\"){\r\n\r\n\t\t\t\tvar groups = this.table.modules.groupRows.getChildGroups();\r\n\r\n\t\t\t\tgroups.forEach((group) => {\r\n\t\t\t\t\tthis.recalcGroup(group);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trecalcGroup(group){\r\n\t\tvar data, rowData;\r\n\r\n\t\tif(group){\r\n\t\t\tif(group.calcs){\r\n\t\t\t\tif(group.calcs.bottom){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"bottom\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.bottom.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.bottom.reinitialize();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(group.calcs.top){\r\n\t\t\t\t\tdata = this.rowsToData(group.rows);\r\n\t\t\t\t\trowData = this.generateRowData(\"top\", data);\r\n\r\n\t\t\t\t\tgroup.calcs.top.updateData(rowData);\r\n\t\t\t\t\tgroup.calcs.top.reinitialize();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//generate top stats row\r\n\tgenerateTopRow(rows){\r\n\t\treturn this.generateRow(\"top\", this.rowsToData(rows));\r\n\t}\r\n\t//generate bottom stats row\r\n\tgenerateBottomRow(rows){\r\n\t\treturn this.generateRow(\"bottom\", this.rowsToData(rows));\r\n\t}\r\n\r\n\trowsToData(rows){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tdata.push(row.getData());\r\n\r\n\t\t\tif(this.table.options.dataTree && this.table.options.dataTreeChildColumnCalcs){\r\n\t\t\t\tif(row.modules.dataTree && row.modules.dataTree.open){\r\n\t\t\t\t\tvar children = this.rowsToData(this.table.modules.dataTree.getFilteredTreeChildren(row));\r\n\t\t\t\t\tdata = data.concat(children);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRow(pos, data){\r\n\t\tvar rowData = this.generateRowData(pos, data),\r\n\t\trow;\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.disable();\r\n\t\t}\r\n\r\n\t\trow = new Row(rowData, this, \"calc\");\r\n\r\n\t\tif(this.table.modExists(\"mutator\")){\r\n\t\t\tthis.table.modules.mutator.enable();\r\n\t\t}\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-calcs\", \"tabulator-calcs-\" + pos);\r\n\r\n\t\trow.component = false;\r\n\r\n\t\trow.getComponent = () => {\r\n\t\t\tif(!row.component){\r\n\t\t\t\trow.component = new CalcComponent(row);\r\n\t\t\t}\r\n\r\n\t\t\treturn row.component;\r\n\t\t};\r\n\r\n\t\trow.generateCells = () => {\r\n\r\n\t\t\tvar cells = [];\r\n\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\r\n\t\t\t\t//set field name of mock column\r\n\t\t\t\tthis.genColumn.setField(column.getField());\r\n\t\t\t\tthis.genColumn.hozAlign = column.hozAlign;\r\n\r\n\t\t\t\tif(column.definition[pos + \"CalcFormatter\"] && this.table.modExists(\"format\")){\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(column.definition[pos + \"CalcFormatter\"]),\r\n\t\t\t\t\t\tparams: column.definition[pos + \"CalcFormatterParams\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.genColumn.modules.format = {\r\n\t\t\t\t\t\tformatter: this.table.modules.format.getFormatter(\"plaintext\"),\r\n\t\t\t\t\t\tparams:{}\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//ensure css class definition is replicated to calculation cell\r\n\t\t\t\tthis.genColumn.definition.cssClass = column.definition.cssClass;\r\n\r\n\t\t\t\t//generate cell and assign to correct column\r\n\t\t\t\tvar cell = new Cell(this.genColumn, row);\r\n\t\t\t\tcell.getElement();\r\n\t\t\t\tcell.column = column;\r\n\t\t\t\tcell.setWidth();\r\n\r\n\t\t\t\tcolumn.cells.push(cell);\r\n\t\t\t\tcells.push(cell);\r\n\r\n\t\t\t\tif(!column.visible){\r\n\t\t\t\t\tcell.hide();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trow.cells = cells;\r\n\t\t};\r\n\r\n\t\treturn row;\r\n\t}\r\n\r\n\t//generate stats row\r\n\tgenerateRowData(pos, data){\r\n\t\tvar rowData = {},\r\n\t\tcalcs = pos == \"top\" ? this.topCalcs : this.botCalcs,\r\n\t\ttype = pos == \"top\" ? \"topCalc\" : \"botCalc\",\r\n\t\tparams, paramKey;\r\n\r\n\t\tcalcs.forEach(function(column){\r\n\t\t\tvar values = [];\r\n\r\n\t\t\tif(column.modules.columnCalcs && column.modules.columnCalcs[type]){\r\n\t\t\t\tdata.forEach(function(item){\r\n\t\t\t\t\tvalues.push(column.getFieldValue(item));\r\n\t\t\t\t});\r\n\r\n\t\t\t\tparamKey = type + \"Params\";\r\n\t\t\t\tparams = typeof column.modules.columnCalcs[paramKey] === \"function\" ? column.modules.columnCalcs[paramKey](values, data) : column.modules.columnCalcs[paramKey];\r\n\r\n\t\t\t\tcolumn.setFieldValue(rowData, column.modules.columnCalcs[type](values, data, params));\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\thasTopCalcs(){\r\n\t\treturn\t!!(this.topCalcs.length);\r\n\t}\r\n\r\n\thasBottomCalcs(){\r\n\t\treturn\t!!(this.botCalcs.length);\r\n\t}\r\n\r\n\t//handle table redraw\r\n\tredraw(){\r\n\t\tif(this.topRow){\r\n\t\t\tthis.topRow.normalizeHeight(true);\r\n\t\t}\r\n\t\tif(this.botRow){\r\n\t\t\tthis.botRow.normalizeHeight(true);\r\n\t\t}\r\n\t}\r\n\r\n\t//return the calculated\r\n\tgetResults(){\r\n\t\tvar results = {},\r\n\t\tgroups;\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tgroups = this.table.modules.groupRows.getGroups(true);\r\n\r\n\t\t\tgroups.forEach((group) => {\r\n\t\t\t\tresults[group.getKey()] = this.getGroupResults(group);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tresults = {\r\n\t\t\t\ttop: this.topRow ? this.topRow.getData() : {},\r\n\t\t\t\tbottom: this.botRow ? this.botRow.getData() : {},\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\t//get results from a group\r\n\tgetGroupResults(group){\r\n\t\tvar groupObj = group._getSelf(),\r\n\t\tsubGroups = group.getSubGroups(),\r\n\t\tsubGroupResults = {},\r\n\t\tresults = {};\r\n\r\n\t\tsubGroups.forEach((subgroup) => {\r\n\t\t\tsubGroupResults[subgroup.getKey()] = this.getGroupResults(subgroup);\r\n\t\t});\r\n\r\n\t\tresults = {\r\n\t\t\ttop: groupObj.calcs.top ? groupObj.calcs.top.getData() : {},\r\n\t\t\tbottom: groupObj.calcs.bottom ? groupObj.calcs.bottom.getData() : {},\r\n\t\t\tgroups: subGroupResults,\r\n\t\t};\r\n\r\n\t\treturn results;\r\n\t}\r\n}\r\n\r\nColumnCalcs.moduleName = \"columnCalcs\";\r\n\r\n//load defaults\r\nColumnCalcs.calculations = defaultCalculations;\r\n\r\nexport default ColumnCalcs;","import Module from '../../core/Module.js';\r\n\r\nimport Row from '../../core/row/Row.js';\r\n\r\nimport RowComponent from '../../core/row/RowComponent.js';\r\n\r\nclass DataTree extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.indent = 10;\r\n\t\tthis.field = \"\";\r\n\t\tthis.collapseEl = null;\r\n\t\tthis.expandEl = null;\r\n\t\tthis.branchEl = null;\r\n\t\tthis.elementField = false;\r\n\r\n\t\tthis.startOpen = function(){};\r\n\r\n\t\tthis.registerTableOption(\"dataTree\", false); //enable data tree\r\n\t\tthis.registerTableOption(\"dataTreeFilter\", true); //filter child rows\r\n\t\tthis.registerTableOption(\"dataTreeSort\", true); //sort child rows\r\n\t\tthis.registerTableOption(\"dataTreeElementColumn\", false);\r\n\t\tthis.registerTableOption(\"dataTreeBranchElement\", true);//show data tree branch element\r\n\t\tthis.registerTableOption(\"dataTreeChildIndent\", 9); //data tree child indent in px\r\n\t\tthis.registerTableOption(\"dataTreeChildField\", \"_children\");//data tre column field to look for child rows\r\n\t\tthis.registerTableOption(\"dataTreeCollapseElement\", false);//data tree row collapse element\r\n\t\tthis.registerTableOption(\"dataTreeExpandElement\", false);//data tree row expand element\r\n\t\tthis.registerTableOption(\"dataTreeStartExpanded\", false);\r\n\t\tthis.registerTableOption(\"dataTreeChildColumnCalcs\", false);//include visible data tree rows in column calculations\r\n\t\tthis.registerTableOption(\"dataTreeSelectPropagate\", false);//selecting a parent row selects its children\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"treeCollapse\", this.collapseRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeExpand\", this.expandRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"treeToggle\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeParent\", this.getTreeParent.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"getTreeChildren\", this.getRowChildren.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"addTreeChild\", this.addTreeChildRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isTreeExpanded\", this.isRowExpanded.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tvar dummyEl = null,\r\n\t\t\toptions = this.table.options;\r\n\r\n\t\t\tthis.field = options.dataTreeChildField;\r\n\t\t\tthis.indent = options.dataTreeChildIndent;\r\n\r\n\t\t\tif(this.options(\"movableRows\")){\r\n\t\t\t\tconsole.warn(\"The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior\");\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeBranchElement){\r\n\r\n\t\t\t\tif(options.dataTreeBranchElement === true){\r\n\t\t\t\t\tthis.branchEl = document.createElement(\"div\");\r\n\t\t\t\t\tthis.branchEl.classList.add(\"tabulator-data-tree-branch\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(typeof options.dataTreeBranchElement === \"string\"){\r\n\t\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\t\tdummyEl.innerHTML = options.dataTreeBranchElement;\r\n\t\t\t\t\t\tthis.branchEl = dummyEl.firstChild;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.branchEl = options.dataTreeBranchElement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeCollapseElement){\r\n\t\t\t\tif(typeof options.dataTreeCollapseElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeCollapseElement;\r\n\t\t\t\t\tthis.collapseEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.collapseEl = options.dataTreeCollapseElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseEl = document.createElement(\"div\");\r\n\t\t\t\tthis.collapseEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.collapseEl.tabIndex = 0;\r\n\t\t\t\tthis.collapseEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif(options.dataTreeExpandElement){\r\n\t\t\t\tif(typeof options.dataTreeExpandElement === \"string\"){\r\n\t\t\t\t\tdummyEl = document.createElement(\"div\");\r\n\t\t\t\t\tdummyEl.innerHTML = options.dataTreeExpandElement;\r\n\t\t\t\t\tthis.expandEl = dummyEl.firstChild;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.expandEl = options.dataTreeExpandElement;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandEl = document.createElement(\"div\");\r\n\t\t\t\tthis.expandEl.classList.add(\"tabulator-data-tree-control\");\r\n\t\t\t\tthis.expandEl.tabIndex = 0;\r\n\t\t\t\tthis.expandEl.innerHTML = \"
\";\r\n\t\t\t}\r\n\r\n\r\n\t\t\tswitch(typeof options.dataTreeStartExpanded){\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tthis.startOpen = options.dataTreeStartExpanded;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.startOpen = function(row, index){\r\n\t\t\t\t\t\treturn options.dataTreeStartExpanded[index];\r\n\t\t\t\t\t};\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowDelete.bind(this),0);\r\n\t\t\tthis.subscribe(\"row-data-changed\", this.rowDataChanged.bind(this), 10);\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"edit-cancelled\", this.cellValueChanged.bind(this));\r\n\t\t\tthis.subscribe(\"column-moving-rows\", this.columnMoving.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.initializeElementField.bind(this));\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedrawing.bind(this));\r\n\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 30);\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedrawing(force){\r\n\t\tvar rows;\r\n\r\n\t\tif(force){\r\n\t\t\trows = this.table.rowManager.getRows();\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.reinitializeRowChildren(row);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeElementField(){\r\n\t\tvar firstCol = this.table.columnManager.getFirstVisibleColumn();\r\n\r\n\t\tthis.elementField = this.table.options.dataTreeElementColumn || (firstCol ? firstCol.field : false);\r\n\t}\r\n\t\r\n\tgetRowChildren(row){\r\n\t\treturn this.getTreeChildren(row, true);\r\n\t}\r\n\r\n\tcolumnMoving(){\r\n\t\tvar rows = [];\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trows = rows.concat(this.getTreeChildren(row, false, true));\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\trowDataChanged(row, visible, updatedData){\r\n\t\tif(this.redrawNeeded(updatedData)){\r\n\t\t\tthis.initializeRow(row);\r\n\r\n\t\t\tif(visible){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tcellValueChanged(cell){\r\n\t\tvar field = cell.column.getField();\r\n\r\n\t\tif(field === this.elementField){\r\n\t\t\tthis.layoutRow(cell.row);\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar childArray = row.getData()[this.field];\r\n\t\tvar isArray = Array.isArray(childArray);\r\n\r\n\t\tvar children = isArray || (!isArray && typeof childArray === \"object\" && childArray !== null);\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.branchEl){\r\n\t\t\trow.modules.dataTree.branchEl.parentNode.removeChild(row.modules.dataTree.branchEl);\r\n\t\t}\r\n\r\n\t\tif(!children && row.modules.dataTree && row.modules.dataTree.controlEl){\r\n\t\t\trow.modules.dataTree.controlEl.parentNode.removeChild(row.modules.dataTree.controlEl);\r\n\t\t}\r\n\r\n\t\trow.modules.dataTree = {\r\n\t\t\tindex: row.modules.dataTree ? row.modules.dataTree.index : 0,\r\n\t\t\topen: children ? (row.modules.dataTree ? row.modules.dataTree.open : this.startOpen(row.getComponent(), 0)) : false,\r\n\t\t\tcontrolEl: row.modules.dataTree && children ? row.modules.dataTree.controlEl : false,\r\n\t\t\tbranchEl: row.modules.dataTree && children ? row.modules.dataTree.branchEl : false,\r\n\t\t\tparent: row.modules.dataTree ? row.modules.dataTree.parent : false,\r\n\t\t\tchildren:children,\r\n\t\t};\r\n\t}\r\n\r\n\treinitializeRowChildren(row){\r\n\t\tvar children = this.getTreeChildren(row, false, true);\r\n\r\n\t\tchildren.forEach(function(child){\r\n\t\t\tchild.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar cell = this.elementField ? row.getCell(this.elementField) : row.getCells()[0],\r\n\t\tel = cell.getElement(),\r\n\t\tconfig = row.modules.dataTree;\r\n\r\n\t\tif(config.branchEl){\r\n\t\t\tif(config.branchEl.parentNode){\r\n\t\t\t\tconfig.branchEl.parentNode.removeChild(config.branchEl);\r\n\t\t\t}\r\n\t\t\tconfig.branchEl = false;\r\n\t\t}\r\n\r\n\t\tif(config.controlEl){\r\n\t\t\tif(config.controlEl.parentNode){\r\n\t\t\t\tconfig.controlEl.parentNode.removeChild(config.controlEl);\r\n\t\t\t}\r\n\t\t\tconfig.controlEl = false;\r\n\t\t}\r\n\r\n\t\tthis.generateControlElement(row, el);\r\n\r\n\t\trow.getElement().classList.add(\"tabulator-tree-level-\" + config.index);\r\n\r\n\t\tif(config.index){\r\n\t\t\tif(this.branchEl){\r\n\t\t\t\tconfig.branchEl = this.branchEl.cloneNode(true);\r\n\t\t\t\tel.insertBefore(config.branchEl, el.firstChild);\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tconfig.branchEl.style.marginRight = (((config.branchEl.offsetWidth + config.branchEl.style.marginLeft) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.branchEl.style.marginLeft = (((config.branchEl.offsetWidth + config.branchEl.style.marginRight) * (config.index - 1)) + (config.index * this.indent)) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(this.table.rtl){\r\n\t\t\t\t\tel.style.paddingRight = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-right')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.style.paddingLeft = parseInt(window.getComputedStyle(el, null).getPropertyValue('padding-left')) + (config.index * this.indent) + \"px\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateControlElement(row, el){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toldControl = config.controlEl;\r\n\r\n\t\tel = el || row.getCells()[0].getElement();\r\n\r\n\t\tif(config.children !== false){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tconfig.controlEl = this.collapseEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.collapseRow(row);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconfig.controlEl = this.expandEl.cloneNode(true);\r\n\t\t\t\tconfig.controlEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\tthis.expandRow(row);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tconfig.controlEl.addEventListener(\"mousedown\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\r\n\t\t\tif(oldControl && oldControl.parentNode === el){\r\n\t\t\t\toldControl.parentNode.replaceChild(config.controlEl,oldControl);\r\n\t\t\t}else{\r\n\t\t\t\tel.insertBefore(config.controlEl, el.firstChild);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetRows(rows){\r\n\t\tvar output = [];\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar config, children;\r\n\r\n\t\t\toutput.push(row);\r\n\r\n\t\t\tif(row instanceof Row){\r\n\r\n\t\t\t\trow.create();\r\n\r\n\t\t\t\tconfig = row.modules.dataTree.children;\r\n\r\n\t\t\t\tif(!config.index && config.children !== false){\r\n\t\t\t\t\tchildren = this.getChildren(row);\r\n\r\n\t\t\t\t\tchildren.forEach((child) => {\r\n\t\t\t\t\t\tchild.create();\r\n\t\t\t\t\t\toutput.push(child);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildren(row, allChildren){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\tchildren = [],\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children !== false && (config.open || allChildren)){\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"sort\") && this.table.options.dataTreeSort){\r\n\t\t\t\tthis.table.modules.sort.sort(children);\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((child) => {\r\n\t\t\t\toutput.push(child);\r\n\r\n\t\t\t\tvar subChildren = this.getChildren(child);\r\n\r\n\t\t\t\tsubChildren.forEach((sub) => {\r\n\t\t\t\t\toutput.push(sub);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgenerateChildren(row){\r\n\t\tvar children = [];\r\n\r\n\t\tvar childArray = row.getData()[this.field];\r\n\r\n\t\tif(!Array.isArray(childArray)){\r\n\t\t\tchildArray = [childArray];\r\n\t\t}\r\n\r\n\t\tchildArray.forEach((childData) => {\r\n\t\t\tvar childRow = new Row(childData || {}, this.table.rowManager);\r\n\r\n\t\t\tchildRow.create();\r\n\r\n\t\t\tchildRow.modules.dataTree.index = row.modules.dataTree.index + 1;\r\n\t\t\tchildRow.modules.dataTree.parent = row;\r\n\r\n\t\t\tif(childRow.modules.dataTree.children){\r\n\t\t\t\tchildRow.modules.dataTree.open = this.startOpen(childRow.getComponent(), childRow.modules.dataTree.index);\r\n\t\t\t}\r\n\t\t\tchildren.push(childRow);\r\n\t\t});\r\n\r\n\t\treturn children;\r\n\t}\r\n\r\n\texpandRow(row, silent){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = true;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowExpanded\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\tcollapseRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tconfig.open = false;\r\n\r\n\t\t\trow.reinitialize();\r\n\r\n\t\t\tthis.refreshData(true);\r\n\r\n\t\t\tthis.dispatchExternal(\"dataTreeRowCollapsed\", row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\t}\r\n\r\n\ttoggleRow(row){\r\n\t\tvar config = row.modules.dataTree;\r\n\r\n\t\tif(config.children !== false){\r\n\t\t\tif(config.open){\r\n\t\t\t\tthis.collapseRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.expandRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowExpanded(row){\r\n\t\treturn row.modules.dataTree.open;\r\n\t}\r\n\r\n\tgetTreeParent(row){\r\n\t\treturn row.modules.dataTree.parent ? row.modules.dataTree.parent.getComponent() : false;\r\n\t}\r\n\r\n\tgetTreeParentRoot(row){\r\n\t\treturn row.modules.dataTree && row.modules.dataTree.parent ? this.getTreeParentRoot(row.modules.dataTree.parent) : row;\r\n\t}\r\n\r\n\tgetFilteredTreeChildren(row){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [], children;\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modExists(\"filter\") && this.table.options.dataTreeFilter){\r\n\t\t\t\tchildren = this.table.modules.filter.filter(config.children);\r\n\t\t\t}else{\r\n\t\t\t\tchildren = config.children;\r\n\t\t\t}\r\n\r\n\t\t\tchildren.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(childRow);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\trowDelete(row){\r\n\t\tvar parent = row.modules.dataTree.parent,\r\n\t\tchildIndex;\r\n\r\n\t\tif(parent){\r\n\t\t\tchildIndex = this.findChildIndex(row, parent);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\tparent.data[this.field].splice(childIndex, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif(!parent.data[this.field].length){\r\n\t\t\t\tdelete parent.data[this.field];\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeRow(parent);\r\n\t\t\tthis.layoutRow(parent);\r\n\t\t}\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\taddTreeChildRow(row, data, top, index){\r\n\t\tvar childIndex = false;\r\n\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(!Array.isArray(row.data[this.field])){\r\n\t\t\trow.data[this.field] = [];\r\n\r\n\t\t\trow.modules.dataTree.open = this.startOpen(row.getComponent(), row.modules.dataTree.index);\r\n\t\t}\r\n\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tchildIndex = this.findChildIndex(index, row);\r\n\r\n\t\t\tif(childIndex !== false){\r\n\t\t\t\trow.data[this.field].splice((top ? childIndex : childIndex + 1), 0, data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(childIndex === false){\r\n\t\t\tif(top){\r\n\t\t\t\trow.data[this.field].unshift(data);\r\n\t\t\t}else{\r\n\t\t\t\trow.data[this.field].push(data);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.initializeRow(row);\r\n\t\tthis.layoutRow(row);\r\n\r\n\t\tthis.refreshData(true);\r\n\t}\r\n\r\n\tfindChildIndex(subject, parent){\r\n\t\tvar match = false;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\tmatch = subject.data;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\tmatch = subject._getSelf().data;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\tif(parent.modules.dataTree){\r\n\t\t\t\t\tmatch = parent.modules.dataTree.children.find((childRow) => {\r\n\t\t\t\t\t\treturn childRow instanceof Row ? childRow.element === subject : false;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tmatch = match.data;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\tmatch = false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tmatch = parent.data[this.field].find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(match){\r\n\r\n\t\t\tif(Array.isArray(parent.data[this.field])){\r\n\t\t\t\tmatch = parent.data[this.field].indexOf(match);\r\n\t\t\t}\r\n\r\n\t\t\tif(match == -1){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//catch all for any other type of input\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tgetTreeChildren(row, component, recurse){\r\n\t\tvar config = row.modules.dataTree,\r\n\t\toutput = [];\r\n\r\n\t\tif(config.children){\r\n\r\n\t\t\tif(!Array.isArray(config.children)){\r\n\t\t\t\tconfig.children = this.generateChildren(row);\r\n\t\t\t}\r\n\r\n\t\t\tconfig.children.forEach((childRow) => {\r\n\t\t\t\tif(childRow instanceof Row){\r\n\t\t\t\t\toutput.push(component ? childRow.getComponent() : childRow);\r\n\r\n\t\t\t\t\tif(recurse){\r\n\t\t\t\t\t\toutput = output.concat(this.getTreeChildren(childRow, component, recurse));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tgetChildField(){\r\n\t\treturn this.field;\r\n\t}\r\n\r\n\tredrawNeeded(data){\r\n\t\treturn (this.field ? typeof data[this.field] !== \"undefined\" : false) || (this.elementField ? typeof data[this.elementField] !== \"undefined\" : false);\r\n\t}\r\n}\r\n\r\nDataTree.moduleName = \"dataTree\";\r\n\r\nexport default DataTree;","import csv from './downloaders/csv.js';\r\nimport json from './downloaders/json.js';\r\nimport pdf from './downloaders/pdf.js';\r\nimport xlsx from './downloaders/xlsx.js';\r\nimport html from './downloaders/html.js';\r\nimport jsonLines from './downloaders/jsonLines.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tjsonLines:jsonLines,\r\n\tpdf:pdf,\r\n\txlsx:xlsx,\r\n\thtml:html,\r\n};","export default function(list, options = {}, setFileContents){\r\n\tvar delimiter = options.delimiter ? options.delimiter : \",\",\r\n\tfileContents = [],\r\n\theaders = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = [];\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - CSV downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"header\":\r\n\t\t\t\trow.columns.forEach((col, i) => {\r\n\t\t\t\t\tif(col && col.depth === 1){\r\n\t\t\t\t\t\theaders[i] = typeof col.value == \"undefined\" || col.value === null ? \"\" : ('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\r\n\t\t\t\t\tif(col){\r\n\r\n\t\t\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.push('\"' + String(col.value).split('\"').join('\"\"') + '\"');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item.join(delimiter));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(headers.length){\r\n\t\tfileContents.unshift(headers.join(delimiter));\r\n\t}\r\n\r\n\tfileContents = fileContents.join(\"\\n\");\r\n\r\n\tif(options.bom){\r\n\t\tfileContents = \"\\ufeff\" + fileContents;\r\n\t}\r\n\r\n\tsetFileContents(fileContents, \"text/csv\");\r\n}\r\n","export default function(list, options, setFileContents){\r\n\tvar fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tvar item = {};\r\n\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif(col){\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(item);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfileContents = JSON.stringify(fileContents, null, '\\t');\r\n\r\n\tsetFileContents(fileContents, \"application/json\");\r\n}","export default function (list, options, setFileContents) {\r\n\tconst fileContents = [];\r\n\r\n\tlist.forEach((row) => {\r\n\t\tconst item = {};\r\n\r\n\t\tswitch (row.type) {\r\n\t\t\tcase \"header\":\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process row groups\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tconsole.warn(\"Download Warning - JSON downloader cannot process column calculations\");\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\trow.columns.forEach((col) => {\r\n\t\t\t\t\tif (col) {\r\n\t\t\t\t\t\titem[col.component.getTitleDownload() || col.component.getField()] = col.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfileContents.push(JSON.stringify(item));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tsetFileContents(fileContents.join(\"\\n\"), \"application/x-ndjson\");\r\n}","export default function(list, options = {}, setFileContents){\r\n\tvar header = [],\r\n\tbody = [],\r\n\tautoTableParams = {},\r\n\trowGroupStyles = options.rowGroupStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 12,\r\n\t\tcellPadding: 6,\r\n\t\tfillColor: 220,\r\n\t},\r\n\trowCalcStyles = options.rowCalcStyles || {\r\n\t\tfontStyle: \"bold\",\r\n\t\tfontSize: 10,\r\n\t\tcellPadding: 4,\r\n\t\tfillColor: 232,\r\n\t},\r\n\tjsPDFParams = options.jsPDF || {},\r\n\ttitle = options.title ? options.title : \"\";\r\n\r\n\tif(!jsPDFParams.orientation){\r\n\t\tjsPDFParams.orientation = options.orientation || \"landscape\";\r\n\t}\r\n\r\n\tif(!jsPDFParams.unit){\r\n\t\tjsPDFParams.unit = \"pt\";\r\n\t}\r\n\r\n\t//parse row list\r\n\tlist.forEach((row) => {\r\n\t\tswitch(row.type){\r\n\t\t\tcase \"header\":\r\n\t\t\t\theader.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tbody.push(parseRow(row, rowGroupStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"calc\":\r\n\t\t\t\tbody.push(parseRow(row, rowCalcStyles));\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"row\":\r\n\t\t\t\tbody.push(parseRow(row));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tfunction parseRow(row, styles){\r\n\t\tvar rowData = [];\r\n\r\n\t\trow.columns.forEach((col) =>{\r\n\t\t\tvar cell;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\tswitch(typeof col.value){\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tcol.value = col.value !== null ? JSON.stringify(col.value) : \"\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tcol.value = \"\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell = {\r\n\t\t\t\t\tcontent:col.value,\r\n\t\t\t\t\tcolSpan:col.width,\r\n\t\t\t\t\trowSpan:col.height,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif(styles){\r\n\t\t\t\t\tcell.styles = styles;\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowData.push(cell);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowData;\r\n\t}\r\n\r\n\r\n\t//configure PDF\r\n\tvar doc = new jspdf.jsPDF(jsPDFParams); //set document to landscape, better for most tables\r\n\r\n\tif(options.autoTable){\r\n\t\tif(typeof options.autoTable === \"function\"){\r\n\t\t\tautoTableParams = options.autoTable(doc) || {};\r\n\t\t}else{\r\n\t\t\tautoTableParams = options.autoTable;\r\n\t\t}\r\n\t}\r\n\r\n\tif(title){\r\n\t\tautoTableParams.didDrawPage = function(data) {\r\n\t\t\tdoc.text(title, 40, 30);\r\n\t\t};\r\n\t}\r\n\r\n\tautoTableParams.head = header;\r\n\tautoTableParams.body = body;\r\n\r\n\tdoc.autoTable(autoTableParams);\r\n\r\n\tif(options.documentProcessing){\r\n\t\toptions.documentProcessing(doc);\r\n\t}\r\n\r\n\tsetFileContents(doc.output(\"arraybuffer\"), \"application/pdf\");\r\n}\r\n","import CoreFeature from '../../../../core/CoreFeature.js';\r\n\r\nexport default function(list, options, setFileContents){\r\n\tvar self = this,\r\n\tsheetName = options.sheetName || \"Sheet1\",\r\n\tworkbook = XLSX.utils.book_new(),\r\n\ttableFeatures = new CoreFeature(this),\r\n\toutput;\r\n\r\n\tworkbook.SheetNames = [];\r\n\tworkbook.Sheets = {};\r\n\r\n\tfunction generateSheet(){\r\n\t\tvar rows = [],\r\n\t\tmerges = [],\r\n\t\tworksheet = {},\r\n\t\trange = {s: {c:0, r:0}, e: {c:(list[0] ? list[0].columns.reduce((a, b) => a + (b && b.width ? b.width : 1), 0) : 0), r:list.length }};\r\n\r\n\t\t//parse row list\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tvar rowData = [];\r\n\r\n\t\t\trow.columns.forEach(function(col, j){\r\n\r\n\t\t\t\tif(col){\r\n\t\t\t\t\trowData.push(!(col.value instanceof Date) && typeof col.value === \"object\" ? JSON.stringify(col.value) : col.value);\r\n\r\n\t\t\t\t\tif(col.width > 1 || col.height > -1){\r\n\t\t\t\t\t\tif(col.height > 1 || col.width > 1){\r\n\t\t\t\t\t\t\tmerges.push({s:{r:i,c:j},e:{r:i + col.height - 1,c:j + col.width - 1}});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowData.push(\"\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trows.push(rowData);\r\n\t\t});\r\n\r\n\t\t//convert rows to worksheet\r\n\t\tXLSX.utils.sheet_add_aoa(worksheet, rows);\r\n\r\n\t\tworksheet['!ref'] = XLSX.utils.encode_range(range);\r\n\r\n\t\tif(merges.length){\r\n\t\t\tworksheet[\"!merges\"] = merges;\r\n\t\t}\r\n\r\n\t\treturn worksheet;\r\n\t}\r\n\r\n\tif(options.sheetOnly){\r\n\t\tsetFileContents(generateSheet());\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(options.sheets){\r\n\t\tfor(var sheet in options.sheets){\r\n\r\n\t\t\tif(options.sheets[sheet] === true){\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\t\t\t\tworkbook.Sheets[sheet] = generateSheet();\r\n\t\t\t}else{\r\n\r\n\t\t\t\tworkbook.SheetNames.push(sheet);\r\n\r\n\t\t\t\ttableFeatures.commsSend(options.sheets[sheet], \"download\", \"intercept\",{\r\n\t\t\t\t\ttype:\"xlsx\",\r\n\t\t\t\t\toptions:{sheetOnly:true},\r\n\t\t\t\t\tactive:self.active,\r\n\t\t\t\t\tintercept:function(data){\r\n\t\t\t\t\t\tworkbook.Sheets[sheet] = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tworkbook.SheetNames.push(sheetName);\r\n\t\tworkbook.Sheets[sheetName] = generateSheet();\r\n\t}\r\n\r\n\tif(options.documentProcessing){\r\n\t\tworkbook = options.documentProcessing(workbook);\r\n\t}\r\n\r\n\t//convert workbook to binary array\r\n\tfunction s2ab(s) {\r\n\t\tvar buf = new ArrayBuffer(s.length);\r\n\t\tvar view = new Uint8Array(buf);\r\n\t\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\r\n\t\treturn buf;\r\n\t}\r\n\r\n\toutput = XLSX.write(workbook, {bookType:'xlsx', bookSST:true, type: 'binary'});\r\n\r\n\tsetFileContents(s2ab(output), \"application/octet-stream\");\r\n}","export default function(list, options, setFileContents){\r\n\tif(this.modExists(\"export\", true)){\r\n\t\tsetFileContents(this.modules.export.generateHTMLTable(list), \"text/html\");\r\n\t}\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultDownloaders from './defaults/downloaders.js';\r\n\r\nclass Download extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerTableOption(\"downloadEncoder\", function(data, mimeType){\r\n\t\t\treturn new Blob([data],{type:mimeType});\r\n\t\t}); //function to manipulate download data\r\n\t\tthis.registerTableOption(\"downloadReady\", undefined); //warn of function deprecation\r\n\t\tthis.registerTableOption(\"downloadConfig\", {}); //download config\r\n\t\tthis.registerTableOption(\"downloadRowRange\", \"active\"); //restrict download to active rows only\r\n\r\n\t\tthis.registerColumnOption(\"download\");\r\n\t\tthis.registerColumnOption(\"titleDownload\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\r\n\t\tthis.registerTableFunction(\"download\", this.download.bind(this));\r\n\t\tthis.registerTableFunction(\"downloadToTab\", this.downloadToTab.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheck(\"downloadReady\", \"downloadEncoder\");\r\n\t}\t\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tdownloadToTab(type, filename, options, active){\r\n\t\tthis.download(type, filename, options, active, true);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//trigger file download\r\n\tdownload(type, filename, options, range, interceptCallback){\r\n\t\tvar downloadFunc = false;\r\n\r\n\t\tfunction buildLink(data, mime){\r\n\t\t\tif(interceptCallback){\r\n\t\t\t\tif(interceptCallback === true){\r\n\t\t\t\t\tthis.triggerDownload(data, mime, type, filename, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinterceptCallback(data);\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tthis.triggerDownload(data, mime, type, filename);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(typeof type == \"function\"){\r\n\t\t\tdownloadFunc = type;\r\n\t\t}else{\r\n\t\t\tif(Download.downloaders[type]){\r\n\t\t\t\tdownloadFunc = Download.downloaders[type];\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Download Error - No such download type found: \", type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(downloadFunc){\r\n\t\t\tvar list = this.generateExportList(range);\r\n\r\n\t\t\tdownloadFunc.call(this.table, list , options || {}, buildLink.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateExportList(range){\r\n\t\tvar list = this.table.modules.export.generateExportList(this.table.options.downloadConfig, false, range || this.table.options.downloadRowRange, \"download\");\r\n\r\n\t\t//assign group header formatter\r\n\t\tvar groupHeader = this.table.options.groupHeaderDownload;\r\n\r\n\t\tif(groupHeader && !Array.isArray(groupHeader)){\r\n\t\t\tgroupHeader = [groupHeader];\r\n\t\t}\r\n\r\n\t\tlist.forEach((row) => {\r\n\t\t\tvar group;\r\n\r\n\t\t\tif(row.type === \"group\"){\r\n\t\t\t\tgroup = row.columns[0];\r\n\r\n\t\t\t\tif(groupHeader && groupHeader[row.indent]){\r\n\t\t\t\t\tgroup.value = groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn list;\r\n\t}\r\n\r\n\ttriggerDownload(data, mime, type, filename, newTab){\r\n\t\tvar element = document.createElement('a'),\r\n\t\tblob = this.table.options.downloadEncoder(data, mime);\r\n\r\n\t\tif(blob){\r\n\t\t\tif(newTab){\r\n\t\t\t\twindow.open(window.URL.createObjectURL(blob));\r\n\t\t\t}else{\r\n\t\t\t\tfilename = filename || \"Tabulator.\" + (typeof type === \"function\" ? \"txt\" : type);\r\n\t\t\t\t\r\n\t\t\t\tif(navigator.msSaveOrOpenBlob){\r\n\t\t\t\t\tnavigator.msSaveOrOpenBlob(blob, filename);\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.setAttribute('href', window.URL.createObjectURL(blob));\r\n\r\n\t\t\t\t\t//set file title\r\n\t\t\t\t\telement.setAttribute('download', filename);\r\n\r\n\t\t\t\t\t//trigger download\r\n\t\t\t\t\telement.style.display = 'none';\r\n\t\t\t\t\tdocument.body.appendChild(element);\r\n\t\t\t\t\telement.click();\r\n\r\n\t\t\t\t\t//remove temporary link element\r\n\t\t\t\t\tdocument.body.removeChild(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"downloadComplete\");\r\n\t\t}\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"intercept\":\r\n\t\t\t\tthis.download(data.type, \"\", data.options, data.active, data.intercept);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nDownload.moduleName = \"download\";\r\n\r\n//load defaults\r\nDownload.downloaders = defaultDownloaders;\r\n\r\nexport default Download;","export default function maskInput(el, options){\r\n\tvar mask = options.mask,\r\n\tmaskLetter = typeof options.maskLetterChar !== \"undefined\" ? options.maskLetterChar : \"A\",\r\n\tmaskNumber = typeof options.maskNumberChar !== \"undefined\" ? options.maskNumberChar : \"9\",\r\n\tmaskWildcard = typeof options.maskWildcardChar !== \"undefined\" ? options.maskWildcardChar : \"*\";\r\n\r\n\tfunction fillSymbols(index){\r\n\t\tvar symbol = mask[index];\r\n\t\tif(typeof symbol !== \"undefined\" && symbol !== maskWildcard && symbol !== maskLetter && symbol !== maskNumber){\r\n\t\t\tel.value = el.value + \"\" + symbol;\r\n\t\t\tfillSymbols(index+1);\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"keydown\", (e) => {\r\n\t\tvar index = el.value.length,\r\n\t\tchar = e.key;\r\n\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(index >= mask.length){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(mask[index]){\r\n\t\t\t\t\tcase maskLetter:\r\n\t\t\t\t\t\tif(char.toUpperCase() == char.toLowerCase()){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskNumber:\r\n\t\t\t\t\t\tif(isNaN(char)){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase maskWildcard:\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(char !== mask[index]){\r\n\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t});\r\n\r\n\tel.addEventListener(\"keyup\", (e) => {\r\n\t\tif(e.keyCode > 46){\r\n\t\t\tif(options.maskAutoFill){\r\n\t\t\t\tfillSymbols(el.value.length);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\r\n\tif(!el.placeholder){\r\n\t\tel.placeholder = mask;\r\n\t}\r\n\r\n\tif(options.maskAutoFill){\r\n\t\tfillSymbols(el.value.length);\r\n\t}\r\n}","import maskInput from './inputMask.js';\r\nimport urlBuilder from '../Ajax/defaults/urlGenerator.js';\r\n\r\nexport default class Edit{\r\n\tconstructor(editor, cell, onRendered, success, cancel, editorParams){\r\n\t\tthis.edit = editor;\r\n\t\tthis.table = editor.table;\r\n\t\tthis.cell = cell;\r\n\t\tthis.params = this._initializeParams(editorParams);\r\n\t\t\r\n\t\tthis.data = [];\r\n\t\tthis.displayItems = [];\r\n\t\tthis.currentItems = [];\r\n\t\tthis.focusedItem = null;\r\n\t\t\r\n\t\tthis.input = this._createInputElement();\r\n\t\tthis.listEl = this._createListElement();\r\n\t\t\r\n\t\tthis.initialValues = null; \r\n\t\t\r\n\t\tthis.isFilter = !cell._getSelf;\r\n\t\t\r\n\t\tthis.filterTimeout = null;\r\n\t\tthis.filtered = false;\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tthis.values = []; \r\n\t\tthis.popup = null; \r\n\t\t\r\n\t\tthis.listIteration = 0;\r\n\t\t\r\n\t\tthis.lastAction=\"\";\r\n\t\t\r\n\t\tthis.blurable = true;\r\n\t\t\r\n\t\tthis.actions = {\r\n\t\t\tsuccess:success,\r\n\t\t\tcancel:cancel\r\n\t\t};\r\n\t\t\r\n\t\tthis._deprecatedOptionsCheck();\r\n\t\tthis._initializeValue();\r\n\t\t\r\n\t\tonRendered(this._onRendered.bind(this));\r\n\t}\r\n\t\r\n\t_deprecatedOptionsCheck(){\r\n\t\tif(this.params.listItemFormatter){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The listItemFormatter editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.sortValuesList){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The sortValuesList editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchFunc){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchFunc editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.searchingPlaceholder){\r\n\t\t\tthis.cell.getTable().deprecationAdvisor.msg(\"The searchingPlaceholder editor param has been deprecated, please see the latest editor documentation for updated options\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t_initializeValue(){\r\n\t\tvar initialValue = this.cell.getValue();\r\n\t\t\r\n\t\tif(typeof initialValue === \"undefined\" && typeof this.params.defaultValue !== \"undefined\"){\r\n\t\t\tinitialValue = this.params.defaultValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.initialValues = this.params.multiselect ? initialValue : [initialValue];\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.input.value = this.initialValues ? this.initialValues.join(\",\") : \"\";\r\n\t\t\tthis.headerFilterInitialListGen(); \r\n\t\t}\r\n\t}\r\n\t\r\n\t_onRendered(){\r\n\t\tvar cellEl = this.cell.getElement();\r\n\t\t\r\n\t\tfunction clickStop(e){\r\n\t\t\te.stopPropagation();\r\n\t\t}\r\n\t\t\r\n\t\tthis.input.style.height = \"100%\";\r\n\t\tthis.input.focus({preventScroll: true});\r\n\t\t\r\n\t\t\r\n\t\tcellEl.addEventListener(\"click\", clickStop);\r\n\t\t\r\n\t\tsetTimeout(() => {\r\n\t\t\tcellEl.removeEventListener(\"click\", clickStop);\r\n\t\t}, 1000);\r\n\t\t\r\n\t\tthis.input.addEventListener(\"mousedown\", this._preventPopupBlur.bind(this));\r\n\t}\r\n\t\r\n\t_createListElement(){\r\n\t\tvar listEl = document.createElement(\"div\");\r\n\t\tlistEl.classList.add(\"tabulator-edit-list\");\r\n\t\t\r\n\t\tlistEl.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\tlistEl.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\t\r\n\t\treturn listEl;\r\n\t}\r\n\t\r\n\t_setListWidth(){\r\n\t\tvar element = this.isFilter ? this.input : this.cell.getElement();\r\n\t\t\r\n\t\tthis.listEl.style.minWidth = element.offsetWidth + \"px\";\r\n\t\t\r\n\t\tif(this.params.maxWidth){\r\n\t\t\tif(this.params.maxWidth === true){\r\n\t\t\t\tthis.listEl.style.maxWidth = element.offsetWidth + \"px\";\r\n\t\t\t}else if(typeof this.params.maxWidth === \"number\"){\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth + \"px\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.listEl.style.maxWidth = this.params.maxWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t_createInputElement(){\r\n\t\tvar attribs = this.params.elementAttributes;\r\n\t\tvar input = document.createElement(\"input\");\r\n\t\t\r\n\t\tinput.setAttribute(\"type\", this.params.clearable ? \"search\" : \"text\");\r\n\t\t\r\n\t\tinput.style.padding = \"4px\";\r\n\t\tinput.style.width = \"100%\";\r\n\t\tinput.style.boxSizing = \"border-box\";\r\n\t\t\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\tinput.style.cursor = \"default\";\r\n\t\t\tinput.style.caretColor = \"transparent\";\r\n\t\t\t// input.readOnly = (this.edit.currentCell != false);\r\n\t\t}\r\n\t\t\r\n\t\tif(attribs && typeof attribs == \"object\"){\r\n\t\t\tfor (let key in attribs){\r\n\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + attribs[\"+\" + key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinput.setAttribute(key, attribs[key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.mask){\r\n\t\t\tmaskInput(input, this.params);\r\n\t\t}\r\n\t\t\r\n\t\tthis._bindInputEvents(input);\r\n\t\t\r\n\t\treturn input;\r\n\t}\r\n\t\r\n\t_initializeParams(params){\r\n\t\tvar valueKeys = [\"values\", \"valuesURL\", \"valuesLookup\"],\r\n\t\tvalueCheck;\r\n\t\t\r\n\t\tparams = Object.assign({}, params);\r\n\t\t\r\n\t\tparams.verticalNavigation = params.verticalNavigation || \"editor\";\r\n\t\tparams.placeholderLoading = typeof params.placeholderLoading === \"undefined\" ? \"Searching ...\" : params.placeholderLoading;\r\n\t\tparams.placeholderEmpty = typeof params.placeholderEmpty === \"undefined\" ? \"No Results Found\" : params.placeholderEmpty;\r\n\t\tparams.filterDelay = typeof params.filterDelay === \"undefined\" ? 300 : params.filterDelay;\r\n\t\t\r\n\t\tparams.emptyValue = Object.keys(params).includes(\"emptyValue\") ? params.emptyValue : \"\";\r\n\t\t\r\n\t\tvalueCheck = Object.keys(params).filter(key => valueKeys.includes(key)).length;\r\n\t\t\r\n\t\tif(!valueCheck){\r\n\t\t\tconsole.warn(\"list editor config error - either the values, valuesURL, or valuesLookup option must be set\");\r\n\t\t}else if(valueCheck > 1){\r\n\t\t\tconsole.warn(\"list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor\");\r\n\t\t}\r\n\t\t\r\n\t\tif(params.autocomplete){\r\n\t\t\tif(params.multiselect){\r\n\t\t\t\tparams.multiselect = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - multiselect option is not available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(params.freetext){\r\n\t\t\t\tparams.freetext = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - freetext option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterFunc){\r\n\t\t\t\tparams.filterFunc = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterFunc option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.filterRemote){\r\n\t\t\t\tparams.filterRemote = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - filterRemote option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.mask){\r\n\t\t\t\tparams.mask = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - mask option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.allowEmpty){\r\n\t\t\t\tparams.allowEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - allowEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(params.listOnEmpty){\r\n\t\t\t\tparams.listOnEmpty = false;\r\n\t\t\t\tconsole.warn(\"list editor config error - listOnEmpty option is only available when autocomplete is enabled\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(params.filterRemote && !(typeof params.valuesLookup === \"function\" || params.valuesURL)){\r\n\t\t\tparams.filterRemote = false;\r\n\t\t\tconsole.warn(\"list editor config error - filterRemote option should only be used when values list is populated from a remote source\");\r\n\t\t}\r\n\t\treturn params;\r\n\t}\r\n\t//////////////////////////////////////\r\n\t////////// Event Handling ////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_bindInputEvents(input){\r\n\t\tinput.addEventListener(\"focus\", this._inputFocus.bind(this));\r\n\t\tinput.addEventListener(\"click\", this._inputClick.bind(this));\r\n\t\tinput.addEventListener(\"blur\", this._inputBlur.bind(this));\r\n\t\tinput.addEventListener(\"keydown\", this._inputKeyDown.bind(this));\r\n\t\tinput.addEventListener(\"search\", this._inputSearch.bind(this));\r\n\t\t\r\n\t\tif(this.params.autocomplete){\r\n\t\t\tinput.addEventListener(\"keyup\", this._inputKeyUp.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t_inputFocus(e){\r\n\t\tthis.rebuildOptionsList();\r\n\t}\r\n\t\r\n\t_filter(){\r\n\t\tif(this.params.filterRemote){\r\n\t\t\tclearTimeout(this.filterTimeout);\r\n\t\t\t\r\n\t\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\t\tthis.rebuildOptionsList();\r\n\t\t\t}, this.params.filterDelay);\r\n\t\t}else{\r\n\t\t\tthis._filterList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputClick(e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t_inputBlur(e){\r\n\t\tif(this.blurable){\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.hide();\r\n\t\t\t}else{\r\n\t\t\t\tthis._resolveValue(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputSearch(){\r\n\t\tthis._clearChoices();\r\n\t}\r\n\t\r\n\t_inputKeyDown(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tthis._keyUp(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tthis._keyDown(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tthis._keySide(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tthis._keyEnter();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tthis._keyEsc();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 36: //home\r\n\t\t\tcase 35: //end\r\n\t\t\t\tthis._keyHomeEnd(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 9: //tab\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keySelectLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_inputKeyUp(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 37: //left arrow\r\n\t\t\tcase 39: //up arrow\r\n\t\t\tcase 40: //right arrow\r\n\t\t\tcase 13: //enter\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis._keyAutoCompLetter(e);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_preventPopupBlur(){\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.blockHide();\r\n\t\t}\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tif(this.popup){\r\n\t\t\t\tthis.popup.restoreHide();\r\n\t\t\t}\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t_preventBlur(){\r\n\t\tthis.blurable = false;\r\n\t\t\r\n\t\tsetTimeout(() =>{\r\n\t\t\tthis.blurable = true;\r\n\t\t}, 10);\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Keyboard Navigation /////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_keyUp(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index > 0){\r\n\t\t\t\tthis._focusItem(this.displayItems[index - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyDown(e){\r\n\t\tvar index = this.displayItems.indexOf(this.focusedItem);\r\n\t\t\r\n\t\tif(this.params.verticalNavigation == \"editor\" || (this.params.verticalNavigation == \"hybrid\" && index < this.displayItems.length - 1)){\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tif(index < this.displayItems.length - 1){\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tthis._focusItem(this.displayItems[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._focusItem(this.displayItems[index + 1]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySide(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t}\r\n\t\r\n\t_keyEnter(e){\r\n\t\tif(this.params.autocomplete && this.lastAction === \"typing\"){\r\n\t\t\tthis._resolveValue(true);\r\n\t\t}else{\r\n\t\t\tif(this.focusedItem){\r\n\t\t\t\tthis._chooseItem(this.focusedItem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyEsc(e){\r\n\t\tthis._cancel();\r\n\t}\r\n\t\r\n\t_keyHomeEnd(e){\r\n\t\tif(this.params.autocomplete){\r\n\t\t\t//prevent table navigation while using input element\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keySelectLetter(e){\r\n\t\tif(!this.params.autocomplete){\r\n\t\t\t// if(this.edit.currentCell === false){\r\n\t\t\te.preventDefault();\r\n\t\t\t// }\r\n\t\t\t\r\n\t\t\tif(e.keyCode >= 38 && e.keyCode <= 90){\r\n\t\t\t\tthis._scrollToValue(e.keyCode);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_keyAutoCompLetter(e){\r\n\t\tthis._filter();\r\n\t\tthis.lastAction = \"typing\";\r\n\t\tthis.typing = true;\r\n\t}\r\n\t\r\n\t\r\n\t_scrollToValue(char){\r\n\t\tclearTimeout(this.filterTimeout);\r\n\t\t\r\n\t\tvar character = String.fromCharCode(char).toLowerCase();\r\n\t\tthis.filterTerm += character.toLowerCase();\r\n\t\t\r\n\t\tvar match = this.displayItems.find((item) => {\r\n\t\t\treturn typeof item.label !== \"undefined\" && item.label.toLowerCase().startsWith(this.filterTerm);\r\n\t\t});\r\n\t\t\r\n\t\tif(match){\r\n\t\t\tthis._focusItem(match);\r\n\t\t}\r\n\t\t\r\n\t\tthis.filterTimeout = setTimeout(() => {\r\n\t\t\tthis.filterTerm = \"\";\r\n\t\t}, 800);\r\n\t}\r\n\t\r\n\t_focusItem(item){\r\n\t\tthis.lastAction = \"focus\";\r\n\t\t\r\n\t\tif(this.focusedItem && this.focusedItem.element){\r\n\t\t\tthis.focusedItem.element.classList.remove(\"focused\");\r\n\t\t}\r\n\t\t\r\n\t\tthis.focusedItem = item;\r\n\t\t\r\n\t\tif(item && item.element){\r\n\t\t\titem.element.classList.add(\"focused\");\r\n\t\t\titem.element.scrollIntoView({behavior: 'smooth', block: 'nearest', inline: 'start'});\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////// Data List Generation /////////\r\n\t//////////////////////////////////////\r\n\theaderFilterInitialListGen(){\r\n\t\tthis._generateOptions(true);\r\n\t}\r\n\t\r\n\trebuildOptionsList(){\r\n\t\tthis._generateOptions()\r\n\t\t\t.then(this._sortOptions.bind(this))\r\n\t\t\t.then(this._buildList.bind(this))\r\n\t\t\t.then(this._showList.bind(this))\r\n\t\t\t.catch((e) => {\r\n\t\t\t\tif(!Number.isInteger(e)){\r\n\t\t\t\t\tconsole.error(\"List generation error\", e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_filterList(){\r\n\t\tthis._buildList(this._filterOptions());\r\n\t\tthis._showList();\r\n\t}\r\n\t\r\n\t_generateOptions(silent){\r\n\t\tvar values = [];\r\n\t\tvar iteration = ++ this.listIteration;\r\n\t\t\r\n\t\tthis.filtered = false;\r\n\t\t\r\n\t\tif(this.params.values){\r\n\t\t\tvalues = this.params.values;\r\n\t\t}else if (this.params.valuesURL){\r\n\t\t\tvalues = this._ajaxRequest(this.params.valuesURL, this.input.value);\r\n\t\t}else{\r\n\t\t\tif(typeof this.params.valuesLookup === \"function\"){\r\n\t\t\t\tvalues = this.params.valuesLookup(this.cell, this.input.value);\r\n\t\t\t}else if(this.params.valuesLookup){\r\n\t\t\t\tvalues = this._uniqueColumnValues(this.params.valuesLookupField);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(values instanceof Promise){\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._addPlaceholder(this.params.placeholderLoading);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn values.then()\r\n\t\t\t\t.then((responseValues) => {\r\n\t\t\t\t\tif(this.listIteration === iteration){\r\n\t\t\t\t\t\treturn this._parseList(responseValues);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\treturn Promise.reject(iteration);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn Promise.resolve(this._parseList(values));\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addPlaceholder(contents){\r\n\t\tvar placeholder = document.createElement(\"div\");\r\n\t\t\r\n\t\tif(typeof contents === \"function\"){\r\n\t\t\tcontents = contents(this.cell.getComponent(), this.listEl);\r\n\t\t}\r\n\t\t\r\n\t\tif(contents){\r\n\t\t\tthis._clearList();\r\n\t\t\t\r\n\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\tplaceholder = contents;\r\n\t\t\t}else{\r\n\t\t\t\tplaceholder.classList.add(\"tabulator-edit-list-placeholder\");\r\n\t\t\t\tplaceholder.innerHTML = contents;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(placeholder);\r\n\t\t\t\r\n\t\t\tthis._showList();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_ajaxRequest(url, term){\r\n\t\tvar params = this.params.filterRemote ? {term:term} : {};\r\n\t\turl = urlBuilder(url, {}, params);\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t.then((response)=>{\r\n\t\t\t\tif(response.ok) {\r\n\t\t\t\t\treturn response.json()\r\n\t\t\t\t\t\t.catch((error)=>{\r\n\t\t\t\t\t\t\tconsole.warn(\"List Ajax Load Error - Invalid JSON returned\", error);\r\n\t\t\t\t\t\t\treturn Promise.reject(error);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \" + response.status, response.statusText);\r\n\t\t\t\t\treturn Promise.reject(response);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error)=>{\r\n\t\t\t\tconsole.error(\"List Ajax Load Error - Connection Error: \", error);\r\n\t\t\t\treturn Promise.reject(error);\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t_uniqueColumnValues(field){\r\n\t\tvar output = {},\r\n\t\tdata = this.table.getData(this.params.valuesLookup),\r\n\t\tcolumn;\r\n\t\t\r\n\t\tif(field){\r\n\t\t\tcolumn = this.table.columnManager.getColumnByField(field);\r\n\t\t}else{\r\n\t\t\tcolumn = this.cell.getColumn()._getSelf();\r\n\t\t}\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\tvar val = column.getFieldValue(row);\r\n\t\t\t\t\r\n\t\t\t\tif(val !== null && typeof val !== \"undefined\" && val !== \"\"){\r\n\t\t\t\t\toutput[val] = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"unable to find matching column to create select lookup list:\", field);\r\n\t\t\toutput = [];\r\n\t\t}\r\n\t\t\r\n\t\treturn Object.keys(output);\r\n\t}\r\n\t\r\n\t\r\n\t_parseList(inputValues){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(!Array.isArray(inputValues)){\r\n\t\t\tinputValues = Object.entries(inputValues).map(([key, value]) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:key,\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tinputValues.forEach((value) => {\r\n\t\t\tif(typeof value !== \"object\"){\r\n\t\t\t\tvalue = {\r\n\t\t\t\t\tlabel:value,\r\n\t\t\t\t\tvalue:value,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._parseListItem(value, data, 0);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.currentItems.length && this.params.freetext){\r\n\t\t\tthis.input.value = this.initialValues;\r\n\t\t\tthis.typing = true;\r\n\t\t\tthis.lastAction = \"typing\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\treturn data; \r\n\t}\r\n\t\r\n\t_parseListItem(option, data, level){\r\n\t\tvar item = {};\r\n\t\t\r\n\t\tif(option.options){\r\n\t\t\titem = this._parseListGroup(option, level + 1);\r\n\t\t}else{\r\n\t\t\titem = {\r\n\t\t\t\tlabel:option.label,\r\n\t\t\t\tvalue:option.value,\r\n\t\t\t\titemParams:option.itemParams,\r\n\t\t\t\telementAttributes: option.elementAttributes,\r\n\t\t\t\telement:false,\r\n\t\t\t\tselected:false,\r\n\t\t\t\tvisible:true,\r\n\t\t\t\tlevel:level,\r\n\t\t\t\toriginal:option,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif(this.initialValues && this.initialValues.indexOf(option.value) > -1){\r\n\t\t\t\tthis._chooseItem(item, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdata.push(item);\r\n\t}\r\n\t\r\n\t_parseListGroup(option, level){\r\n\t\tvar item = {\r\n\t\t\tlabel:option.label,\r\n\t\t\tgroup:true,\r\n\t\t\titemParams:option.itemParams,\r\n\t\t\telementAttributes:option.elementAttributes,\r\n\t\t\telement:false,\r\n\t\t\tvisible:true,\r\n\t\t\tlevel:level,\r\n\t\t\toptions:[],\r\n\t\t\toriginal:option,\r\n\t\t};\r\n\t\t\r\n\t\toption.options.forEach((child) => {\r\n\t\t\tthis._parseListItem(child, item.options, level);\r\n\t\t});\r\n\t\t\r\n\t\treturn item;\r\n\t}\r\n\t\r\n\t_sortOptions(options){\r\n\t\tvar sorter;\r\n\t\t\r\n\t\tif(this.params.sort){\r\n\t\t\tsorter = typeof this.params.sort === \"function\" ? this.params.sort : this._defaultSortFunction.bind(this);\r\n\t\t\t\r\n\t\t\tthis._sortGroup(sorter, options);\r\n\t\t}\r\n\t\t\r\n\t\treturn options;\r\n\t}\r\n\t\r\n\t_sortGroup(sorter, options){\r\n\t\toptions.sort((a,b) => {\r\n\t\t\treturn sorter(a.label, b.label, a.value, b.value, a.original, b.original);\r\n\t\t});\r\n\t\t\r\n\t\toptions.forEach((option) => {\r\n\t\t\tif(option.group){\r\n\t\t\t\tthis._sortGroup(sorter, option.options);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_defaultSortFunction(as, bs){\r\n\t\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\t\tvar emptyAlign = 0;\r\n\t\t\r\n\t\tif(this.params.sort === \"desc\"){\r\n\t\t\t[as, bs] = [bs, as];\r\n\t\t}\r\n\t\t\r\n\t\t//handle empty values\r\n\t\tif(!as && as!== 0){\r\n\t\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t\t}else if(!bs && bs!== 0){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\t\ta = String(as).toLowerCase();\r\n\t\t\tb = String(bs).toLowerCase();\r\n\t\t\tif(a === b) return 0;\r\n\t\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\t\ta = a.match(rx);\r\n\t\t\tb = b.match(rx);\r\n\t\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\t\twhile(i < L){\r\n\t\t\t\ta1= a[i];\r\n\t\t\t\tb1= b[i++];\r\n\t\t\t\tif(a1 !== b1){\r\n\t\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn a.length > b.length;\r\n\t\t}\r\n\t\t\r\n\t\treturn emptyAlign;\r\n\t}\r\n\t\r\n\t_filterOptions(){\r\n\t\tvar filterFunc = this.params.filterFunc || this._defaultFilterFunc,\r\n\t\tterm = this.input.value;\r\n\t\t\r\n\t\tif(term){\r\n\t\t\tthis.filtered = true;\r\n\t\t\t\r\n\t\t\tthis.data.forEach((item) => {\r\n\t\t\t\tthis._filterItem(filterFunc, term, item);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.filtered = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.data;\r\n\t}\r\n\t\r\n\t_filterItem(func, term, item){\r\n\t\tvar matches = false;\r\n\t\t\r\n\t\tif(!item.group){\r\n\t\t\titem.visible = func(term, item.label, item.value, item.original);\r\n\t\t}else{\r\n\t\t\titem.options.forEach((option) => {\r\n\t\t\t\tif(this._filterItem(func, term, option)){\r\n\t\t\t\t\tmatches = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\titem.visible = matches;\r\n\t\t}\r\n\t\t\r\n\t\treturn item.visible;\r\n\t}\r\n\t\r\n\t_defaultFilterFunc(term, label, value, item){\r\n\t\tterm = String(term).toLowerCase();\r\n\t\t\r\n\t\tif(label !== null && typeof label !== \"undefined\"){\r\n\t\t\tif(String(label).toLowerCase().indexOf(term) > -1 || String(value).toLowerCase().indexOf(term) > -1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t/////////// Display List /////////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_clearList(){\r\n\t\twhile(this.listEl.firstChild) this.listEl.removeChild(this.listEl.firstChild);\r\n\t\t\r\n\t\tthis.displayItems = [];\r\n\t}\r\n\t\r\n\t_buildList(data){\r\n\t\tthis._clearList();\r\n\t\t\r\n\t\tdata.forEach((option) => {\r\n\t\t\tthis._buildItem(option);\r\n\t\t});\r\n\t\t\r\n\t\tif(!this.displayItems.length){\r\n\t\t\tthis._addPlaceholder(this.params.placeholderEmpty);\r\n\t\t} \r\n\t}\r\n\t\r\n\t_buildItem(item){\r\n\t\tvar el = item.element,\r\n\t\tcontents;\r\n\t\t\r\n\t\tif(!this.filtered || item.visible){\r\n\t\t\t\r\n\t\t\tif(!el){\r\n\t\t\t\tel = document.createElement(\"div\");\r\n\t\t\t\tel.tabIndex = 0;\r\n\t\t\t\t\r\n\t\t\t\tcontents = this.params.itemFormatter ? this.params.itemFormatter(item.label, item.value, item.original, el) : item.label;\r\n\t\t\t\t\r\n\t\t\t\tif(contents instanceof HTMLElement){\r\n\t\t\t\t\tel.appendChild(contents);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.innerHTML = contents;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-group\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.classList.add(\"tabulator-edit-list-item\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.classList.add(\"tabulator-edit-list-group-level-\" + item.level);\r\n\t\t\t\t\r\n\t\t\t\tif(item.elementAttributes && typeof item.elementAttributes == \"object\"){\r\n\t\t\t\t\tfor (let key in item.elementAttributes){\r\n\t\t\t\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\t\t\t\tkey = key.slice(1);\r\n\t\t\t\t\t\t\tel.setAttribute(key, this.input.getAttribute(key) + item.elementAttributes[\"+\" + key]);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tel.setAttribute(key, item.elementAttributes[key]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.group){\r\n\t\t\t\t\tel.addEventListener(\"click\", this._groupClick.bind(this, item));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tel.addEventListener(\"click\", this._itemClick.bind(this, item));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tel.addEventListener(\"mousedown\", this._preventBlur.bind(this));\r\n\t\t\t\t\r\n\t\t\t\titem.element = el;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tthis.listEl.appendChild(el);\r\n\t\t\t\r\n\t\t\tif(item.group){\r\n\t\t\t\titem.options.forEach((option) => {\r\n\t\t\t\t\tthis._buildItem(option);\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayItems.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_showList(){\r\n\t\tvar startVis = this.popup && this.popup.isVisible();\r\n\t\t\r\n\t\tif(this.input.parentNode){\r\n\t\t\tif(this.params.autocomplete && this.input.value === \"\" && !this.params.listOnEmpty){\r\n\t\t\t\tif(this.popup){\r\n\t\t\t\t\tthis.popup.hide(true);\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setListWidth();\r\n\t\t\t\r\n\t\t\tif(!this.popup){\r\n\t\t\t\tthis.popup = this.edit.popup(this.listEl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.popup.show(this.cell.getElement(), \"bottom\");\r\n\t\t\t\r\n\t\t\tif(!startVis){\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.popup.hideOnBlur(this._resolveValue.bind(this, true));\r\n\t\t\t\t}, 10);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_styleItem(item){\r\n\t\tif(item && item.element){\r\n\t\t\tif(item.selected){\r\n\t\t\t\titem.element.classList.add(\"active\");\r\n\t\t\t}else{\r\n\t\t\t\titem.element.classList.remove(\"active\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// User Interaction ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_itemClick(item, e){\r\n\t\te.stopPropagation();\r\n\t\t\r\n\t\tthis._chooseItem(item);\r\n\t}\r\n\t\r\n\t_groupClick(item, e){\r\n\t\te.stopPropagation();\r\n\t}\r\n\t\r\n\t\r\n\t//////////////////////////////////////\r\n\t////// Current Item Management ///////\r\n\t//////////////////////////////////////\r\n\t\r\n\t_cancel(){\r\n\t\tthis.popup.hide(true);\r\n\t\tthis.actions.cancel();\r\n\t}\r\n\t\r\n\t_clearChoices(){\r\n\t\tthis.typing = true;\r\n\t\t\r\n\t\tthis.currentItems.forEach((item) => {\r\n\t\t\titem.selected = false;\r\n\t\t\tthis._styleItem(item);\r\n\t\t});\r\n\t\t\r\n\t\tthis.currentItems = [];\r\n\t\t\r\n\t\tthis.focusedItem = null;\r\n\t}\r\n\t\r\n\t_chooseItem(item, silent){\r\n\t\tvar index;\r\n\t\t\r\n\t\tthis.typing = false;\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\tindex = this.currentItems.indexOf(item);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.currentItems.splice(index, 1);\r\n\t\t\t\titem.selected = false;\r\n\t\t\t}else{\r\n\t\t\t\tthis.currentItems.push(item);\r\n\t\t\t\titem.selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.input.value = this.currentItems.map(item => item.label).join(\",\");\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.currentItems = [item];\r\n\t\t\titem.selected = true;\r\n\t\t\t\r\n\t\t\tthis.input.value = item.label;\r\n\t\t\t\r\n\t\t\tthis._styleItem(item);\r\n\t\t\t\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis._resolveValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._focusItem(item);\r\n\t}\r\n\t\r\n\t_resolveValue(blur){\r\n\t\tvar output, initialValue;\r\n\r\n\t\tif(this.popup){\r\n\t\t\tthis.popup.hide(true);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.params.multiselect){\r\n\t\t\toutput = this.currentItems.map(item => item.value);\r\n\t\t}else{\r\n\t\t\tif(blur && this.params.autocomplete && this.typing){\r\n\t\t\t\tif(this.params.freetext || (this.params.allowEmpty && this.input.value === \"\")){\r\n\t\t\t\t\toutput = this.input.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.actions.cancel();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.currentItems[0]){\r\n\t\t\t\t\toutput = this.currentItems[0].value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tinitialValue = this.initialValues[0];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(initialValue === null || typeof initialValue === \"undefined\" || initialValue === \"\"){\r\n\t\t\t\t\t\toutput = initialValue;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\toutput = this.params.emptyValue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(output === \"\"){\r\n\t\t\toutput = this.params.emptyValue;\r\n\t\t}\r\n\t\t\r\n\t\tthis.actions.success(output);\r\n\t\t\r\n\t\tif(this.isFilter){\r\n\t\t\tthis.initialValues = output && !Array.isArray(output) ? [output] : output;\r\n\t\t\tthis.currentItems = [];\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n","import input from './editors/input.js';\r\nimport textarea from './editors/textarea.js';\r\nimport number from './editors/number.js';\r\nimport range from './editors/range.js';\r\nimport date from './editors/date.js';\r\nimport time from './editors/time.js';\r\nimport datetime from './editors/datetime.js';\r\nimport select from './editors/select.js';\r\nimport list from './editors/list.js';\r\nimport autocomplete from './editors/autocomplete.js';\r\nimport star from './editors/star.js';\r\nimport progress from './editors/progress.js';\r\nimport tickCross from './editors/tickCross.js';\r\n\r\nexport default {\r\n\tinput:input,\r\n\ttextarea:textarea,\r\n\tnumber:number,\r\n\trange:range,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tselect:select,\r\n\tlist:list,\r\n\tautocomplete:autocomplete,\r\n\tstar:star,\r\n\tprogress:progress,\r\n\ttickCross:tickCross,\r\n};","import maskInput from '../../inputMask.js';\r\n\r\n//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", editorParams.search ? \"search\" : \"text\");\r\n\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//resizable text area element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"hybrid\",\r\n\tvalue = String(cellValue !== null && typeof cellValue !== \"undefined\" ? cellValue : \"\"),\r\n\tinput = document.createElement(\"textarea\"),\r\n\tscrollHeight = 0;\r\n\r\n\t//create and style input\r\n\tinput.style.display = \"block\";\r\n\tinput.style.padding = \"2px\";\r\n\tinput.style.height = \"100%\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\tinput.style.whiteSpace = \"pre-wrap\";\r\n\tinput.style.resize = \"none\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\tinput.scrollHeight;\r\n\t\tinput.style.height = input.scrollHeight + \"px\";\r\n\t\tcell.getRow().normalizeHeight();\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(e){\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && input.value !== \"\") || input.value !== cellValue){\r\n\r\n\t\t\tif(success(input.value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tcell.getRow().normalizeHeight();\r\n\t\t\t},300);\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\r\n\tinput.addEventListener(\"keyup\", function(){\r\n\r\n\t\tinput.style.height = \"\";\r\n\r\n\t\tvar heightNow = input.scrollHeight;\r\n\r\n\t\tinput.style.height = heightNow + \"px\";\r\n\r\n\t\tif(heightNow != scrollHeight){\r\n\t\t\tscrollHeight = heightNow;\r\n\t\t\tcell.getRow().normalizeHeight();\r\n\t\t}\r\n\t});\r\n\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\r\n\t\tswitch(e.keyCode){\r\n\r\n\t\t\tcase 13:\r\n\t\t\t\tif(e.shiftKey && editorParams.shiftEnterSubmit){\r\n\t\t\t\t\tonChange(e);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\" || (vertNav == \"hybrid\" && input.selectionStart !== input.value.length)){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","import maskInput from '../../inputMask.js';\r\n\r\n//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tvertNav = editorParams.verticalNavigation || \"editor\",\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"number\");\r\n\r\n\tif(typeof editorParams.max != \"undefined\"){\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif(typeof editorParams.min != \"undefined\"){\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif(typeof editorParams.step != \"undefined\"){\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tvar blurFunc = function(e){\r\n\t\tonChange();\r\n\t};\r\n\r\n\tonRendered(function () {\r\n\t\t//submit new value on blur\r\n\t\tinput.removeEventListener(\"blur\", blurFunc);\r\n\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\r\n\t\t//submit new value on blur\r\n\t\tinput.addEventListener(\"blur\", blurFunc);\r\n\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value !== cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 38: //up arrow\r\n\t\t\tcase 40: //down arrow\r\n\t\t\t\tif(vertNav == \"editor\"){\r\n\t\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\tif(editorParams.mask){\r\n\t\tmaskInput(input, editorParams);\r\n\t}\r\n\r\n\treturn input;\r\n}","//input element with type of number\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\r\n\tinput.setAttribute(\"type\", \"range\");\r\n\r\n\tif (typeof editorParams.max != \"undefined\") {\r\n\t\tinput.setAttribute(\"max\", editorParams.max);\r\n\t}\r\n\r\n\tif (typeof editorParams.min != \"undefined\") {\r\n\t\tinput.setAttribute(\"min\", editorParams.min);\r\n\t}\r\n\r\n\tif (typeof editorParams.step != \"undefined\") {\r\n\t\tinput.setAttribute(\"step\", editorParams.step);\r\n\t}\r\n\r\n\t//create and style input\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\r\n\tonRendered(function () {\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t});\r\n\r\n\tfunction onChange(){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(!isNaN(value) && value !==\"\"){\r\n\t\t\tvalue = Number(value);\r\n\t\t}\r\n\r\n\t\tif(value != cellValue){\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tonChange();\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 13:\r\n\t\t\t// case 9:\r\n\t\t\t\tonChange();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null;\r\n\t\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tfunction convertDate(value){\r\n\t\tvar newDatetime;\r\n\t\t\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\t\t\r\n\t\treturn newDatetime.toFormat(\"yyyy-MM-dd\");\r\n\t}\r\n\t\r\n\tinput.type = \"date\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.max){\r\n\t\tinput.setAttribute(\"max\", inputFormat ? convertDate(editorParams.max) : editorParams.max);\r\n\t}\r\n\r\n\tif(editorParams.min){\r\n\t\tinput.setAttribute(\"min\", inputFormat ? convertDate(editorParams.min) : editorParams.min);\r\n\t}\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\t\t\r\n\t\t\tcellValue = convertDate(cellValue);\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\t\t\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\t\t\t\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"yyyy-MM-dd\").toFormat(inputFormat);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"time\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"hh:mm\");\r\n\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromFormat(String(value), \"hh:mm\").toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","//input element\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar inputFormat = editorParams.format,\r\n\tDT = inputFormat ? (window.DateTime || luxon.DateTime) : null, \r\n\tnewDatetime;\r\n\r\n\t//create and style input\r\n\tvar cellValue = cell.getValue(),\r\n\tinput = document.createElement(\"input\");\r\n\t\r\n\tinput.type = \"datetime-local\";\r\n\tinput.style.padding = \"4px\";\r\n\tinput.style.width = \"100%\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\t\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcellValue = typeof cellValue !== \"undefined\" ? cellValue : \"\";\r\n\t\r\n\tif(inputFormat){\r\n\t\tif(DT){\r\n\t\t\tif(DT.isDateTime(cellValue)){\r\n\t\t\t\tnewDatetime = cellValue;\r\n\t\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\t\tnewDatetime = DT.fromISO(String(cellValue));\r\n\t\t\t}else{\r\n\t\t\t\tnewDatetime = DT.fromFormat(String(cellValue), inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tcellValue = newDatetime.toFormat(\"yyyy-MM-dd\") + \"T\" + newDatetime.toFormat(\"hh:mm\");\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Editor Error - 'date' editor 'inputFormat' param is dependant on luxon.js\");\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = cellValue;\r\n\t\r\n\tonRendered(function(){\r\n\t\tinput.focus({preventScroll: true});\r\n\t\tinput.style.height = \"100%\";\r\n\t\t\r\n\t\tif(editorParams.selectContents){\r\n\t\t\tinput.select();\r\n\t\t}\r\n\t});\r\n\t\r\n\tfunction onChange(e){\r\n\t\tvar value = input.value;\r\n\r\n\t\tif(((cellValue === null || typeof cellValue === \"undefined\") && value !== \"\") || value !== cellValue){\r\n\r\n\t\t\tif(value && inputFormat){\r\n\t\t\t\tvalue = DT.fromISO(String(value)).toFormat(inputFormat);\r\n\t\t\t}\r\n\r\n\t\t\tif(success(value)){\r\n\t\t\t\tcellValue = input.value; //persist value if successfully validated incase editor is used as header filter\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcancel();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//submit new value on blur or change\r\n\tinput.addEventListener(\"change\", onChange);\r\n\tinput.addEventListener(\"blur\", onChange);\r\n\t\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\t// case 9:\r\n\t\t\tcase 13:\r\n\t\t\t\tonChange(e);\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 27:\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 35:\r\n\t\t\tcase 36:\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The select editor has been deprecated, please use the new list editor\");\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","import List from '../../List.js';\r\n\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\r\n\tthis.deprecationMsg(\"The autocomplete editor has been deprecated, please use the new list editor with the 'autocomplete' editorParam\");\r\n\r\n\teditorParams.autocomplete = true;\r\n\r\n\tvar list = new List(this, cell, onRendered, success, cancel, editorParams);\r\n\r\n\treturn list.input;\r\n}","//star rating\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar self = this,\r\n\telement = cell.getElement(),\r\n\tvalue = cell.getValue(),\r\n\tmaxStars = element.getElementsByTagName(\"svg\").length || 5,\r\n\tsize = element.getElementsByTagName(\"svg\")[0] ? element.getElementsByTagName(\"svg\")[0].getAttribute(\"width\") : 14,\r\n\tstars = [],\r\n\tstarsHolder = document.createElement(\"div\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\");\r\n\r\n\r\n\t//change star type\r\n\tfunction starChange(val){\r\n\t\tstars.forEach(function(star, i){\r\n\t\t\tif(i < val){\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-active\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-inactive\", \"tabulator-star-active\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}else{\r\n\t\t\t\tif(self.table.browser == \"ie\"){\r\n\t\t\t\t\tstar.setAttribute(\"class\", \"tabulator-star-inactive\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstar.classList.replace(\"tabulator-star-active\", \"tabulator-star-inactive\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstar.innerHTML = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//build stars\r\n\tfunction buildStar(i){\r\n\r\n\t\tvar starHolder = document.createElement(\"span\");\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\r\n\t\tstars.push(nextStar);\r\n\r\n\t\tstarHolder.addEventListener(\"mouseenter\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tstarChange(i);\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"mousemove\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t});\r\n\r\n\t\tstarHolder.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\t\t\tsuccess(i);\r\n\t\t\telement.blur();\r\n\t\t});\r\n\r\n\t\tstarHolder.appendChild(nextStar);\r\n\t\tstarsHolder.appendChild(starHolder);\r\n\r\n\t}\r\n\r\n\t//handle keyboard navigation value change\r\n\tfunction changeValue(val){\r\n\t\tvalue = val;\r\n\t\tstarChange(val);\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\t//style holding element\r\n\tstarsHolder.style.verticalAlign = \"middle\";\r\n\tstarsHolder.style.display = \"inline-block\";\r\n\tstarsHolder.style.padding = \"4px\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", size);\r\n\tstar.setAttribute(\"height\", size);\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tstarsHolder.setAttribute(key, starsHolder.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tstarsHolder.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//create correct number of stars\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tbuildStar(i);\r\n\t}\r\n\r\n\t//ensure value does not exceed number of stars\r\n\tvalue = Math.min(parseInt(value), maxStars);\r\n\r\n\t// set initial styling of stars\r\n\tstarChange(value);\r\n\r\n\tstarsHolder.addEventListener(\"mousemove\", function(e){\r\n\t\tstarChange(0);\r\n\t});\r\n\r\n\tstarsHolder.addEventListener(\"click\", function(e){\r\n\t\tsuccess(0);\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(e){\r\n\t\tcancel();\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\tchangeValue(value + 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\tchangeValue(value - 1);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tsuccess(value);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t});\r\n\r\n\treturn starsHolder;\r\n}","//draggable progress bar\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar element = cell.getElement(),\r\n\tmax = typeof editorParams.max === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"max\")) || 100) : editorParams.max,\r\n\tmin = typeof editorParams.min === \"undefined\" ? ((element.getElementsByTagName(\"div\")[0] && element.getElementsByTagName(\"div\")[0].getAttribute(\"min\")) || 0) : editorParams.min,\r\n\tpercent = (max - min) / 100,\r\n\tvalue = cell.getValue() || 0,\r\n\thandle = document.createElement(\"div\"),\r\n\tbar = document.createElement(\"div\"),\r\n\tmouseDrag, mouseDragWidth;\r\n\r\n\t//set new value\r\n\tfunction updateValue(){\r\n\t\tvar style = window.getComputedStyle(element, null);\r\n\r\n\t\tvar calcVal = (percent * Math.round(bar.offsetWidth / ((element.clientWidth - parseInt(style.getPropertyValue(\"padding-left\")) - parseInt(style.getPropertyValue(\"padding-right\")))/100))) + min;\r\n\t\tsuccess(calcVal);\r\n\t\telement.setAttribute(\"aria-valuenow\", calcVal);\r\n\t\telement.setAttribute(\"aria-label\", value);\r\n\t}\r\n\r\n\t//style handle\r\n\thandle.style.position = \"absolute\";\r\n\thandle.style.right = \"0\";\r\n\thandle.style.top = \"0\";\r\n\thandle.style.bottom = \"0\";\r\n\thandle.style.width = \"5px\";\r\n\thandle.classList.add(\"tabulator-progress-handle\");\r\n\r\n\t//style bar\r\n\tbar.style.display = \"inline-block\";\r\n\tbar.style.position = \"relative\";\r\n\t// bar.style.top = \"8px\";\r\n\t// bar.style.bottom = \"8px\";\r\n\t// bar.style.left = \"4px\";\r\n\t// bar.style.marginRight = \"4px\";\r\n\tbar.style.height = \"100%\";\r\n\tbar.style.backgroundColor = \"#488CE9\";\r\n\tbar.style.maxWidth = \"100%\";\r\n\tbar.style.minWidth = \"0%\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tbar.setAttribute(key, bar.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tbar.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//style cell\r\n\telement.style.padding = \"4px 4px\";\r\n\r\n\t//make sure value is in range\r\n\tvalue = Math.min(parseFloat(value), max);\r\n\tvalue = Math.max(parseFloat(value), min);\r\n\r\n\t//workout percentage\r\n\tvalue = Math.round((value - min) / percent);\r\n\t// bar.style.right = value + \"%\";\r\n\tbar.style.width = value + \"%\";\r\n\r\n\telement.setAttribute(\"aria-valuemin\", min);\r\n\telement.setAttribute(\"aria-valuemax\", max);\r\n\r\n\tbar.appendChild(handle);\r\n\r\n\thandle.addEventListener(\"mousedown\", function(e){\r\n\t\tmouseDrag = e.screenX;\r\n\t\tmouseDragWidth = bar.offsetWidth;\r\n\t});\r\n\r\n\thandle.addEventListener(\"mouseover\", function(){\r\n\t\thandle.style.cursor = \"ew-resize\";\r\n\t});\r\n\r\n\telement.addEventListener(\"mousemove\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\tbar.style.width = (mouseDragWidth + e.screenX - mouseDrag) + \"px\";\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"mouseup\", function(e){\r\n\t\tif(mouseDrag){\r\n\t\t\te.stopPropagation();\r\n\t\t\te.stopImmediatePropagation();\r\n\r\n\t\t\tmouseDrag = false;\r\n\t\t\tmouseDragWidth = false;\r\n\r\n\t\t\tupdateValue();\r\n\t\t}\r\n\t});\r\n\r\n\t//allow key based navigation\r\n\telement.addEventListener(\"keydown\", function(e){\r\n\t\tswitch(e.keyCode){\r\n\t\t\tcase 39: //right arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth + element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 37: //left arrow\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tbar.style.width = (bar.clientWidth - element.clientWidth/100) + \"px\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 9: //tab\r\n\t\t\tcase 13: //enter\r\n\t\t\t\tupdateValue();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27: //escape\r\n\t\t\t\tcancel();\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\t});\r\n\r\n\telement.addEventListener(\"blur\", function(){\r\n\t\tcancel();\r\n\t});\r\n\r\n\treturn bar;\r\n}","//checkbox\r\nexport default function(cell, onRendered, success, cancel, editorParams){\r\n\tvar value = cell.getValue(),\r\n\tinput = document.createElement(\"input\"),\r\n\ttristate = editorParams.tristate,\r\n\tindetermValue = typeof editorParams.indeterminateValue === \"undefined\" ? null : editorParams.indeterminateValue,\r\n\tindetermState = false,\r\n\ttrueValueSet = Object.keys(editorParams).includes(\"trueValue\"),\r\n\tfalseValueSet = Object.keys(editorParams).includes(\"falseValue\");\r\n\r\n\tinput.setAttribute(\"type\", \"checkbox\");\r\n\tinput.style.marginTop = \"5px\";\r\n\tinput.style.boxSizing = \"border-box\";\r\n\r\n\tif(editorParams.elementAttributes && typeof editorParams.elementAttributes == \"object\"){\r\n\t\tfor (let key in editorParams.elementAttributes){\r\n\t\t\tif(key.charAt(0) == \"+\"){\r\n\t\t\t\tkey = key.slice(1);\r\n\t\t\t\tinput.setAttribute(key, input.getAttribute(key) + editorParams.elementAttributes[\"+\" + key]);\r\n\t\t\t}else{\r\n\t\t\t\tinput.setAttribute(key, editorParams.elementAttributes[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinput.value = value;\r\n\r\n\tif(tristate && (typeof value === \"undefined\" || value === indetermValue || value === \"\")){\r\n\t\tindetermState = true;\r\n\t\tinput.indeterminate = true;\r\n\t}\r\n\r\n\tif(this.table.browser != \"firefox\"){ //prevent blur issue on mac firefox\r\n\t\tonRendered(function(){\r\n\t\t\tinput.focus({preventScroll: true});\r\n\t\t});\r\n\t}\r\n\r\n\tinput.checked = trueValueSet ? value === editorParams.trueValue : (value === true || value === \"true\" || value === \"True\" || value === 1);\r\n\r\n\tonRendered(function(){\r\n\t\tinput.focus();\r\n\t});\r\n\r\n\tfunction setValue(blur){\r\n\t\tvar checkedValue = input.checked;\r\n\r\n\t\tif(trueValueSet && checkedValue){\r\n\t\t\tcheckedValue = editorParams.trueValue;\r\n\t\t}else if(falseValueSet && !checkedValue){\r\n\t\t\tcheckedValue = editorParams.falseValue;\r\n\t\t}\r\n\r\n\t\tif(tristate){\r\n\t\t\tif(!blur){\r\n\t\t\t\tif(input.checked && !indetermState){\r\n\t\t\t\t\tinput.checked = false;\r\n\t\t\t\t\tinput.indeterminate = true;\r\n\t\t\t\t\tindetermState = true;\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindetermState = false;\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(indetermState){\r\n\t\t\t\t\treturn indetermValue;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn checkedValue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn checkedValue;\r\n\t\t}\r\n\t}\r\n\r\n\t//submit new value on blur\r\n\tinput.addEventListener(\"change\", function(e){\r\n\t\tsuccess(setValue());\r\n\t});\r\n\r\n\tinput.addEventListener(\"blur\", function(e){\r\n\t\tsuccess(setValue(true));\r\n\t});\r\n\r\n\t//submit new value on enter\r\n\tinput.addEventListener(\"keydown\", function(e){\r\n\t\tif(e.keyCode == 13){\r\n\t\t\tsuccess(setValue());\r\n\t\t}\r\n\t\tif(e.keyCode == 27){\r\n\t\t\tcancel();\r\n\t\t}\r\n\t});\r\n\r\n\treturn input;\r\n}","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultEditors from './defaults/editors.js';\r\n\r\nclass Edit extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.currentCell = false; //hold currently editing cell\r\n\t\tthis.mouseClick = false; //hold mousedown state to prevent click binding being overridden by editor opening\r\n\t\tthis.recursionBlock = false; //prevent focus recursion\r\n\t\tthis.invalidEdit = false;\r\n\t\tthis.editedCells = [];\r\n\t\t\r\n\t\tthis.editors = Edit.editors;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"editable\");\r\n\t\tthis.registerColumnOption(\"editor\");\r\n\t\tthis.registerColumnOption(\"editorParams\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"cellEditing\");\r\n\t\tthis.registerColumnOption(\"cellEdited\");\r\n\t\tthis.registerColumnOption(\"cellEditCancelled\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getEditedCells\", this.getEditedCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellEdited\", this.clearCellEdited.bind(this));\r\n\t\tthis.registerTableFunction(\"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerTableFunction(\"navigateDown\", this.navigateDown.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isEdited\", this.cellIsEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearEdited\", this.clearEdited.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"edit\", this.editCell.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"cancelEdit\", this.cellCancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigatePrev\", this.navigatePrev.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateNext\", this.navigateNext.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateLeft\", this.navigateLeft.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateRight\", this.navigateRight.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateUp\", this.navigateUp.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"navigateDown\", this.navigateDown.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-init\", this.bindEditor.bind(this));\r\n\t\tthis.subscribe(\"cell-delete\", this.clearEdited.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.updateCellClass.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.columnDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"row-deleting\", this.rowDeleteCheck.bind(this));\r\n\t\tthis.subscribe(\"data-refreshing\", this.cancelEdit.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"keybinding-nav-prev\", this.navigatePrev.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-next\", this.keybindingNavigateNext.bind(this));\r\n\t\tthis.subscribe(\"keybinding-nav-left\", this.navigateLeft.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-right\", this.navigateRight.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-up\", this.navigateUp.bind(this, undefined));\r\n\t\tthis.subscribe(\"keybinding-nav-down\", this.navigateDown.bind(this, undefined));\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t////// Keybinding Functions ///////\r\n\t///////////////////////////////////\r\n\t\r\n\tkeybindingNavigateNext(e){\r\n\t\tvar cell = this.currentCell,\r\n\t\tnewRow = this.options(\"tabEndNewRow\");\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tif(!this.navigateNext(cell, e)){\r\n\t\t\t\tif(newRow){\r\n\t\t\t\t\tcell.getElement().firstChild.blur();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRow === true){\r\n\t\t\t\t\t\tnewRow = this.table.addRow({});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(typeof newRow == \"function\"){\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(newRow(cell.row.getComponent()));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRow = this.table.addRow(Object.assign({}, newRow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewRow.then(() => {\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tcell.getComponent().navigateNext();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Cell Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsEdited(cell){\r\n\t\treturn !! cell.modules.edit && cell.modules.edit.edited;\r\n\t}\r\n\t\r\n\tcellCancelEdit(cell){\r\n\t\tif(cell === this.currentCell){\r\n\t\t\tthis.table.modules.edit.cancelEdit();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cancel Editor Error - This cell is not currently being edited \");\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\tupdateCellClass(cell){\r\n\t\tif(this.allowEdit(cell)) {\r\n\t\t\tcell.getElement().classList.add(\"tabulator-editable\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-editable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearCellEdited(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.table.modules.edit.getEditedCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.table.modules.edit.clearEdited(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tnavigatePrev(cell = this.currentCell, e){\r\n\t\tvar nextCell, prevRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateLeft();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tprevRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(prevRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(prevRow, prevRow.cells.length);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateNext(cell = this.currentCell, e){\r\n\t\tvar nextCell, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnextCell = this.navigateRight();\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\t\r\n\t\t\t\tif(nextRow){\r\n\t\t\t\t\tnextCell = this.findNextEditableCell(nextRow, -1);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(nextCell){\r\n\t\t\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateLeft(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findPrevEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateRight(cell = this.currentCell, e){\r\n\t\tvar index, nextCell;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextCell = this.findNextEditableCell(cell.row, index);\r\n\t\t\t\r\n\t\t\tif(nextCell){\r\n\t\t\t\tnextCell.getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateUp(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.prevDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tnavigateDown(cell = this.currentCell, e){\r\n\t\tvar index, nextRow;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\t\r\n\t\t\tif(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex = cell.getIndex();\r\n\t\t\tnextRow = this.table.rowManager.nextDisplayRow(cell.row, true);\r\n\t\t\t\r\n\t\t\tif(nextRow){\r\n\t\t\t\tnextRow.cells[index].getComponent().edit();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfindNextEditableCell(row, index){\r\n\t\tvar nextCell = false;\r\n\t\t\r\n\t\tif(index < row.cells.length-1){\r\n\t\t\tfor(var i = index+1; i < row.cells.length; i++){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tnextCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn nextCell;\r\n\t}\r\n\t\r\n\tfindPrevEditableCell(row, index){\r\n\t\tvar prevCell = false;\r\n\t\t\r\n\t\tif(index > 0){\r\n\t\t\tfor(var i = index-1; i >= 0; i--){\r\n\t\t\t\tlet cell = row.cells[i];\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.modules.edit && Helpers.elVisible(cell.getElement())){\r\n\t\t\t\t\tlet allowEdit = this.allowEdit(cell);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(allowEdit){\r\n\t\t\t\t\t\tprevCell = cell;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn prevCell;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.editor !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnDeleteCheck(column){\r\n\t\tif(this.currentCell && this.currentCell.column === column){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\trowDeleteCheck(row){\r\n\t\tif(this.currentCell && this.currentCell.row === row){\r\n\t\t\tthis.cancelEdit();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize column editor\r\n\tinitializeColumn(column){\r\n\t\tvar config = {\r\n\t\t\teditor:false,\r\n\t\t\tblocked:false,\r\n\t\t\tcheck:column.definition.editable,\r\n\t\t\tparams:column.definition.editorParams || {}\r\n\t\t};\r\n\t\t\r\n\t\t//set column editor\r\n\t\tswitch(typeof column.definition.editor){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(this.editors[column.definition.editor]){\r\n\t\t\t\t\tconfig.editor = this.editors[column.definition.editor];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Editor Error - No such editor found: \", column.definition.editor);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.editor = column.definition.editor;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(column.definition.editor === true){\r\n\t\t\t\t\tif(typeof column.definition.formatter !== \"function\"){\r\n\t\t\t\t\t\tif(this.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[column.definition.formatter];\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tconfig.editor = this.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Editor Error - Cannot auto lookup editor for a custom formatter: \", column.definition.formatter);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\tif(config.editor){\r\n\t\t\tcolumn.modules.edit = config;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetCurrentCell(){\r\n\t\treturn this.currentCell ? this.currentCell.getComponent() : false;\r\n\t}\r\n\t\r\n\tclearEditor(cancel){\r\n\t\tvar cell = this.currentCell,\r\n\t\tcellEl;\r\n\t\t\r\n\t\tthis.invalidEdit = false;\r\n\t\t\r\n\t\tif(cell){\r\n\t\t\tthis.currentCell = false;\r\n\t\t\t\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-editor-clear\", cell, cancel);\r\n\t\t\t\r\n\t\t\tcellEl.classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\twhile(cellEl.firstChild) cellEl.removeChild(cellEl.firstChild);\r\n\t\t\t\r\n\t\t\tcell.row.getElement().classList.remove(\"tabulator-editing\");\r\n\t\t\t\r\n\t\t\tcell.table.element.classList.remove(\"tabulator-editing\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tcancelEdit(){\r\n\t\tif(this.currentCell){\r\n\t\t\tvar cell = this.currentCell;\r\n\t\t\tvar component = this.currentCell.getComponent();\r\n\t\t\t\r\n\t\t\tthis.clearEditor(true);\r\n\t\t\tcell.setValueActual(cell.getValue());\r\n\t\t\tcell.cellRendered();\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.editor == \"textarea\" || cell.column.definition.variableHeight){\r\n\t\t\t\tcell.row.normalizeHeight(true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cell.column.definition.cellEditCancelled){\r\n\t\t\t\tcell.column.definition.cellEditCancelled.call(this.table, component);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-cancelled\", cell);\r\n\t\t\tthis.dispatchExternal(\"cellEditCancelled\", component);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return a formatted value for a cell\r\n\tbindEditor(cell){\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tvar self = this,\r\n\t\t\telement = cell.getElement(true);\r\n\t\t\t\r\n\t\t\tthis.updateCellClass(cell);\r\n\t\t\telement.setAttribute(\"tabindex\", 0);\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(!element.classList.contains(\"tabulator-editing\")){\r\n\t\t\t\t\telement.focus({preventScroll: true});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif (e.button === 2) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.mouseClick = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\telement.addEventListener(\"focus\", function(e){\r\n\t\t\t\tif(!self.recursionBlock){\r\n\t\t\t\t\tself.edit(cell, e, false);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tfocusCellNoEvent(cell, block){\r\n\t\tthis.recursionBlock = true;\r\n\t\t\r\n\t\tif(!(block && this.table.browser === \"ie\")){\r\n\t\t\tcell.getElement().focus({preventScroll: true});\r\n\t\t}\r\n\t\t\r\n\t\tthis.recursionBlock = false;\r\n\t}\r\n\t\r\n\teditCell(cell, forceEdit){\r\n\t\tthis.focusCellNoEvent(cell);\r\n\t\tthis.edit(cell, false, forceEdit);\r\n\t}\r\n\t\r\n\tfocusScrollAdjust(cell){\r\n\t\tif(this.table.rowManager.getRenderMode() == \"virtual\"){\r\n\t\t\tvar topEdge = this.table.rowManager.element.scrollTop,\r\n\t\t\tbottomEdge = this.table.rowManager.element.clientHeight + this.table.rowManager.element.scrollTop,\r\n\t\t\trowEl = cell.row.getElement();\r\n\t\t\t\r\n\t\t\tif(rowEl.offsetTop < topEdge){\r\n\t\t\t\tthis.table.rowManager.element.scrollTop -= (topEdge - rowEl.offsetTop);\r\n\t\t\t}else{\r\n\t\t\t\tif(rowEl.offsetTop + rowEl.offsetHeight > bottomEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollTop += (rowEl.offsetTop + rowEl.offsetHeight - bottomEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar leftEdge = this.table.rowManager.element.scrollLeft,\r\n\t\t\trightEdge = this.table.rowManager.element.clientWidth + this.table.rowManager.element.scrollLeft,\r\n\t\t\tcellEl = cell.getElement();\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"frozenColumns\")){\r\n\t\t\t\tleftEdge += parseInt(this.table.modules.frozenColumns.leftMargin);\r\n\t\t\t\trightEdge -= parseInt(this.table.modules.frozenColumns.rightMargin);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleftEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t\trightEdge -= parseInt(this.table.columnManager.renderer.vDomPadLeft);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cellEl.offsetLeft < leftEdge){\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.element.scrollLeft -= (leftEdge - cellEl.offsetLeft);\r\n\t\t\t}else{\r\n\t\t\t\tif(cellEl.offsetLeft + cellEl.offsetWidth > rightEdge){\r\n\t\t\t\t\tthis.table.rowManager.element.scrollLeft += (cellEl.offsetLeft + cellEl.offsetWidth - rightEdge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tallowEdit(cell) {\r\n\t\tvar check = cell.column.modules.edit ? true : false;\r\n\r\n\t\tif(cell.column.modules.edit){\r\n\t\t\tswitch(typeof cell.column.modules.edit.check){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check(cell.getComponent());\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tcheck = !!cell.row.data[cell.column.modules.edit.check];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tcheck = cell.column.modules.edit.check;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn check;\r\n\t}\r\n\t\r\n\tedit(cell, e, forceEdit){\r\n\t\tvar self = this,\r\n\t\tallowEdit = true,\r\n\t\trendered = function(){},\r\n\t\telement = cell.getElement(),\r\n\t\tcellEditor, component, params;\r\n\t\t\r\n\t\t//prevent editing if another cell is refusing to leave focus (eg. validation fail)\r\n\t\tif(this.currentCell){\r\n\t\t\tif(!this.invalidEdit){\r\n\t\t\t\tthis.cancelEdit();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//handle successful value change\r\n\t\tfunction success(value){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tvar valid = self.chain(\"edit-success\", [cell, value], true, true);\r\n\t\t\t\t\r\n\t\t\t\tif(valid === true || self.table.options.validationMode === \"highlight\"){\r\n\t\t\t\t\tself.clearEditor();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!cell.modules.edit){\r\n\t\t\t\t\t\tcell.modules.edit = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.modules.edit.edited = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.editedCells.indexOf(cell) == -1){\r\n\t\t\t\t\t\tself.editedCells.push(cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell.setValue(value, true);\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn valid === true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tself.invalidEdit = true;\r\n\t\t\t\t\tself.focusCellNoEvent(cell, true);\r\n\t\t\t\t\trendered();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call success on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){\r\n\t\t\tif(self.currentCell === cell){\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t}else{\r\n\t\t\t\t// console.warn(\"Edit Success Error - cannot call cancel on a cell that is no longer being edited\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction onRendered(callback){\r\n\t\t\trendered = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.column.modules.edit.blocked){\r\n\t\t\tif(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tallowEdit = this.allowEdit(cell);\r\n\t\t\t\r\n\t\t\tif(allowEdit || forceEdit){\r\n\t\t\t\t\r\n\t\t\t\tself.cancelEdit();\r\n\t\t\t\t\r\n\t\t\t\tself.currentCell = cell;\r\n\t\t\t\t\r\n\t\t\t\tthis.focusScrollAdjust(cell);\r\n\t\t\t\t\r\n\t\t\t\tcomponent = cell.getComponent();\r\n\t\t\t\t\r\n\t\t\t\tif(this.mouseClick){\r\n\t\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cell.column.definition.cellClick){\r\n\t\t\t\t\t\tcell.column.definition.cellClick.call(this.table, e, component);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(cell.column.definition.cellEditing){\r\n\t\t\t\t\tcell.column.definition.cellEditing.call(this.table, component);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"cell-editing\", cell);\r\n\t\t\t\tthis.dispatchExternal(\"cellEditing\", component);\r\n\t\t\t\t\r\n\t\t\t\tparams = typeof cell.column.modules.edit.params === \"function\" ? cell.column.modules.edit.params(component) : cell.column.modules.edit.params;\r\n\t\t\t\t\r\n\t\t\t\tcellEditor = cell.column.modules.edit.editor.call(self, component, onRendered, success, cancel, params);\r\n\t\t\t\t\r\n\t\t\t\t//if editor returned, add to DOM, if false, abort edit\r\n\t\t\t\tif(cellEditor !== false){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(cellEditor instanceof Node){\r\n\t\t\t\t\t\telement.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.row.getElement().classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\tcell.table.element.classList.add(\"tabulator-editing\");\r\n\t\t\t\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\t\t\t\telement.appendChild(cellEditor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//trigger onRendered Callback\r\n\t\t\t\t\t\trendered();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//prevent editing from triggering rowClick event\r\n\t\t\t\t\t\tvar children = element.children;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (var i = 0; i < children.length; i++) {\r\n\t\t\t\t\t\t\tchildren[i].addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Edit Error - Editor should return an instance of Node, the editor returned:\", cellEditor);\r\n\t\t\t\t\t\telement.blur();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.blur();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.mouseClick = false;\r\n\t\t\t\telement.blur();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.mouseClick = false;\r\n\t\t\telement.blur();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetEditedCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.editedCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearEdited(cell){\r\n\t\tvar editIndex;\r\n\t\t\r\n\t\tif(cell.modules.edit && cell.modules.edit.edited){\r\n\t\t\tcell.modules.edit.edited = false;\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"edit-edited-clear\", cell);\r\n\t\t}\r\n\t\t\r\n\t\teditIndex = this.editedCells.indexOf(cell);\r\n\t\t\r\n\t\tif(editIndex > -1){\r\n\t\t\tthis.editedCells.splice(editIndex, 1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nEdit.moduleName = \"edit\";\r\n\r\n//load defaults\r\nEdit.editors = defaultEditors;\r\n\r\n\r\nexport default Edit;\r\n","class ExportRow{\r\n\tconstructor(type, columns, component, indent){\r\n\t\tthis.type = type;\r\n\t\tthis.columns = columns;\r\n\t\tthis.component = component || false;\r\n\t\tthis.indent = indent || 0;\r\n\t}\r\n}\r\n\r\nexport default ExportRow;","class ExportColumn{\r\n\tconstructor(value, component, width, height, depth){\r\n\t\tthis.value = value;\r\n\t\tthis.component = component || false;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.depth = depth;\r\n\t}\r\n}\r\n\r\nexport default ExportColumn;","import Module from '../../core/Module.js';\r\n\r\nimport ExportRow from './ExportRow.js';\r\nimport ExportColumn from './ExportColumn.js';\r\n\r\nclass Export extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.config = {};\r\n\t\tthis.cloneTableStyle = true;\r\n\t\tthis.colVisProp = \"\";\r\n\r\n\t\tthis.registerTableOption(\"htmlOutputConfig\", false); //html output config\r\n\r\n\t\tthis.registerColumnOption(\"htmlOutput\");\r\n\t\tthis.registerColumnOption(\"titleHtmlOutput\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"getHtml\", this.getHtml.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tgenerateExportList(config, style, range, colVisProp){\r\n\t\tthis.cloneTableStyle = style;\r\n\t\tthis.config = config || {};\r\n\t\tthis.colVisProp = colVisProp;\r\n\r\n\t\tvar headers = this.config.columnHeaders !== false ? this.headersToExportRows(this.generateColumnGroupHeaders()) : [];\r\n\t\tvar body = this.bodyToExportRows(this.rowLookup(range));\r\n\r\n\t\treturn headers.concat(body);\r\n\t}\r\n\r\n\tgenerateTable(config, style, range, colVisProp){\r\n\t\tvar list = this.generateExportList(config, style, range, colVisProp);\r\n\r\n\t\treturn this.generateTableElement(list);\r\n\t}\r\n\r\n\trowLookup(range){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(typeof range == \"function\"){\r\n\t\t\trange.call(this.table).forEach((row) =>{\r\n\t\t\t\trow = this.table.rowManager.findRow(row);\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tswitch(range){\r\n\t\t\t\tcase true:\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.table.rowManager.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"all\":\r\n\t\t\t\t\trows = this.table.rowManager.rows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"selected\":\r\n\t\t\t\t\trows = this.table.modules.selectRow.selectedRows;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows(this.table.rowManager.displayRows.length - 2);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Object.assign([], rows);\r\n\t}\r\n\r\n\tgenerateColumnGroupHeaders(){\r\n\t\tvar output = [];\r\n\r\n\t\tvar columns = this.config.columnGroups !== false ? this.table.columnManager.columns : this.table.columnManager.columnsByIndex;\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar colData = this.processColumnGroup(column);\r\n\r\n\t\t\tif(colData){\r\n\t\t\t\toutput.push(colData);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tprocessColumnGroup(column){\r\n\t\tvar subGroups = column.columns,\r\n\t\tmaxDepth = 0,\r\n\t\ttitle = column.definition[\"title\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))] || column.definition.title;\r\n\r\n\t\tvar groupData = {\r\n\t\t\ttitle:title,\r\n\t\t\tcolumn:column,\r\n\t\t\tdepth:1,\r\n\t\t};\r\n\r\n\t\tif(subGroups.length){\r\n\t\t\tgroupData.subGroups = [];\r\n\t\t\tgroupData.width = 0;\r\n\r\n\t\t\tsubGroups.forEach((subGroup) => {\r\n\t\t\t\tvar subGroupData = this.processColumnGroup(subGroup);\r\n\r\n\t\t\t\tif(subGroupData){\r\n\t\t\t\t\tgroupData.width += subGroupData.width;\r\n\t\t\t\t\tgroupData.subGroups.push(subGroupData);\r\n\r\n\t\t\t\t\tif(subGroupData.depth > maxDepth){\r\n\t\t\t\t\t\tmaxDepth = subGroupData.depth;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tgroupData.depth += maxDepth;\r\n\r\n\t\t\tif(!groupData.width){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.columnVisCheck(column)){\r\n\t\t\t\tgroupData.width = 1;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn groupData;\r\n\t}\r\n\r\n\tcolumnVisCheck(column){\r\n\t\tvar visProp = column.definition[this.colVisProp];\r\n\r\n\t\tif(typeof visProp === \"function\"){\r\n\t\t\tvisProp = visProp.call(this.table, column.getComponent());\r\n\t\t}\r\n\r\n\t\treturn visProp !== false && (column.visible || (!column.visible && visProp));\r\n\t}\r\n\r\n\theadersToExportRows(columns){\r\n\t\tvar headers = [],\r\n\t\theaderDepth = 0,\r\n\t\texportRows = [];\r\n\r\n\t\tfunction parseColumnGroup(column, level){\r\n\r\n\t\t\tvar depth = headerDepth - level;\r\n\r\n\t\t\tif(typeof headers[level] === \"undefined\"){\r\n\t\t\t\theaders[level] = [];\r\n\t\t\t}\r\n\r\n\t\t\tcolumn.height = column.subGroups ? 1 : (depth - column.depth) + 1;\r\n\r\n\t\t\theaders[level].push(column);\r\n\r\n\t\t\tif(column.height > 1){\r\n\t\t\t\tfor(let i = 1; i < column.height; i ++){\r\n\r\n\t\t\t\t\tif(typeof headers[level + i] === \"undefined\"){\r\n\t\t\t\t\t\theaders[level + i] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\theaders[level + i].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.width > 1){\r\n\t\t\t\tfor(let i = 1; i < column.width; i ++){\r\n\t\t\t\t\theaders[level].push(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(column.subGroups){\r\n\t\t\t\tcolumn.subGroups.forEach(function(subGroup){\r\n\t\t\t\t\tparseColumnGroup(subGroup, level+1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//calculate maximum header depth\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tif(column.depth > headerDepth){\r\n\t\t\t\theaderDepth = column.depth;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tparseColumnGroup(column,0);\r\n\t\t});\r\n\r\n\t\theaders.forEach((header) => {\r\n\t\t\tvar columns = [];\r\n\r\n\t\t\theader.forEach((col) => {\r\n\t\t\t\tif(col){\r\n\t\t\t\t\tlet title = typeof col.title === \"undefined\" ? \"\" : col.title;\r\n\t\t\t\t\tcolumns.push(new ExportColumn(title, col.column.getComponent(), col.width, col.height, col.depth));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumns.push(null);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\texportRows.push(new ExportRow(\"header\", columns));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tbodyToExportRows(rows){\r\n\r\n\t\tvar columns = [];\r\n\t\tvar exportRows = [];\r\n\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif (this.columnVisCheck(column)) {\r\n\t\t\t\tcolumns.push(column.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.config.columnCalcs !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized){\r\n\t\t\t\trows.unshift(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized){\r\n\t\t\t\trows.push(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows = rows.filter((row) => {\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn this.config.rowGroups !== false;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\treturn this.config.columnCalcs !== false;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\treturn !(this.table.options.dataTree && this.config.dataTree === false && row.modules.dataTree.parent);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t});\r\n\r\n\t\trows.forEach((row, i) => {\r\n\t\t\tvar rowData = row.getData(this.colVisProp);\r\n\t\t\tvar exportCols = [];\r\n\t\t\tvar indent = 0;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tindent = row.level;\r\n\t\t\t\t\texportCols.push(new ExportColumn(row.key, row.getComponent(), columns.length, 1));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\" :\r\n\t\t\t\tcase \"row\" :\r\n\t\t\t\t\tcolumns.forEach((col) => {\r\n\t\t\t\t\t\texportCols.push(new ExportColumn(col._column.getFieldValue(rowData), col, 1, 1));\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\t\tindent = row.modules.dataTree.index;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\texportRows.push(new ExportRow(row.type, exportCols, row.getComponent(), indent));\r\n\t\t});\r\n\r\n\t\treturn exportRows;\r\n\t}\r\n\r\n\tgenerateTableElement(list){\r\n\t\tvar table = document.createElement(\"table\"),\r\n\t\theaderEl = document.createElement(\"thead\"),\r\n\t\tbodyEl = document.createElement(\"tbody\"),\r\n\t\tstyles = this.lookupTableStyles(),\r\n\t\trowFormatter = this.table.options[\"rowFormatter\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))],\r\n\t\tsetup = {};\r\n\r\n\t\tsetup.rowFormatter = rowFormatter !== null ? rowFormatter : this.table.options.rowFormatter;\r\n\r\n\t\tif(this.table.options.dataTree &&this.config.dataTree !== false && this.table.modExists(\"columnCalcs\")){\r\n\t\t\tsetup.treeElementField = this.table.modules.dataTree.elementField;\r\n\t\t}\r\n\r\n\t\t//assign group header formatter\r\n\t\tsetup.groupHeader = this.table.options[\"groupHeader\" + (this.colVisProp.charAt(0).toUpperCase() + this.colVisProp.slice(1))];\r\n\r\n\t\tif(setup.groupHeader && !Array.isArray(setup.groupHeader)){\r\n\t\t\tsetup.groupHeader = [setup.groupHeader];\r\n\t\t}\r\n\r\n\t\ttable.classList.add(\"tabulator-print-table\");\r\n\r\n\t\tthis.mapElementStyles(this.table.columnManager.getHeadersElement(), headerEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\r\n\r\n\t\tif(list.length > 1000){\r\n\t\t\tconsole.warn(\"It may take a long time to render an HTML table with more than 1000 rows\");\r\n\t\t}\r\n\r\n\t\tlist.forEach((row, i) => {\r\n\t\t\tlet rowEl;\r\n\r\n\t\t\tswitch(row.type){\r\n\t\t\t\tcase \"header\":\r\n\t\t\t\t\theaderEl.appendChild(this.generateHeaderElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateGroupElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"calc\":\r\n\t\t\t\t\tbodyEl.appendChild(this.generateCalcElement(row, setup, styles));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"row\":\r\n\t\t\t\t\trowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\t\t\t\tthis.mapElementStyles(((i % 2) && styles.evenRow) ? styles.evenRow : styles.oddRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\t\t\t\tbodyEl.appendChild(rowEl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(headerEl.innerHTML){\r\n\t\t\ttable.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\ttable.appendChild(bodyEl);\r\n\r\n\r\n\t\tthis.mapElementStyles(this.table.element, table, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\"]);\r\n\t\treturn table;\r\n\t}\r\n\r\n\tlookupTableStyles(){\r\n\t\tvar styles = {};\r\n\r\n\t\t//lookup row styles\r\n\t\tif(this.cloneTableStyle && window.getComputedStyle){\r\n\t\t\tstyles.oddRow = this.table.element.querySelector(\".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.evenRow = this.table.element.querySelector(\".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.calcRow = this.table.element.querySelector(\".tabulator-row.tabulator-calcs\");\r\n\t\t\tstyles.firstRow = this.table.element.querySelector(\".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)\");\r\n\t\t\tstyles.firstGroup = this.table.element.getElementsByClassName(\"tabulator-group\")[0];\r\n\r\n\t\t\tif(styles.firstRow){\r\n\t\t\t\tstyles.styleCells = styles.firstRow.getElementsByClassName(\"tabulator-cell\");\r\n\t\t\t\tstyles.firstCell = styles.styleCells[0];\r\n\t\t\t\tstyles.lastCell = styles.styleCells[styles.styleCells.length - 1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn styles;\r\n\t}\r\n\r\n\tgenerateHeaderElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trow.columns.forEach((column) => {\r\n\t\t\tif(column){\r\n\t\t\t\tvar cellEl = document.createElement(\"th\");\r\n\t\t\t\tvar classNames = column.component._column.definition.cssClass ? column.component._column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tcellEl.colSpan = column.width;\r\n\t\t\t\tcellEl.rowSpan = column.height;\r\n\r\n\t\t\t\tcellEl.innerHTML = column.value;\r\n\r\n\t\t\t\tif(this.cloneTableStyle){\r\n\t\t\t\t\tcellEl.style.boxSizing = \"border-box\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"text-align\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"background-color\", \"color\", \"font-weight\", \"font-family\", \"font-size\"]);\r\n\t\t\t\tthis.mapElementStyles(column.component._column.contentElement, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\t\t\tif(column.component._column.visible){\r\n\t\t\t\t\tthis.mapElementStyles(column.component.getElement(), cellEl, [\"width\"]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(column.component._column.definition.width){\r\n\t\t\t\t\t\tcellEl.style.width = column.component._column.definition.width + \"px\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(column.component._column.parent){\r\n\t\t\t\t\tthis.mapElementStyles(column.component._column.parent.groupElement, cellEl, [\"border-top\"]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateGroupElement(row, setup, styles){\r\n\r\n\t\tvar rowEl = document.createElement(\"tr\"),\r\n\t\tcellEl = document.createElement(\"td\"),\r\n\t\tgroup = row.columns[0];\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\tif(setup.groupHeader && setup.groupHeader[row.indent]){\r\n\t\t\tgroup.value = setup.groupHeader[row.indent](group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t}else{\r\n\t\t\tif(setup.groupHeader !== false){\r\n\t\t\t\tgroup.value = row.component._group.generator(group.value, row.component._group.getRowCount(), row.component._group.getData(), row.component);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcellEl.colSpan = group.width;\r\n\t\tcellEl.innerHTML = group.value;\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-group\");\r\n\t\trowEl.classList.add(\"tabulator-group-level-\" + row.indent);\r\n\r\n\t\tif(group.component.isVisible()){\r\n\t\t\trowEl.classList.add(\"tabulator-group-visible\");\r\n\t\t}\r\n\r\n\t\tthis.mapElementStyles(styles.firstGroup, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\t\tthis.mapElementStyles(styles.firstGroup, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\"]);\r\n\r\n\t\trowEl.appendChild(cellEl);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateCalcElement(row, setup, styles){\r\n\t\tvar rowEl = this.generateRowElement(row, setup, styles);\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-calcs\");\r\n\t\tthis.mapElementStyles(styles.calcRow, rowEl, [\"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"background-color\"]);\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateRowElement(row, setup, styles){\r\n\t\tvar rowEl = document.createElement(\"tr\");\r\n\r\n\t\trowEl.classList.add(\"tabulator-print-table-row\");\r\n\r\n\t\trow.columns.forEach((col, i) => {\r\n\t\t\tif(col){\r\n\t\t\t\tvar cellEl = document.createElement(\"td\"),\r\n\t\t\t\tcolumn = col.component._column,\r\n\t\t\t\tindex = this.table.columnManager.findColumnIndex(column),\r\n\t\t\t\tvalue = col.value,\r\n\t\t\t\tcellStyle;\r\n\r\n\t\t\t\tvar cellWrapper = {\r\n\t\t\t\t\tmodules:{},\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn cellEl;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\treturn row.component.getData();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn row.component;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetComponent:function(){\r\n\t\t\t\t\t\treturn cellWrapper;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tvar classNames = column.definition.cssClass ? column.definition.cssClass.split(\" \") : [];\r\n\r\n\t\t\t\tclassNames.forEach(function(className) {\r\n\t\t\t\t\tcellEl.classList.add(className);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.modExists(\"format\") && this.config.formatCells !== false){\r\n\t\t\t\t\tvalue = this.table.modules.format.formatExportValue(cellWrapper, this.colVisProp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\t\tvalue = value !== null ? JSON.stringify(value) : \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(value instanceof Node){\r\n\t\t\t\t\tcellEl.appendChild(value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcellEl.innerHTML = value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcellStyle = styles.styleCells && styles.styleCells[index] ? styles.styleCells[index] : styles.firstCell;\r\n\r\n\t\t\t\tif(cellStyle){\r\n\t\t\t\t\tthis.mapElementStyles(cellStyle, cellEl, [\"padding-top\", \"padding-left\", \"padding-right\", \"padding-bottom\", \"border-top\", \"border-left\", \"border-right\", \"border-bottom\", \"color\", \"font-weight\", \"font-family\", \"font-size\", \"text-align\"]);\r\n\r\n\t\t\t\t\tif(column.definition.align){\r\n\t\t\t\t\t\tcellEl.style.textAlign = column.definition.align;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(this.table.options.dataTree && this.config.dataTree !== false){\r\n\t\t\t\t\tif((setup.treeElementField && setup.treeElementField == column.field) || (!setup.treeElementField && i == 0)){\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.controlEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.controlEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(row.component._row.modules.dataTree.branchEl){\r\n\t\t\t\t\t\t\tcellEl.insertBefore(row.component._row.modules.dataTree.branchEl.cloneNode(true), cellEl.firstChild);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowEl.appendChild(cellEl);\r\n\r\n\t\t\t\tif(cellWrapper.modules.format && cellWrapper.modules.format.renderedCallback){\r\n\t\t\t\t\tcellWrapper.modules.format.renderedCallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(setup.rowFormatter && this.config.formatCells !== false){\r\n\t\t\t\t\tsetup.rowFormatter(row.component);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn rowEl;\r\n\t}\r\n\r\n\tgenerateHTMLTable(list){\r\n\t\tvar holder = document.createElement(\"div\");\r\n\r\n\t\tholder.appendChild(this.generateTableElement(list));\r\n\r\n\t\treturn holder.innerHTML;\r\n\t}\r\n\r\n\tgetHtml(visible, style, config, colVisProp){\r\n\t\tvar list = this.generateExportList(config || this.table.options.htmlOutputConfig, style, visible, colVisProp || \"htmlOutput\");\r\n\r\n\t\treturn this.generateHTMLTable(list);\r\n\t}\r\n\r\n\tmapElementStyles(from, to, props){\r\n\t\tif(this.cloneTableStyle && from && to){\r\n\r\n\t\t\tvar lookup = {\r\n\t\t\t\t\"background-color\" : \"backgroundColor\",\r\n\t\t\t\t\"color\" : \"fontColor\",\r\n\t\t\t\t\"width\" : \"width\",\r\n\t\t\t\t\"font-weight\" : \"fontWeight\",\r\n\t\t\t\t\"font-family\" : \"fontFamily\",\r\n\t\t\t\t\"font-size\" : \"fontSize\",\r\n\t\t\t\t\"text-align\" : \"textAlign\",\r\n\t\t\t\t\"border-top\" : \"borderTop\",\r\n\t\t\t\t\"border-left\" : \"borderLeft\",\r\n\t\t\t\t\"border-right\" : \"borderRight\",\r\n\t\t\t\t\"border-bottom\" : \"borderBottom\",\r\n\t\t\t\t\"padding-top\" : \"paddingTop\",\r\n\t\t\t\t\"padding-left\" : \"paddingLeft\",\r\n\t\t\t\t\"padding-right\" : \"paddingRight\",\r\n\t\t\t\t\"padding-bottom\" : \"paddingBottom\",\r\n\t\t\t};\r\n\r\n\t\t\tif(window.getComputedStyle){\r\n\t\t\t\tvar fromStyle = window.getComputedStyle(from);\r\n\r\n\t\t\t\tprops.forEach(function(prop){\r\n\t\t\t\t\tto.style[lookup[prop]] = fromStyle.getPropertyValue(prop);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nExport.moduleName = \"export\";\r\n\r\nexport default Export;\r\n","export default {\r\n\r\n\t//equal to\r\n\t\"=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal == filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than\r\n\t\"<\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal < filterVal ? true : false;\r\n\t},\r\n\r\n\t//less than or equal to\r\n\t\"<=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal <= filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than\r\n\t\">\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal > filterVal ? true : false;\r\n\t},\r\n\r\n\t//greater than or equal to\r\n\t\">=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal >= filterVal ? true : false;\r\n\t},\r\n\r\n\t//not equal to\r\n\t\"!=\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\treturn rowVal != filterVal ? true : false;\r\n\t},\r\n\r\n\t\"regex\":function(filterVal, rowVal, rowData, filterParams){\r\n\r\n\t\tif(typeof filterVal == \"string\"){\r\n\t\t\tfilterVal = new RegExp(filterVal);\r\n\t\t}\r\n\r\n\t\treturn filterVal.test(rowVal);\r\n\t},\r\n\r\n\t//contains the string\r\n\t\"like\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().indexOf(filterVal.toLowerCase()) > -1;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//contains the keywords\r\n\t\"keywords\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tvar keywords = filterVal.toLowerCase().split(typeof filterParams.separator === \"undefined\" ? \" \" : filterParams.separator),\r\n\t\tvalue = String(rowVal === null || typeof rowVal === \"undefined\" ? \"\" : rowVal).toLowerCase(),\r\n\t\tmatches = [];\r\n\r\n\t\tkeywords.forEach((keyword) =>{\r\n\t\t\tif(value.includes(keyword)){\r\n\t\t\t\tmatches.push(true);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn filterParams.matchAll ? matches.length === keywords.length : !!matches.length;\r\n\t},\r\n\r\n\t//starts with the string\r\n\t\"starts\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().startsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//ends with the string\r\n\t\"ends\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(filterVal === null || typeof filterVal === \"undefined\"){\r\n\t\t\treturn rowVal === filterVal ? true : false;\r\n\t\t}else{\r\n\t\t\tif(typeof rowVal !== 'undefined' && rowVal !== null){\r\n\t\t\t\treturn String(rowVal).toLowerCase().endsWith(filterVal.toLowerCase());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t//in array\r\n\t\"in\":function(filterVal, rowVal, rowData, filterParams){\r\n\t\tif(Array.isArray(filterVal)){\r\n\t\t\treturn filterVal.length ? filterVal.indexOf(rowVal) > -1 : true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - filter value is not an array:\", filterVal);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultFilters from './defaults/filters.js';\r\n\r\nclass Filter extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.filterList = []; //hold filter list\r\n\t\tthis.headerFilters = {}; //hold column filters\r\n\t\tthis.headerFilterColumns = []; //hold columns that use header filters\r\n\r\n\t\tthis.prevHeaderFilterChangeCheck = \"\";\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.changed = false; //has filtering changed since last render\r\n\t\tthis.tableInitialized = false;\r\n\r\n\t\tthis.registerTableOption(\"filterMode\", \"local\"); //local or remote filtering\r\n\r\n\t\tthis.registerTableOption(\"initialFilter\", false); //initial filtering criteria\r\n\t\tthis.registerTableOption(\"initialHeaderFilter\", false); //initial header filtering criteria\r\n\t\tthis.registerTableOption(\"headerFilterLiveFilterDelay\", 300); //delay before updating column after user types in header filter\r\n\r\n\t\tthis.registerColumnOption(\"headerFilter\");\r\n\t\tthis.registerColumnOption(\"headerFilterPlaceholder\");\r\n\t\tthis.registerColumnOption(\"headerFilterParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterEmptyCheck\");\r\n\t\tthis.registerColumnOption(\"headerFilterFunc\");\r\n\t\tthis.registerColumnOption(\"headerFilterFuncParams\");\r\n\t\tthis.registerColumnOption(\"headerFilterLiveFilter\");\r\n\r\n\t\tthis.registerTableFunction(\"searchRows\", this.searchRows.bind(this));\r\n\t\tthis.registerTableFunction(\"searchData\", this.searchData.bind(this));\r\n\r\n\t\tthis.registerTableFunction(\"setFilter\", this.userSetFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"refreshFilter\", this.userRefreshFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"addFilter\", this.userAddFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"getFilters\", this.getFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterFocus\", this.userSetHeaderFilterFocus.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilterValue\", this.userGetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"setHeaderFilterValue\", this.userSetHeaderFilterValue.bind(this));\r\n\t\tthis.registerTableFunction(\"getHeaderFilters\", this.getHeaderFilters.bind(this));\r\n\t\tthis.registerTableFunction(\"removeFilter\", this.userRemoveFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearFilter\", this.userClearFilter.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHeaderFilter\", this.userClearHeaderFilter.bind(this));\r\n\r\n\t\tthis.registerComponentFunction(\"column\", \"headerFilterFocus\", this.setHeaderFilterFocus.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"reloadHeaderFilter\", this.reloadHeaderFilter.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"getHeaderFilterValue\", this.getHeaderFilterValue.bind(this));\r\n\t\tthis.registerComponentFunction(\"column\", \"setHeaderFilterValue\", this.setHeaderFilterValue.bind(this));\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumnHeaderFilter.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-before\", this.hideHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"column-width-fit-after\", this.showHeaderFilterElements.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\r\n\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteFilterParams.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerDataHandler(this.filter.bind(this), 10);\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialFilter){\r\n\t\t\tthis.setFilter(this.table.options.initialFilter);\r\n\t\t}\r\n\r\n\t\tif(this.table.options.initialHeaderFilter){\r\n\t\t\tthis.table.options.initialHeaderFilter.forEach((item) => {\r\n\r\n\t\t\t\tvar column = this.table.columnManager.findColumn(item.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tthis.setHeaderFilterValue(column, item.value);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", item.field);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.tableInitialized = true;\r\n\t}\r\n\r\n\tremoteFilterParams(data, config, silent, params){\r\n\t\tparams.filter = this.getFilters(true, true);\r\n\t\treturn params;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t//set standard filters\r\n\tuserSetFilter(field, type, value, params){\r\n\t\tthis.setFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//set standard filters\r\n\tuserRefreshFilter(){\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//add filter to array\r\n\tuserAddFilter(field, type, value, params){\r\n\t\tthis.addFilter(field, type, value, params);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\tuserSetHeaderFilterFocus(field){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterFocus(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tuserGetHeaderFilterValue(field) {\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\treturn this.getHeaderFilterValue(column);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t}\r\n\t}\r\n\r\n\tuserSetHeaderFilterValue(field, value){\r\n\t\tvar column = this.table.columnManager.findColumn(field);\r\n\r\n\t\tif(column){\r\n\t\t\tthis.setHeaderFilterValue(column, value);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tuserRemoveFilter(field, type, value){\r\n\t\tthis.removeFilter(field, type, value);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear filters\r\n\tuserClearFilter(all){\r\n\t\tthis.clearFilter(all);\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tuserClearHeaderFilter(){\r\n\t\tthis.clearHeaderFilter();\r\n\t\tthis.refreshFilter();\r\n\t}\r\n\r\n\r\n\t//search for specific row components\r\n\tsearchRows(field, type, value){\r\n\t\treturn this.search(\"rows\", field, type, value);\r\n\t}\r\n\r\n\t//search for specific data\r\n\tsearchData(field, type, value){\r\n\t\treturn this.search(\"data\", field, type, value);\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumnHeaderFilter(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tif(def.headerFilter){\r\n\r\n\t\t\tif(typeof def.headerFilterPlaceholder !== \"undefined\" && def.field){\r\n\t\t\t\tthis.module(\"localize\").setHeaderFilterColumnPlaceholder(def.field, def.headerFilterPlaceholder);\r\n\t\t\t}\r\n\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\r\n\t//initialize column header filter\r\n\tinitializeColumn(column, value){\r\n\t\tvar self = this,\r\n\t\tfield = column.getField();\r\n\r\n\t\t//handle successfully value change\r\n\t\tfunction success(value){\r\n\t\t\tvar filterType = (column.modules.filter.tagType == \"input\" && column.modules.filter.attrType == \"text\") || column.modules.filter.tagType == \"textarea\" ? \"partial\" : \"match\",\r\n\t\t\ttype = \"\",\r\n\t\t\tfilterChangeCheck = \"\",\r\n\t\t\tfilterFunc;\r\n\r\n\t\t\tif(typeof column.modules.filter.prevSuccess === \"undefined\" || column.modules.filter.prevSuccess !== value){\r\n\r\n\t\t\t\tcolumn.modules.filter.prevSuccess = value;\r\n\r\n\t\t\t\tif(!column.modules.filter.emptyFunc(value)){\r\n\t\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\t\tswitch(typeof column.definition.headerFilterFunc){\r\n\t\t\t\t\t\tcase \"string\":\r\n\t\t\t\t\t\t\tif(Filter.filters[column.definition.headerFilterFunc]){\r\n\t\t\t\t\t\t\t\ttype = column.definition.headerFilterFunc;\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\t\treturn Filter.filters[column.definition.headerFilterFunc](value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Header Filter Error - Matching filter function not found: \", column.definition.headerFilterFunc);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\tvar params = column.definition.headerFilterFuncParams || {};\r\n\t\t\t\t\t\t\t\tvar fieldVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\tparams = typeof params === \"function\" ? params(value, fieldVal, data) : params;\r\n\r\n\t\t\t\t\t\t\t\treturn column.definition.headerFilterFunc(value, fieldVal, data, params);\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\ttype = filterFunc;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!filterFunc){\r\n\t\t\t\t\t\tswitch(filterType){\r\n\t\t\t\t\t\t\tcase \"partial\":\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\tvar colVal = column.getFieldValue(data);\r\n\r\n\t\t\t\t\t\t\t\t\tif(typeof colVal !== 'undefined' && colVal !== null){\r\n\t\t\t\t\t\t\t\t\t\treturn String(colVal).toLowerCase().indexOf(String(value).toLowerCase()) > -1;\r\n\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"like\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\t\t\t\treturn column.getFieldValue(data) == value;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t\ttype = \"=\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.headerFilters[field] = {value:value, func:filterFunc, type:type};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdelete self.headerFilters[field];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcolumn.modules.filter.value = value;\r\n\r\n\t\t\t\tfilterChangeCheck = JSON.stringify(self.headerFilters);\r\n\r\n\t\t\t\tif(self.prevHeaderFilterChangeCheck !== filterChangeCheck){\r\n\t\t\t\t\tself.prevHeaderFilterChangeCheck = filterChangeCheck;\r\n\r\n\t\t\t\t\tself.trackChanges();\r\n\t\t\t\t\tself.refreshFilter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.filter = {\r\n\t\t\tsuccess:success,\r\n\t\t\tattrType:false,\r\n\t\t\ttagType:false,\r\n\t\t\temptyFunc:false,\r\n\t\t};\r\n\r\n\t\tthis.generateHeaderFilterElement(column);\r\n\t}\r\n\r\n\tgenerateHeaderFilterElement(column, initialValue, reinitialize){\r\n\t\tvar self = this,\r\n\t\tsuccess = column.modules.filter.success,\r\n\t\tfield = column.getField(),\r\n\t\tfilterElement, editor, editorElement, cellWrapper, typingTimer, searchTrigger, params;\r\n\r\n\t\tcolumn.modules.filter.value = initialValue;\r\n\r\n\t\t//handle aborted edit\r\n\t\tfunction cancel(){}\r\n\r\n\t\tif(column.modules.filter.headerElement && column.modules.filter.headerElement.parentNode){\r\n\t\t\tcolumn.contentElement.removeChild(column.modules.filter.headerElement.parentNode);\r\n\t\t}\r\n\r\n\t\tif(field){\r\n\r\n\t\t\t//set empty value function\r\n\t\t\tcolumn.modules.filter.emptyFunc = column.definition.headerFilterEmptyCheck || function(value){\r\n\t\t\t\treturn !value && value !== 0;\r\n\t\t\t};\r\n\r\n\t\t\tfilterElement = document.createElement(\"div\");\r\n\t\t\tfilterElement.classList.add(\"tabulator-header-filter\");\r\n\r\n\t\t\t//set column editor\r\n\t\t\tswitch(typeof column.definition.headerFilter){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(self.table.modules.edit.editors[column.definition.headerFilter]){\r\n\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.headerFilter];\r\n\r\n\t\t\t\t\t\tif((column.definition.headerFilter === \"tick\" || column.definition.headerFilter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Filter Error - Cannot build header filter, No such editor found: \", column.definition.editor);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\teditor = column.definition.headerFilter;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\tif(column.modules.edit && column.modules.edit.editor){\r\n\t\t\t\t\t\teditor = column.modules.edit.editor;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(column.definition.formatter && self.table.modules.edit.editors[column.definition.formatter]){\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[column.definition.formatter];\r\n\r\n\t\t\t\t\t\t\tif((column.definition.formatter === \"tick\" || column.definition.formatter === \"tickCross\") && !column.definition.headerFilterEmptyCheck){\r\n\t\t\t\t\t\t\t\tcolumn.modules.filter.emptyFunc = function(value){\r\n\t\t\t\t\t\t\t\t\treturn value !== true && value !== false;\r\n\t\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\teditor = self.table.modules.edit.editors[\"input\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(editor){\r\n\r\n\t\t\t\tcellWrapper = {\r\n\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\treturn typeof initialValue !== \"undefined\" ? initialValue : \"\";\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetField:function(){\r\n\t\t\t\t\t\treturn column.definition.field;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\treturn filterElement;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetTable:() => {\r\n\t\t\t\t\t\treturn this.table;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tnormalizeHeight:function(){\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tparams = column.definition.headerFilterParams || {};\r\n\r\n\t\t\t\tparams = typeof params === \"function\" ? params.call(self.table, cellWrapper) : params;\r\n\r\n\t\t\t\teditorElement = editor.call(this.table.modules.edit, cellWrapper, function(){}, success, cancel, params);\r\n\r\n\t\t\t\tif(!editorElement){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor returned a value of false\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!(editorElement instanceof Node)){\r\n\t\t\t\t\tconsole.warn(\"Filter Error - Cannot add filter to \" + field + \" column, editor should return an instance of Node, the editor returned:\", editorElement);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//set Placeholder Text\r\n\t\t\t\tself.langBind(\"headerFilters|columns|\" + column.definition.field, function(value){\r\n\t\t\t\t\teditorElement.setAttribute(\"placeholder\", typeof value !== \"undefined\" && value ? value : self.langText(\"headerFilters|default\"));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//focus on element on click\r\n\t\t\t\teditorElement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\teditorElement.focus();\r\n\t\t\t\t});\r\n\r\n\t\t\t\teditorElement.addEventListener(\"focus\", (e) => {\r\n\t\t\t\t\tvar left = this.table.columnManager.element.scrollLeft;\r\n\r\n\t\t\t\t\tvar headerPos = this.table.rowManager.element.scrollLeft + parseInt(this.table.columnManager.element.style.marginLeft);\r\n\r\n\t\t\t\t\tif(left !== headerPos){\r\n\t\t\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t\t\tthis.table.columnManager.scrollHorizontal(left);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//live update filters as user types\r\n\t\t\t\ttypingTimer = false;\r\n\r\n\t\t\t\tsearchTrigger = function(e){\r\n\t\t\t\t\tif(typingTimer){\r\n\t\t\t\t\t\tclearTimeout(typingTimer);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\ttypingTimer = setTimeout(function(){\r\n\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t},self.table.options.headerFilterLiveFilterDelay);\r\n\t\t\t\t};\r\n\r\n\t\t\t\tcolumn.modules.filter.headerElement = editorElement;\r\n\t\t\t\tcolumn.modules.filter.attrType = editorElement.hasAttribute(\"type\") ? editorElement.getAttribute(\"type\").toLowerCase() : \"\" ;\r\n\t\t\t\tcolumn.modules.filter.tagType = editorElement.tagName.toLowerCase();\r\n\r\n\t\t\t\tif(column.definition.headerFilterLiveFilter !== false){\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'autocomplete' ||\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === 'tickCross' ||\r\n\t\t\t\t\t\t\t((column.definition.editor === 'autocomplete' ||\r\n\t\t\t\t\t\t\t\tcolumn.definition.editor === 'tickCross') &&\r\n\t\t\t\t\t\t\tcolumn.definition.headerFilter === true)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\teditorElement.addEventListener(\"keyup\", searchTrigger);\r\n\t\t\t\t\t\teditorElement.addEventListener(\"search\", searchTrigger);\r\n\r\n\r\n\t\t\t\t\t\t//update number filtered columns on change\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"number\"){\r\n\t\t\t\t\t\t\teditorElement.addEventListener(\"change\", function(e){\r\n\t\t\t\t\t\t\t\tsuccess(editorElement.value);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//change text inputs to search inputs to allow for clearing of field\r\n\t\t\t\t\t\tif(column.modules.filter.attrType == \"text\" && this.table.browser !== \"ie\"){\r\n\t\t\t\t\t\t\teditorElement.setAttribute(\"type\", \"search\");\r\n\t\t\t\t\t\t// editorElement.off(\"change blur\"); //prevent blur from triggering filter and preventing selection click\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//prevent input and select elements from propagating click to column sorters etc\r\n\t\t\t\t\tif(column.modules.filter.tagType == \"input\" || column.modules.filter.tagType == \"select\" || column.modules.filter.tagType == \"textarea\"){\r\n\t\t\t\t\t\teditorElement.addEventListener(\"mousedown\",function(e){\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfilterElement.appendChild(editorElement);\r\n\r\n\t\t\t\tcolumn.contentElement.appendChild(filterElement);\r\n\r\n\t\t\t\tif(!reinitialize){\r\n\t\t\t\t\tself.headerFilterColumns.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Filter Error - Cannot add header filter, column has no field set:\", column.definition.title);\r\n\t\t}\r\n\t}\r\n\r\n\t//hide all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\thideHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//show all header filter elements (used to ensure correct column widths in \"fitData\" layout mode)\r\n\tshowHeaderFilterElements(){\r\n\t\tthis.headerFilterColumns.forEach(function(column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tcolumn.modules.filter.headerElement.style.display = '';\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//programmatically set focus of header filter\r\n\tsetHeaderFilterFocus(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\tcolumn.modules.filter.headerElement.focus();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Filter Focus Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically get value of header filter\r\n\tgetHeaderFilterValue(column){\r\n\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\treturn column.modules.filter.value;\r\n\t\t} else {\r\n\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t}\r\n\t}\r\n\r\n\t//programmatically set value of header filter\r\n\tsetHeaderFilterValue(column, value){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, value, true);\r\n\t\t\t\tcolumn.modules.filter.success(value);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treloadHeaderFilter(column){\r\n\t\tif (column){\r\n\t\t\tif(column.modules.filter && column.modules.filter.headerElement){\r\n\t\t\t\tthis.generateHeaderFilterElement(column, column.modules.filter.value, true);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Column Filter Error - No header filter set on column:\", column.getField());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\trefreshFilter(){\r\n\t\tif(this.tableInitialized){\r\n\t\t\tif(this.table.options.filterMode === \"remote\"){\r\n\t\t\t\tthis.reloadData(null, false, false);\r\n\t\t\t}else{\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\ttrackChanges(){\r\n\t\tthis.changed = true;\r\n\t\tthis.dispatch(\"filter-changed\");\r\n\t}\r\n\r\n\t//check if the filters has changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//set standard filters\r\n\tsetFilter(field, type, value, params){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tthis.addFilter(field);\r\n\t}\r\n\r\n\t//add filter to array\r\n\taddFilter(field, type, value, params){\r\n\t\tvar changed = false;\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value, params:params}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tthis.filterList.push(filter);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(changed){\r\n\t\t\tthis.trackChanges();\r\n\t\t}\r\n\t}\r\n\r\n\tfindFilter(filter){\r\n\t\tvar column;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\treturn this.findSubFilters(filter);\r\n\t\t}\r\n\r\n\t\tvar filterFunc = false;\r\n\r\n\t\tif(typeof filter.field == \"function\"){\r\n\t\t\tfilterFunc = function(data){\r\n\t\t\t\treturn filter.field(data, filter.type || {});// pass params to custom filter function\r\n\t\t\t};\r\n\t\t}else{\r\n\r\n\t\t\tif(Filter.filters[filter.type]){\r\n\r\n\t\t\t\tcolumn = this.table.columnManager.getColumnByField(filter.field);\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, column.getFieldValue(data), data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfilterFunc = function(data){\r\n\t\t\t\t\t\treturn Filter.filters[filter.type](filter.value, data[filter.field], data, filter.params || {});\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No such filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfilter.func = filterFunc;\r\n\r\n\t\treturn filter.func ? filter : false;\r\n\t}\r\n\r\n\tfindSubFilters(filters){\r\n\t\tvar output = [];\r\n\r\n\t\tfilters.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\toutput.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output.length ? output : false;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetFilters(all, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tif(all){\r\n\t\t\toutput = this.getHeaderFilters();\r\n\t\t}\r\n\r\n\t\tif(ajax){\r\n\t\t\toutput.forEach(function(item){\r\n\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\toutput = output.concat(this.filtersToArray(this.filterList, ajax));\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//filter to Object\r\n\tfiltersToArray(filterList, ajax){\r\n\t\tvar output = [];\r\n\r\n\t\tfilterList.forEach((filter) => {\r\n\t\t\tvar item;\r\n\r\n\t\t\tif(Array.isArray(filter)){\r\n\t\t\t\toutput.push(this.filtersToArray(filter, ajax));\r\n\t\t\t}else{\r\n\t\t\t\titem = {field:filter.field, type:filter.type, value:filter.value};\r\n\r\n\t\t\t\tif(ajax){\r\n\t\t\t\t\tif(typeof item.type == \"function\"){\r\n\t\t\t\t\t\titem.type = \"function\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(item);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//get all filters\r\n\tgetHeaderFilters(){\r\n\t\tvar output = [];\r\n\r\n\t\tfor(var key in this.headerFilters){\r\n\t\t\toutput.push({field:key, type:this.headerFilters[key].type, value:this.headerFilters[key].value});\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//remove filter from array\r\n\tremoveFilter(field, type, value){\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tvar index = -1;\r\n\r\n\t\t\tif(typeof filter.field == \"object\"){\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter === element;\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tindex = this.filterList.findIndex((element) => {\r\n\t\t\t\t\treturn filter.field === element.field && filter.type === element.type && filter.value === element.value;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.filterList.splice(index, 1);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Filter Error - No matching filter type found, ignoring: \", filter.type);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear filters\r\n\tclearFilter(all){\r\n\t\tthis.filterList = [];\r\n\r\n\t\tif(all){\r\n\t\t\tthis.clearHeaderFilter();\r\n\t\t}\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//clear header filters\r\n\tclearHeaderFilter(){\r\n\t\tthis.headerFilters = {};\r\n\t\tthis.prevHeaderFilterChangeCheck = \"{}\";\r\n\r\n\t\tthis.headerFilterColumns.forEach((column) => {\r\n\t\t\tif(typeof column.modules.filter.value !== \"undefined\"){\r\n\t\t\t\tdelete column.modules.filter.value;\r\n\t\t\t}\r\n\t\t\tcolumn.modules.filter.prevSuccess = undefined;\r\n\t\t\tthis.reloadHeaderFilter(column);\r\n\t\t});\r\n\r\n\t\tthis.trackChanges();\r\n\t}\r\n\r\n\t//search data and return matching rows\r\n\tsearch (searchType, field, type, value){\r\n\t\tvar activeRows = [],\r\n\t\tfilterList = [];\r\n\r\n\t\tif(!Array.isArray(field)){\r\n\t\t\tfield = [{field:field, type:type, value:value}];\r\n\t\t}\r\n\r\n\t\tfield.forEach((filter) => {\r\n\t\t\tfilter = this.findFilter(filter);\r\n\r\n\t\t\tif(filter){\r\n\t\t\t\tfilterList.push(filter);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\tvar match = true;\r\n\r\n\t\t\tfilterList.forEach((filter) => {\r\n\t\t\t\tif(!this.filterRecurse(filter, row.getData())){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tactiveRows.push(searchType === \"data\" ? row.getData(\"data\") : row.getComponent());\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter row array\r\n\tfilter(rowList, filters){\r\n\t\tvar activeRows = [],\r\n\t\tactiveRowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltering\")){\r\n\t\t\tthis.dispatchExternal(\"dataFiltering\", this.getFilters(true));\r\n\t\t}\r\n\r\n\t\tif(this.table.options.filterMode !== \"remote\" && (this.filterList.length || Object.keys(this.headerFilters).length)){\r\n\r\n\t\t\trowList.forEach((row) => {\r\n\t\t\t\tif(this.filterRow(row)){\r\n\t\t\t\t\tactiveRows.push(row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t}else{\r\n\t\t\tactiveRows = rowList.slice(0);\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataFiltered\")){\r\n\r\n\t\t\tactiveRows.forEach((row) => {\r\n\t\t\t\tactiveRowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataFiltered\", this.getFilters(true), activeRowComponents);\r\n\t\t}\r\n\r\n\t\treturn activeRows;\r\n\t}\r\n\r\n\t//filter individual row\r\n\tfilterRow(row, filters){\r\n\t\tvar match = true,\r\n\t\tdata = row.getData();\r\n\r\n\t\tthis.filterList.forEach((filter) => {\r\n\t\t\tif(!this.filterRecurse(filter, data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\r\n\t\tfor(var field in this.headerFilters){\r\n\t\t\tif(!this.headerFilters[field].func(data)){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n\r\n\tfilterRecurse(filter, data){\r\n\t\tvar match = false;\r\n\r\n\t\tif(Array.isArray(filter)){\r\n\t\t\tfilter.forEach((subFilter) => {\r\n\t\t\t\tif(this.filterRecurse(subFilter, data)){\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tmatch = filter.func(data);\r\n\t\t}\r\n\r\n\t\treturn match;\r\n\t}\r\n}\r\n\r\nFilter.moduleName = \"filter\";\r\n\r\n//load defaults\r\nFilter.filters = defaultFilters;\r\n\r\nexport default Filter;","import plaintext from './formatters/plaintext.js';\r\nimport html from './formatters/html.js';\r\nimport textarea from './formatters/textarea.js';\r\nimport money from './formatters/money.js';\r\nimport link from './formatters/link.js';\r\nimport image from './formatters/image.js';\r\nimport tickCross from './formatters/tickCross.js';\r\nimport datetime from './formatters/datetime.js';\r\nimport datetimediff from './formatters/datetimediff.js';\r\nimport lookup from './formatters/lookup.js';\r\nimport star from './formatters/star.js';\r\nimport traffic from './formatters/traffic.js';\r\nimport progress from './formatters/progress.js';\r\nimport color from './formatters/color.js';\r\nimport buttonTick from './formatters/buttonTick.js';\r\nimport buttonCross from './formatters/buttonCross.js';\r\nimport rownum from './formatters/rownum.js';\r\nimport handle from './formatters/handle.js';\r\nimport responsiveCollapse from './formatters/responsiveCollapse.js';\r\nimport rowSelection from './formatters/rowSelection.js';\r\n\r\nexport default {\r\n\tplaintext:plaintext,\r\n\thtml:html,\r\n\ttextarea:textarea,\r\n\tmoney:money,\r\n\tlink:link,\r\n\timage:image,\r\n\ttickCross:tickCross,\r\n\tdatetime:datetime,\r\n\tdatetimediff:datetimediff,\r\n\tlookup:lookup,\r\n\tstar:star,\r\n\ttraffic:traffic,\r\n\tprogress:progress,\r\n\tcolor:color,\r\n\tbuttonTick:buttonTick,\r\n\tbuttonCross:buttonCross,\r\n\trownum:rownum,\r\n\thandle:handle,\r\n\tresponsiveCollapse:responsiveCollapse,\r\n\trowSelection:rowSelection,\r\n};","export default function(cell, formatterParams, onRendered){\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn cell.getValue();\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.whiteSpace = \"pre-wrap\";\r\n\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar floatVal = parseFloat(cell.getValue()),\r\n\tsign = \"\",\r\n\tnumber, integer, decimal, rgx;\r\n\r\n\tvar decimalSym = formatterParams.decimal || \".\";\r\n\tvar thousandSym = formatterParams.thousand || \",\";\r\n\tvar negativeSign = formatterParams.negativeSign || \"-\";\r\n\tvar symbol = formatterParams.symbol || \"\";\r\n\tvar after = !!formatterParams.symbolAfter;\r\n\tvar precision = typeof formatterParams.precision !== \"undefined\" ? formatterParams.precision : 2;\r\n\r\n\tif(isNaN(floatVal)){\r\n\t\treturn this.emptyToSpace(this.sanitizeHTML(cell.getValue()));\r\n\t}\r\n\r\n\tif(floatVal < 0){\r\n\t\tfloatVal = Math.abs(floatVal);\r\n\t\tsign = negativeSign;\r\n\t}\r\n\r\n\tnumber = precision !== false ? floatVal.toFixed(precision) : floatVal;\r\n\tnumber = String(number).split(\".\");\r\n\r\n\tinteger = number[0];\r\n\tdecimal = number.length > 1 ? decimalSym + number[1] : \"\";\r\n\r\n\tif (formatterParams.thousand !== false) {\r\n\t\trgx = /(\\d+)(\\d{3})/;\r\n\r\n\t\twhile (rgx.test(integer)){\r\n\t\t\tinteger = integer.replace(rgx, \"$1\" + thousandSym + \"$2\");\r\n\t\t}\r\n\t}\r\n\r\n\treturn after ? sign + integer + decimal + symbol : sign + symbol + integer + decimal;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\turlPrefix = formatterParams.urlPrefix || \"\",\r\n\tdownload = formatterParams.download,\r\n\tlabel = value,\r\n\tel = document.createElement(\"a\"),\r\n\tdata;\r\n\r\n\tfunction labelTraverse(path, data){\r\n\t\tvar item = path.shift(),\r\n\t\tvalue = data[item];\r\n\t\t\r\n\t\tif(path.length && typeof value === \"object\"){\r\n\t\t\treturn labelTraverse(path, value);\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif(formatterParams.labelField){\r\n\t\tdata = cell.getData();\r\n\t\tlabel = labelTraverse(formatterParams.labelField.split(this.table.options.nestedFieldSeparator), data);\r\n\t}\r\n\r\n\tif(formatterParams.label){\r\n\t\tswitch(typeof formatterParams.label){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlabel = formatterParams.label;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tlabel = formatterParams.label(cell);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(label){\r\n\t\tif(formatterParams.urlField){\r\n\t\t\tdata = cell.getData();\r\n\t\t\tvalue = data[formatterParams.urlField];\r\n\t\t}\r\n\r\n\t\tif(formatterParams.url){\r\n\t\t\tswitch(typeof formatterParams.url){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tvalue = formatterParams.url;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tvalue = formatterParams.url(cell);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tel.setAttribute(\"href\", urlPrefix + value);\r\n\r\n\t\tif(formatterParams.target){\r\n\t\t\tel.setAttribute(\"target\", formatterParams.target);\r\n\t\t}\r\n\r\n\t\tif(formatterParams.download){\r\n\r\n\t\t\tif(typeof download == \"function\"){\r\n\t\t\t\tdownload = download(cell);\r\n\t\t\t}else{\r\n\t\t\t\tdownload = download === true ? \"\" : download;\r\n\t\t\t}\r\n\r\n\t\t\tel.setAttribute(\"download\", download);\r\n\t\t}\r\n\r\n\t\tel.innerHTML = this.emptyToSpace(this.sanitizeHTML(label));\r\n\r\n\t\treturn el;\r\n\t}else{\r\n\t\treturn \" \";\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"img\"),\r\n\tsrc = cell.getValue();\r\n\r\n\tif(formatterParams.urlPrefix){\r\n\t\tsrc = formatterParams.urlPrefix + cell.getValue();\r\n\t}\r\n\r\n\tif(formatterParams.urlSuffix){\r\n\t\tsrc = src + formatterParams.urlSuffix;\r\n\t}\r\n\r\n\tel.setAttribute(\"src\", src);\r\n\r\n\tswitch(typeof formatterParams.height){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.height = formatterParams.height + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.height = formatterParams.height;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tswitch(typeof formatterParams.width){\r\n\t\tcase \"number\":\r\n\t\t\tel.style.width = formatterParams.width + \"px\";\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"string\":\r\n\t\t\tel.style.width = formatterParams.width;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tel.addEventListener(\"load\", function(){\r\n\t\tcell.getRow().normalizeHeight();\r\n\t});\r\n\r\n\treturn el;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tempty = formatterParams.allowEmpty,\r\n\ttruthy = formatterParams.allowTruthy,\r\n\ttrueValueSet = Object.keys(formatterParams).includes(\"trueValue\"),\r\n\ttick = typeof formatterParams.tickElement !== \"undefined\" ? formatterParams.tickElement : '',\r\n\tcross = typeof formatterParams.crossElement !== \"undefined\" ? formatterParams.crossElement : '';\r\n\r\n\tif((trueValueSet && value === formatterParams.trueValue) || (!trueValueSet && ((truthy && value) || (value === true || value === \"true\" || value === \"True\" || value === 1 || value === \"1\")))){\r\n\t\telement.setAttribute(\"aria-checked\", true);\r\n\t\treturn tick || \"\";\r\n\t}else{\r\n\t\tif(empty && (value === \"null\" || value === \"\" || value === null || typeof value === \"undefined\")){\r\n\t\t\telement.setAttribute(\"aria-checked\", \"mixed\");\r\n\t\t\treturn \"\";\r\n\t\t}else{\r\n\t\t\telement.setAttribute(\"aria-checked\", false);\r\n\t\t\treturn cross || \"\";\r\n\t\t}\r\n\t}\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar\toutputFormat = formatterParams.outputFormat || \"dd/MM/yyyy HH:mm:ss\";\r\n\tvar\tinvalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif(newDatetime.isValid){\r\n\t\t\tif(formatterParams.timezone){\r\n\t\t\t\tnewDatetime = newDatetime.setZone(formatterParams.timezone);\r\n\t\t\t}\r\n\r\n\t\t\treturn newDatetime.toFormat(outputFormat);\r\n\t\t}else{\r\n\t\t\tif(invalid === true || !value){\r\n\t\t\t\treturn value;\r\n\t\t\t}else if(typeof invalid === \"function\"){\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t}else{\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetime' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar inputFormat = formatterParams.inputFormat || \"yyyy-MM-dd HH:mm:ss\";\r\n\tvar invalid = typeof formatterParams.invalidPlaceholder !== \"undefined\" ? formatterParams.invalidPlaceholder : \"\";\r\n\tvar suffix = typeof formatterParams.suffix !== \"undefined\" ? formatterParams.suffix : false;\r\n\tvar unit = typeof formatterParams.unit !== \"undefined\" ? formatterParams.unit : \"days\";\r\n\tvar humanize = typeof formatterParams.humanize !== \"undefined\" ? formatterParams.humanize : false;\r\n\tvar date = typeof formatterParams.date !== \"undefined\" ? formatterParams.date : DT.now();\r\n\tvar value = cell.getValue();\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tvar newDatetime;\r\n\r\n\t\tif(DT.isDateTime(value)){\r\n\t\t\tnewDatetime = value;\r\n\t\t}else if(inputFormat === \"iso\"){\r\n\t\t\tnewDatetime = DT.fromISO(String(value));\r\n\t\t}else{\r\n\t\t\tnewDatetime = DT.fromFormat(String(value), inputFormat);\r\n\t\t}\r\n\r\n\t\tif (newDatetime.isValid){\r\n\t\t\tif(humanize){\r\n\t\t\t\treturn newDatetime.diff(date, unit).toHuman() + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}else{\r\n\t\t\t\treturn parseInt(newDatetime.diff(date, unit)[unit]) + (suffix ? \" \" + suffix : \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\tif (invalid === true) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else if (typeof invalid === \"function\") {\r\n\t\t\t\treturn invalid(value);\r\n\t\t\t} else {\r\n\t\t\t\treturn invalid;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tconsole.error(\"Format Error - 'datetimediff' formatter is dependant on luxon.js\");\r\n\t}\r\n}","export default function (cell, formatterParams, onRendered) {\r\n\tvar value = cell.getValue();\r\n\r\n\tif (typeof formatterParams[value] === \"undefined\") {\r\n\t\tconsole.warn('Missing display value for ' + value);\r\n\t\treturn value;\r\n\t}\r\n\r\n\treturn formatterParams[value];\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = cell.getValue(),\r\n\telement = cell.getElement(),\r\n\tmaxStars = formatterParams && formatterParams.stars ? formatterParams.stars : 5,\r\n\tstars = document.createElement(\"span\"),\r\n\tstar = document.createElementNS('http://www.w3.org/2000/svg', \"svg\"),\r\n\tstarActive = '',\r\n\tstarInactive = '';\r\n\r\n\t//style stars holder\r\n\tstars.style.verticalAlign = \"middle\";\r\n\r\n\t//style star\r\n\tstar.setAttribute(\"width\", \"14\");\r\n\tstar.setAttribute(\"height\", \"14\");\r\n\tstar.setAttribute(\"viewBox\", \"0 0 512 512\");\r\n\tstar.setAttribute(\"xml:space\", \"preserve\");\r\n\tstar.style.padding = \"0 1px\";\r\n\r\n\tvalue = value && !isNaN(value) ? parseInt(value) : 0;\r\n\r\n\tvalue = Math.max(0, Math.min(value, maxStars));\r\n\r\n\tfor(var i=1;i<= maxStars;i++){\r\n\t\tvar nextStar = star.cloneNode(true);\r\n\t\tnextStar.innerHTML = i <= value ? starActive : starInactive;\r\n\r\n\t\tstars.appendChild(nextStar);\r\n\t}\r\n\r\n\telement.style.whiteSpace = \"nowrap\";\r\n\telement.style.overflow = \"hidden\";\r\n\telement.style.textOverflow = \"ellipsis\";\r\n\r\n\telement.setAttribute(\"aria-label\", value);\r\n\r\n\treturn stars;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\tel = document.createElement(\"span\"),\r\n\tmax = formatterParams && formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams && formatterParams.min ? formatterParams.min : 0,\r\n\tcolors = formatterParams && typeof formatterParams.color !== \"undefined\" ? formatterParams.color : [\"red\", \"orange\", \"green\"],\r\n\tcolor = \"#666666\",\r\n\tpercent, percentValue;\r\n\r\n\tif(isNaN(value) || typeof cell.getValue() === \"undefined\"){\r\n\t\treturn;\r\n\t}\r\n\r\n\tel.classList.add(\"tabulator-traffic-light\");\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set color\r\n\tswitch(typeof colors){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = colors;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = colors(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(colors)){\r\n\t\t\t\tvar unit = 100 / colors.length;\r\n\t\t\t\tvar index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, colors.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = colors[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t}\r\n\r\n\tel.style.backgroundColor = color;\r\n\r\n\treturn el;\r\n}","import CellComponent from '../../../../core/cell/CellComponent.js';\r\n\r\nexport default function(cell, formatterParams = {}, onRendered){ //progress bar\r\n\tvar value = this.sanitizeHTML(cell.getValue()) || 0,\r\n\telement = cell.getElement(),\r\n\tmax = formatterParams.max ? formatterParams.max : 100,\r\n\tmin = formatterParams.min ? formatterParams.min : 0,\r\n\tlegendAlign = formatterParams.legendAlign ? formatterParams.legendAlign : \"center\",\r\n\tpercent, percentValue, color, legend, legendColor;\r\n\r\n\t//make sure value is in range\r\n\tpercentValue = parseFloat(value) <= max ? parseFloat(value) : max;\r\n\tpercentValue = parseFloat(percentValue) >= min ? parseFloat(percentValue) : min;\r\n\r\n\t//workout percentage\r\n\tpercent = (max - min) / 100;\r\n\tpercentValue = Math.round((percentValue - min) / percent);\r\n\r\n\t//set bar color\r\n\tswitch(typeof formatterParams.color){\r\n\t\tcase \"string\":\r\n\t\t\tcolor = formatterParams.color;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tcolor = formatterParams.color(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.color)){\r\n\t\t\t\tlet unit = 100 / formatterParams.color.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.color.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tcolor = formatterParams.color[index];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\tdefault:\r\n\t\t\tcolor = \"#2DC214\";\r\n\t}\r\n\r\n\t//generate legend\r\n\tswitch(typeof formatterParams.legend){\r\n\t\tcase \"string\":\r\n\t\t\tlegend = formatterParams.legend;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegend = formatterParams.legend(value);\r\n\t\t\tbreak;\r\n\t\tcase \"boolean\":\r\n\t\t\tlegend = value;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegend = false;\r\n\t}\r\n\r\n\t//set legend color\r\n\tswitch(typeof formatterParams.legendColor){\r\n\t\tcase \"string\":\r\n\t\t\tlegendColor = formatterParams.legendColor;\r\n\t\t\tbreak;\r\n\t\tcase \"function\":\r\n\t\t\tlegendColor = formatterParams.legendColor(value);\r\n\t\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\tif(Array.isArray(formatterParams.legendColor)){\r\n\t\t\t\tlet unit = 100 / formatterParams.legendColor.length;\r\n\t\t\t\tlet index = Math.floor(percentValue / unit);\r\n\r\n\t\t\t\tindex = Math.min(index, formatterParams.legendColor.length - 1);\r\n\t\t\t\tindex = Math.max(index, 0);\r\n\t\t\t\tlegendColor = formatterParams.legendColor[index];\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tlegendColor = \"#000\";\r\n\t}\r\n\r\n\telement.style.minWidth = \"30px\";\r\n\telement.style.position = \"relative\";\r\n\r\n\telement.setAttribute(\"aria-label\", percentValue);\r\n\r\n\tvar barEl = document.createElement(\"div\");\r\n\tbarEl.style.display = \"inline-block\";\r\n\tbarEl.style.width = percentValue + \"%\";\r\n\tbarEl.style.backgroundColor = color;\r\n\tbarEl.style.height = \"100%\";\r\n\r\n\tbarEl.setAttribute('data-max', max);\r\n\tbarEl.setAttribute('data-min', min);\r\n\r\n\tvar barContainer = document.createElement(\"div\");\r\n\tbarContainer.style.position = \"relative\";\r\n\tbarContainer.style.width = \"100%\";\r\n\tbarContainer.style.height = \"100%\";\r\n\r\n\tif(legend){\r\n\t\tvar legendEl = document.createElement(\"div\");\r\n\t\tlegendEl.style.position = \"absolute\";\r\n\t\tlegendEl.style.top = 0;\r\n\t\tlegendEl.style.left = 0;\r\n\t\tlegendEl.style.textAlign = legendAlign;\r\n\t\tlegendEl.style.width = \"100%\";\r\n\t\tlegendEl.style.color = legendColor;\r\n\t\tlegendEl.innerHTML = legend;\r\n\t}\r\n\r\n\tonRendered(function(){\r\n\r\n\t\t//handle custom element needed if formatter is to be included in printed/downloaded output\r\n\t\tif(!(cell instanceof CellComponent)){\r\n\t\t\tvar holderEl = document.createElement(\"div\");\r\n\t\t\tholderEl.style.position = \"absolute\";\r\n\t\t\tholderEl.style.top = \"4px\";\r\n\t\t\tholderEl.style.bottom = \"4px\";\r\n\t\t\tholderEl.style.left = \"4px\";\r\n\t\t\tholderEl.style.right = \"4px\";\r\n\r\n\t\t\telement.appendChild(holderEl);\r\n\r\n\t\t\telement = holderEl;\r\n\t\t}\r\n\r\n\t\telement.appendChild(barContainer);\r\n\t\tbarContainer.appendChild(barEl);\r\n\r\n\t\tif(legend){\r\n\t\t\tbarContainer.appendChild(legendEl);\r\n\t\t}\r\n\t});\r\n\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().style.backgroundColor = this.sanitizeHTML(cell.getValue());\r\n\treturn \"\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\treturn '';\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar content = document.createElement(\"span\");\r\n\tvar row = cell.getRow();\r\n\r\n\trow.watchPosition((position) => {\r\n\t\tcontent.innerText = position;\r\n\t});\r\n\t\r\n\treturn content;\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\treturn \"
\";\r\n}","export default function(cell, formatterParams, onRendered){\r\n\tvar el = document.createElement(\"div\"),\r\n\tconfig = cell.getRow()._row.modules.responsiveLayout;\r\n\r\n\tel.classList.add(\"tabulator-responsive-collapse-toggle\");\r\n\tel.innerHTML = \"+-\";\r\n\r\n\tcell.getElement().classList.add(\"tabulator-row-handle\");\r\n\r\n\tfunction toggleList(isOpen){\r\n\t\tvar collapseEl = config.element;\r\n\r\n\t\tconfig.open = isOpen;\r\n\r\n\t\tif(collapseEl){\r\n\r\n\t\t\tif(config.open){\r\n\t\t\t\tel.classList.add(\"open\");\r\n\t\t\t\tcollapseEl.style.display = '';\r\n\t\t\t}else{\r\n\t\t\t\tel.classList.remove(\"open\");\r\n\t\t\t\tcollapseEl.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tel.addEventListener(\"click\", function(e){\r\n\t\te.stopImmediatePropagation();\r\n\t\ttoggleList(!config.open);\r\n\t\tcell.getTable().rowManager.adjustTableSize();\r\n\t});\r\n\r\n\ttoggleList(config.open);\r\n\r\n\treturn el;\r\n}","import RowComponent from '../../../../core/row/RowComponent.js';\r\n\r\nexport default function(cell, formatterParams, onRendered){\r\n\tvar checkbox = document.createElement(\"input\");\r\n\tvar blocked = false;\r\n\r\n\tcheckbox.type = 'checkbox';\r\n\r\n\tcheckbox.setAttribute(\"aria-label\", \"Select Row\");\r\n\t\r\n\tif(this.table.modExists(\"selectRow\", true)){\r\n\r\n\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(typeof cell.getRow == 'function'){\r\n\t\t\tvar row = cell.getRow();\r\n\r\n\t\t\tif(row instanceof RowComponent){\r\n\r\n\t\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\t\tif(!blocked){\r\n\t\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tblocked = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trow.toggleSelect();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(this.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\tcheckbox.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\tblocked = true;\r\n\t\t\t\t\t\tthis.table.modules.selectRow.handleComplexRowClick(row._row, e);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcheckbox.checked = row.isSelected && row.isSelected();\r\n\t\t\t\tthis.table.modules.selectRow.registerRowSelectCheckbox(row, checkbox);\r\n\t\t\t}else{\r\n\t\t\t\tcheckbox = \"\";\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tcheckbox.addEventListener(\"change\", (e) => {\r\n\t\t\t\tif(this.table.modules.selectRow.selectedRows.length){\r\n\t\t\t\t\tthis.table.deselectRow();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis.table.selectRow(formatterParams.rowRange);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.modules.selectRow.registerHeaderSelectCheckbox(checkbox);\r\n\t\t}\r\n\t}\r\n\r\n\treturn checkbox;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultFormatters from './defaults/formatters.js';\r\n\r\nclass Format extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.registerColumnOption(\"formatter\");\r\n\t\tthis.registerColumnOption(\"formatterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"formatterPrint\");\r\n\t\tthis.registerColumnOption(\"formatterPrintParams\");\r\n\t\tthis.registerColumnOption(\"formatterClipboard\");\r\n\t\tthis.registerColumnOption(\"formatterClipboardParams\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutput\");\r\n\t\tthis.registerColumnOption(\"formatterHtmlOutputParams\");\r\n\t\tthis.registerColumnOption(\"titleFormatter\");\r\n\t\tthis.registerColumnOption(\"titleFormatterParams\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-format\", this.formatValue.bind(this));\r\n\t\tthis.subscribe(\"cell-rendered\", this.cellRendered.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-format\", this.formatHeader.bind(this));\r\n\t}\r\n\r\n\t//initialize column formatter\r\n\tinitializeColumn(column){\r\n\t\tcolumn.modules.format = this.lookupFormatter(column, \"\");\r\n\r\n\t\tif(typeof column.definition.formatterPrint !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.print = this.lookupFormatter(column, \"Print\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterClipboard !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.clipboard = this.lookupFormatter(column, \"Clipboard\");\r\n\t\t}\r\n\r\n\t\tif(typeof column.definition.formatterHtmlOutput !== \"undefined\"){\r\n\t\t\tcolumn.modules.format.htmlOutput = this.lookupFormatter(column, \"HtmlOutput\");\r\n\t\t}\r\n\t}\r\n\r\n\tlookupFormatter(column, type){\r\n\t\tvar config = {params:column.definition[\"formatter\" + type + \"Params\"] || {}},\r\n\t\tformatter = column.definition[\"formatter\" + type];\r\n\r\n\t\t//set column formatter\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tconfig.formatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tconfig.formatter = formatter;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfig.formatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn config;\r\n\t}\r\n\r\n\tcellRendered(cell){\r\n\t\tif(cell.modules.format && cell.modules.format.renderedCallback && !cell.modules.format.rendered){\r\n\t\t\tcell.modules.format.renderedCallback();\r\n\t\t\tcell.modules.format.rendered = true;\r\n\t\t}\r\n\t}\r\n\r\n\t//return a formatted value for a column header\r\n\tformatHeader(column, title, el){\r\n\t\tvar formatter, params, onRendered, mockCell;\r\n\r\n\t\tif(column.definition.titleFormatter){\r\n\t\t\tformatter = this.getFormatter(column.definition.titleFormatter);\r\n\r\n\t\t\tonRendered = (callback) => {\r\n\t\t\t\tcolumn.titleFormatterRendered = callback;\r\n\t\t\t};\r\n\r\n\t\t\tmockCell = {\r\n\t\t\t\tgetValue:function(){\r\n\t\t\t\t\treturn title;\r\n\t\t\t\t},\r\n\t\t\t\tgetElement:function(){\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tparams = column.definition.titleFormatterParams || {};\r\n\r\n\t\t\tparams = typeof params === \"function\" ? params() : params;\r\n\r\n\t\t\treturn formatter.call(this, mockCell, params, onRendered);\r\n\t\t}else{\r\n\t\t\treturn title;\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//return a formatted value for a cell\r\n\tformatValue(cell){\r\n\t\tvar component = cell.getComponent(),\r\n\t\tparams = typeof cell.column.modules.format.params === \"function\" ? cell.column.modules.format.params(component) : cell.column.modules.format.params;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\tif(!cell.modules.format){\r\n\t\t\t\tcell.modules.format = {};\r\n\t\t\t}\r\n\r\n\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\tcell.modules.format.rendered = false;\r\n\t\t}\r\n\r\n\t\treturn cell.column.modules.format.formatter.call(this, component, params, onRendered);\r\n\t}\r\n\r\n\tformatExportValue(cell, type){\r\n\t\tvar formatter = cell.column.modules.format[type],\r\n\t\tparams;\r\n\r\n\t\tif(formatter){\r\n\t\t\tparams = typeof formatter.params === \"function\" ? formatter.params(cell.getComponent()) : formatter.params;\r\n\r\n\t\t\tfunction onRendered(callback){\r\n\t\t\t\tif(!cell.modules.format){\r\n\t\t\t\t\tcell.modules.format = {};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcell.modules.format.renderedCallback = callback;\r\n\t\t\t\tcell.modules.format.rendered = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn formatter.formatter.call(this, cell.getComponent(), params, onRendered);\r\n\r\n\t\t}else{\r\n\t\t\treturn this.formatValue(cell);\r\n\t\t}\r\n\t}\r\n\r\n\tsanitizeHTML(value){\r\n\t\tif(value){\r\n\t\t\tvar entityMap = {\r\n\t\t\t\t'&': '&',\r\n\t\t\t\t'<': '<',\r\n\t\t\t\t'>': '>',\r\n\t\t\t\t'\"': '"',\r\n\t\t\t\t\"'\": ''',\r\n\t\t\t\t'/': '/',\r\n\t\t\t\t'`': '`',\r\n\t\t\t\t'=': '='\r\n\t\t\t};\r\n\r\n\t\t\treturn String(value).replace(/[&<>\"'`=/]/g, function (s) {\r\n\t\t\t\treturn entityMap[s];\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn value;\r\n\t\t}\r\n\t}\r\n\r\n\temptyToSpace(value){\r\n\t\treturn value === null || typeof value === \"undefined\" || value === \"\" ? \" \" : value;\r\n\t}\r\n\r\n\t//get formatter for cell\r\n\tgetFormatter(formatter){\r\n\t\tswitch(typeof formatter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Format.formatters[formatter]){\r\n\t\t\t\t\tformatter = Format.formatters[formatter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Formatter Error - No such formatter found: \", formatter);\r\n\t\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\t//Custom formatter Function, do nothing\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tformatter = Format.formatters.plaintext;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn formatter;\r\n\t}\r\n}\r\n\r\nFormat.moduleName = \"format\";\r\n\r\n//load defaults\r\nFormat.formatters = defaultFormatters;\r\n\r\nexport default Format;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightPadding = 0;\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.active = false;\r\n\t\tthis.blocked = true;\r\n\t\t\r\n\t\tthis.registerColumnOption(\"frozen\");\r\n\t}\r\n\t\r\n\t//reset initial state\r\n\treset(){\r\n\t\tthis.initializationMode = \"left\";\r\n\t\tthis.leftColumns = [];\r\n\t\tthis.rightColumns = [];\r\n\t\tthis.leftMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.rightMargin = 0;\r\n\t\tthis.active = false;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = 0;\r\n\t\tthis.table.columnManager.element.style.paddingRight = 0;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-layout\", this.layoutCell.bind(this));\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"column-width\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"row-layout-after\", this.layoutRow.bind(this));\r\n\t\tthis.subscribe(\"table-layout\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t\tthis.subscribe(\"columns-loading\", this.reset.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"column-add\", this.reinitializeColumns.bind(this));\r\n\t\tthis.subscribe(\"column-delete\", this.reinitializeColumns.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"table-redraw\", this.layout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshing\", this.blockLayout.bind(this));\r\n\t\tthis.subscribe(\"layout-refreshed\", this.unblockLayout.bind(this));\r\n\t}\r\n\t\r\n\tblockLayout(){\r\n\t\tthis.blocked = true;\r\n\t}\r\n\t\r\n\tunblockLayout(){\r\n\t\tthis.blocked = false;\r\n\t}\r\n\t\r\n\tlayoutCell(cell){\r\n\t\tthis.layoutElement(cell.element, cell.column);\r\n\t}\r\n\t\r\n\treinitializeColumns(){\r\n\t\tthis.reset();\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//initialize specific column\r\n\tinitializeColumn(column){\r\n\t\tvar config = {margin:0, edge:false};\r\n\t\t\r\n\t\tif(!column.isGroup){\r\n\t\t\t\r\n\t\t\tif(this.frozenCheck(column)){\r\n\t\t\t\t\r\n\t\t\t\tconfig.position = this.initializationMode;\r\n\t\t\t\t\r\n\t\t\t\tif(this.initializationMode == \"left\"){\r\n\t\t\t\t\tthis.leftColumns.push(column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.rightColumns.unshift(column);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.active = true;\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.frozen = config;\r\n\t\t\t}else{\r\n\t\t\t\tthis.initializationMode = \"right\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tfrozenCheck(column){\r\n\t\tif(column.parent.isGroup && column.definition.frozen){\r\n\t\t\tconsole.warn(\"Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups\");\r\n\t\t}\r\n\t\t\r\n\t\tif(column.parent.isGroup){\r\n\t\t\treturn this.frozenCheck(column.parent);\r\n\t\t}else{\r\n\t\t\treturn column.definition.frozen;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//quick layout to smooth horizontal scrolling\r\n\tscrollHorizontal(){\t\r\n\t\tif(this.active){\t\t\r\n\t\t\tthis.calcMargins(true);\r\n\t\t\t\r\n\t\t\tthis.layoutColumnPosition();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t\t\r\n\t\t\tthis.reinitializeRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//calculate margins for rows\r\n\tcalcMargins(scroll){\r\n\t\t\r\n\t\tif(!scroll){\r\n\t\t\tthis.leftMargin = this._calcSpace(this.leftColumns, this.leftColumns.length) + \"px\";\t\t\t\r\n\t\t\tthis.rightMargin = this._calcSpace(this.rightColumns, this.rightColumns.length) + \"px\";\t\r\n\t\t\tthis.table.rowManager.tableElement.style.marginRight = this.rightMargin;\r\n\t\t}\r\n\t\t\r\n\t\t//calculate right frozen columns\r\n\t\tthis.rightPadding = this.table.rowManager.element.clientWidth + this.table.columnManager.scrollLeft;\r\n\t}\r\n\t\r\n\t//layout calculation rows\r\n\tlayoutCalcRows(){\r\n\t\tif(this.table.modExists(\"columnCalcs\")){\r\n\t\t\tif(this.table.modules.columnCalcs.topInitialized && this.table.modules.columnCalcs.topRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.topRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modules.columnCalcs.botInitialized && this.table.modules.columnCalcs.botRow){\r\n\t\t\t\tthis.layoutRow(this.table.modules.columnCalcs.botRow);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.modExists(\"groupRows\")){\r\n\t\t\t\tthis.layoutGroupCalcs(this.table.modules.groupRows.getGroups());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutGroupCalcs(groups){\r\n\t\tgroups.forEach((group) => {\r\n\t\t\tif(group.calcs.top){\r\n\t\t\t\tthis.layoutRow(group.calcs.top);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.calcs.bottom){\r\n\t\t\t\tthis.layoutRow(group.calcs.bottom);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(group.groupList && group.groupList.length){\r\n\t\t\t\tthis.layoutGroupCalcs(group.groupList);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//calculate column positions and layout headers\r\n\tlayoutColumnPosition(allCells){\r\n\t\tvar leftParents = [];\r\n\t\t\r\n\t\tvar leftMargin = 0;\r\n\t\tvar rightMargin = 0;\r\n\t\t\r\n\t\tthis.table.columnManager.headersElement.style.marginLeft = this.leftMargin;\r\n\t\tthis.table.columnManager.element.style.paddingRight = this.rightMargin;\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column, i) => {\t\r\n\t\t\tcolumn.modules.frozen.marginValue = leftMargin + this.table.columnManager.scrollLeft;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tleftMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(i == this.leftColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tvar parentEl = this.getColGroupParentElement(column);\r\n\t\t\t\tif(!leftParents.includes(parentEl)){\r\n\t\t\t\t\tthis.layoutElement(parentEl, column);\r\n\t\t\t\t\tleftParents.push(parentEl);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\t\tparentEl.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column, i) => {\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\trightMargin += column.getWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.frozen.marginValue = this.rightPadding - rightMargin;\r\n\t\t\tcolumn.modules.frozen.margin = column.modules.frozen.marginValue + \"px\";\r\n\t\t\t\r\n\t\t\tif(i == this.rightColumns.length - 1){\r\n\t\t\t\tcolumn.modules.frozen.edge = true;\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.modules.frozen.edge = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(column.parent.isGroup){\r\n\t\t\t\tthis.layoutElement(this.getColGroupParentElement(column), column);\r\n\t\t\t}else{\r\n\t\t\t\tthis.layoutElement(column.getElement(), column);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(allCells){\r\n\t\t\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetColGroupParentElement(column){\r\n\t\treturn column.parent.isGroup ? this.getColGroupParentElement(column.parent) : column.getElement();\r\n\t}\r\n\t\r\n\t//layout columns appropriately\r\n\tlayout(){\t\r\n\t\tif(this.active && !this.blocked){\r\n\t\t\t//calculate row padding\r\n\t\t\tthis.calcMargins();\r\n\t\t\t\r\n\t\t\t//calculate left columns\r\n\t\t\tthis.layoutColumnPosition();\r\n\r\n\t\t\tthis.reinitializeRows();\r\n\t\t\t\r\n\t\t\tthis.layoutCalcRows();\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar visibleRows = this.table.rowManager.getVisibleRows(true);\r\n\t\tvar otherRows = this.table.rowManager.getRows().filter(row => !visibleRows.includes(row));\r\n\t\t\r\n\t\totherRows.forEach((row) =>{\r\n\t\t\trow.deinitialize();\r\n\t\t});\r\n\t\t\r\n\t\tvisibleRows.forEach((row) =>{\r\n\t\t\tif(row.type === \"row\"){\r\n\t\t\t\tthis.layoutRow(row);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutRow(row){\r\n\t\t// console.trace(\"row\")\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\trowEl.style.paddingLeft = this.leftMargin;\r\n\t\t\r\n\t\tif(this.table.options.layout === \"fitDataFill\" && this.rightColumns.length){\r\n\t\t\tthis.table.rowManager.getTableElement().style.minWidth = \"calc(100% - \" + this.rightMargin + \")\";\r\n\t\t}\r\n\t\t\r\n\t\tthis.leftColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.rightColumns.forEach((column) => {\r\n\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\r\n\t\t\tif(cell){\r\n\t\t\t\tthis.layoutElement(cell.getElement(true), column);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tlayoutElement(element, column){\r\n\t\t\r\n\t\tif(column.modules.frozen){\r\n\t\t\telement.style.position = \"absolute\";\r\n\t\t\telement.style.left = column.modules.frozen.margin;\r\n\t\t\t\r\n\t\t\telement.classList.add(\"tabulator-frozen\");\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen.edge){\r\n\t\t\t\telement.classList.add(\"tabulator-frozen-\" + column.modules.frozen.position);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_calcSpace(columns, index){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tfor (let i = 0; i < index; i++){\r\n\t\t\tif(columns[i].visible){\r\n\t\t\t\twidth += columns[i].getWidth();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n}\r\n\r\nFrozenColumns.moduleName = \"frozenColumns\";\r\n\r\nexport default FrozenColumns;","import Module from '../../core/Module.js';\r\n\r\nclass FrozenRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.topElement = document.createElement(\"div\");\r\n\t\tthis.rows = [];\r\n\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"freeze\", this.freezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"unfreeze\", this.unfreezeRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isFrozen\", this.isRowFrozen.bind(this));\r\n\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"frozenRowsField\", \"id\"); //field to choose frozen rows by\r\n\t\tthis.registerTableOption(\"frozenRows\", false); //holder for frozen row identifiers\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.rows = [];\r\n\r\n\t\tthis.topElement.classList.add(\"tabulator-frozen-rows-holder\");\r\n\r\n\t\t// this.table.columnManager.element.append(this.topElement);\r\n\t\tthis.table.columnManager.getElement().insertBefore(this.topElement, this.table.columnManager.headersElement.nextSibling);\r\n\r\n\t\tthis.subscribe(\"row-deleting\", this.detachRow.bind(this));\r\n\t\tthis.subscribe(\"rows-visible\", this.visibleRows.bind(this));\r\n\r\n\t\tthis.registerDisplayHandler(this.getRows.bind(this), 10);\r\n\r\n\t\tif(this.table.options.frozenRows){\r\n\t\t\tthis.subscribe(\"data-processed\", this.initializeRows.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRows(){\r\n\t\tthis.table.rowManager.getRows().forEach((row) => {\r\n\t\t\tthis.initializeRow(row);\r\n\t\t});\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar frozenRows = this.table.options.frozenRows,\r\n\t\trowType = typeof frozenRows;\r\n\r\n\t\tif(rowType === \"number\"){\r\n\t\t\tif(row.getPosition() && (row.getPosition() + this.rows.length) <= frozenRows){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(rowType === \"function\"){\r\n\t\t\tif(frozenRows.call(this.table, row.getComponent())){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(frozenRows)){\r\n\t\t\tif(frozenRows.includes(row.data[this.options(\"frozenRowsField\")])){\r\n\t\t\t\tthis.freezeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tisRowFrozen(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\treturn index > -1;\r\n\t}\r\n\r\n\tisFrozen(){\r\n\t\treturn !!this.rows.length;\r\n\t}\r\n\r\n\tvisibleRows(viewable, rows){\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trows.push(row);\r\n\t\t});\r\n\r\n\t\treturn rows;\r\n\t}\r\n\r\n\t//filter frozen rows out of display data\r\n\tgetRows(rows){\r\n\t\tvar output = rows.slice(0);\r\n\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tvar index = output.indexOf(row);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\toutput.splice(index, 1);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tfreezeRow(row){\r\n\t\tif(!row.modules.frozen){\r\n\t\t\trow.modules.frozen = true;\r\n\t\t\tthis.topElement.appendChild(row.getElement());\r\n\t\t\trow.initialize();\r\n\t\t\trow.normalizeHeight();\r\n\t\t\r\n\t\t\tthis.rows.push(row);\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.styleRows();\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already frozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tunfreezeRow(row){\r\n\t\tif(row.modules.frozen){\r\n\r\n\t\t\trow.modules.frozen = false;\r\n\r\n\t\t\tthis.detachRow(row);\r\n\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\r\n\t\t\tthis.refreshData(false, \"display\");\r\n\r\n\t\t\tif(this.rows.length){\r\n\t\t\t\tthis.styleRows();\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Freeze Error - Row is already unfrozen\");\r\n\t\t}\r\n\t}\r\n\r\n\tdetachRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstyleRows(row){\r\n\t\tthis.rows.forEach((row, i) => {\r\n\t\t\tthis.table.rowManager.styleRow(row, i);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nFrozenRows.moduleName = \"frozenRows\";\r\n\r\nexport default FrozenRows;","//public group object\r\nclass GroupComponent {\r\n\tconstructor (group){\r\n\t\tthis._group = group;\r\n\t\tthis.type = \"GroupComponent\";\r\n\r\n\t\treturn new Proxy(this, {\r\n\t\t\tget: function(target, name, receiver) {\r\n\t\t\t\tif (typeof target[name] !== \"undefined\") {\r\n\t\t\t\t\treturn target[name];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn target._group.groupManager.table.componentFunctionBinder.handle(\"row\", target._group, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tgetKey(){\r\n\t\treturn this._group.key;\r\n\t}\r\n\r\n\tgetField(){\r\n\t\treturn this._group.field;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this._group.element;\r\n\t}\r\n\r\n\tgetRows(){\r\n\t\treturn this._group.getRows(true);\r\n\t}\r\n\r\n\tgetSubGroups(){\r\n\t\treturn this._group.getSubGroups(true);\r\n\t}\r\n\r\n\tgetParentGroup(){\r\n\t\treturn this._group.parent ? this._group.parent.getComponent() : false;\r\n\t}\r\n\r\n\tisVisible(){\r\n\t\treturn this._group._visible;\r\n\t}\r\n\r\n\tshow(){\r\n\t\tthis._group.show();\r\n\t}\r\n\r\n\thide(){\r\n\t\tthis._group.hide();\r\n\t}\r\n\r\n\ttoggle(){\r\n\t\tthis._group.toggleVisibility();\r\n\t}\r\n\r\n\t_getSelf(){\r\n\t\treturn this._group;\r\n\t}\r\n\r\n\tgetTable(){\r\n\t\treturn this._group.groupManager.table;\r\n\t}\r\n}\r\n\r\nexport default GroupComponent;","import Helpers from '../../core/tools/Helpers.js';\r\nimport GroupComponent from './GroupComponent.js';\r\n\r\n//Group functions\r\nclass Group{\r\n\t\r\n\tconstructor(groupManager, parent, level, key, field, generator, oldGroup){\r\n\t\tthis.groupManager = groupManager;\r\n\t\tthis.parent = parent;\r\n\t\tthis.key = key;\r\n\t\tthis.level = level;\r\n\t\tthis.field = field;\r\n\t\tthis.hasSubGroups = level < (groupManager.groupIDLookups.length - 1);\r\n\t\tthis.addRow = this.hasSubGroups ? this._addRowToGroup : this._addRow;\r\n\t\tthis.type = \"group\"; //type of element\r\n\t\tthis.old = oldGroup;\r\n\t\tthis.rows = [];\r\n\t\tthis.groups = [];\r\n\t\tthis.groupList = [];\r\n\t\tthis.generator = generator;\r\n\t\tthis.element = false;\r\n\t\tthis.elementContents = false;\r\n\t\tthis.height = 0;\r\n\t\tthis.outerHeight = 0;\r\n\t\tthis.initialized = false;\r\n\t\tthis.calcs = {};\r\n\t\tthis.initialized = false;\r\n\t\tthis.modules = {};\r\n\t\tthis.arrowElement = false;\r\n\t\t\r\n\t\tthis.visible = oldGroup ? oldGroup.visible : (typeof groupManager.startOpen[level] !== \"undefined\" ? groupManager.startOpen[level] : groupManager.startOpen[0]);\r\n\t\t\r\n\t\tthis.component = null;\r\n\t\t\r\n\t\tthis.createElements();\r\n\t\tthis.addBindings();\r\n\t\t\r\n\t\tthis.createValueGroups();\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\tif(row.modules){\r\n\t\t\t\t\tdelete row.modules.group;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tthis.element = false;\r\n\t\tthis.arrowElement = false;\r\n\t\tthis.elementContents = false;\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar arrow = document.createElement(\"div\");\r\n\t\tarrow.classList.add(\"tabulator-arrow\");\r\n\t\t\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-row\");\r\n\t\tthis.element.classList.add(\"tabulator-group\");\r\n\t\tthis.element.classList.add(\"tabulator-group-level-\" + this.level);\r\n\t\tthis.element.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tthis.arrowElement = document.createElement(\"div\");\r\n\t\tthis.arrowElement.classList.add(\"tabulator-group-toggle\");\r\n\t\tthis.arrowElement.appendChild(arrow);\r\n\t\t\r\n\t\t//setup movable rows\r\n\t\tif(this.groupManager.table.options.movableRows !== false && this.groupManager.table.modExists(\"moveRow\")){\r\n\t\t\tthis.groupManager.table.modules.moveRow.initializeGroupHeader(this);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateValueGroups(){\r\n\t\tvar level = this.level + 1;\r\n\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\tthis.groupManager.allowedValues[level].forEach((value) => {\r\n\t\t\t\tthis._createGroup(value, level);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\taddBindings(){\r\n\t\tvar toggleElement;\r\n\t\t\r\n\t\tif(this.groupManager.table.options.groupToggleElement){\r\n\t\t\ttoggleElement = this.groupManager.table.options.groupToggleElement == \"arrow\" ? this.arrowElement : this.element;\r\n\t\t\t\r\n\t\t\ttoggleElement.addEventListener(\"click\", (e) => {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.stopImmediatePropagation();\r\n\t\t\t\tthis.toggleVisibility();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t_createGroup(groupID, level){\r\n\t\tvar groupKey = level + \"_\" + groupID;\r\n\t\tvar group = new Group(this.groupManager, this, level, groupID, this.groupManager.groupIDLookups[level].field, this.groupManager.headerGenerator[level] || this.groupManager.headerGenerator[0], this.old ? this.old.groups[groupKey] : false);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\t_addRowToGroup(row){\r\n\t\t\r\n\t\tvar level = this.level + 1;\r\n\t\t\r\n\t\tif(this.hasSubGroups){\r\n\t\t\tvar groupID = this.groupManager.groupIDLookups[level].func(row.getData()),\r\n\t\t\tgroupKey = level + \"_\" + groupID;\r\n\t\t\t\r\n\t\t\tif(this.groupManager.allowedValues && this.groupManager.allowedValues[level]){\r\n\t\t\t\tif(this.groups[groupKey]){\r\n\t\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(!this.groups[groupKey]){\r\n\t\t\t\t\tthis._createGroup(groupID, level);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t_addRow(row){\r\n\t\tthis.rows.push(row);\r\n\t\trow.modules.group = this;\r\n\t}\r\n\t\r\n\tinsertRow(row, to, after){\r\n\t\tvar data = this.conformRowData({});\r\n\t\t\r\n\t\trow.updateData(data);\r\n\t\t\r\n\t\tvar toIndex = this.rows.indexOf(to);\r\n\t\t\r\n\t\tif(toIndex > -1){\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.splice(toIndex+1, 0, row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.splice(toIndex, 0, row);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(after){\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\trow.modules.group = this;\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.updateGroupRows(true);\r\n\t}\r\n\t\r\n\tscrollHeader(left){\r\n\t\tif(this.arrowElement){\r\n\t\t\tthis.arrowElement.style.marginLeft = left;\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach(function(child){\r\n\t\t\t\tchild.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowIndex(row){}\r\n\t\r\n\t//update row data to match grouping constraints\r\n\tconformRowData(data){\r\n\t\tif(this.field){\r\n\t\t\tdata[this.field] = this.key;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Data Conforming Error - Cannot conform row data to match new group as groupBy is a function\");\r\n\t\t}\r\n\t\t\r\n\t\tif(this.parent){\r\n\t\t\tdata = this.parent.conformRowData(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tremoveRow(row){\r\n\t\tvar index = this.rows.indexOf(row);\r\n\t\tvar el = row.getElement();\r\n\t\t\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.rows.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.groupManager.table.options.groupValues && !this.rows.length){\r\n\t\t\tif(this.parent){\r\n\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t}else{\r\n\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(el.parentNode){\r\n\t\t\t\tel.parentNode.removeChild(el);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.generateGroupHeaderContents();\r\n\t\t\t\r\n\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\tthis.groupManager.table.modules.columnCalcs.recalcGroup(this);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!this.groupList.length){\r\n\t\t\t\tif(this.parent){\r\n\t\t\t\t\tthis.parent.removeGroup(this);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.groupManager.removeGroup(this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetHeadersAndRows(noCalc){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\toutput.push(this);\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\t\toutput = output.concat(group.getHeadersAndRows(noCalc));\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\toutput = output.concat(this.rows);\r\n\t\t\t\t\r\n\t\t\t\tif(!noCalc && this.groupManager.table.options.columnCalcs != \"table\" && this.groupManager.table.modExists(\"columnCalcs\") && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.groupList.length && this.groupManager.table.options.columnCalcs != \"table\"){\r\n\t\t\t\t\r\n\t\t\t\tif(this.groupManager.table.modExists(\"columnCalcs\")){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasTopCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.top){\r\n\t\t\t\t\t\t\tthis.calcs.top.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.top.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.top = this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!noCalc && this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){\r\n\t\t\t\t\t\tif(this.calcs.bottom){\r\n\t\t\t\t\t\t\tthis.calcs.bottom.detachElement();\r\n\t\t\t\t\t\t\tthis.calcs.bottom.deleteCells();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.groupManager.table.options.groupClosedShowCalcs){\r\n\t\t\t\t\t\t\tthis.calcs.bottom = this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);\r\n\t\t\t\t\t\t\toutput.push(this.calcs.bottom);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetData(visible, transform){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(!visible || (visible && this.visible)){\r\n\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRowCount(){\r\n\t\tvar count = 0;\r\n\t\t\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tcount += group.getRowCount();\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcount = this.rows.length;\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n\t\r\n\ttoggleVisibility(){\r\n\t\tif(this.visible){\r\n\t\t\tthis.hide();\r\n\t\t}else{\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}\r\n\t\r\n\thide(){\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\trow.detachElement();\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), false);\r\n\t}\r\n\t\r\n\tshow(){\r\n\t\tthis.visible = true;\r\n\t\t\r\n\t\tif(this.groupManager.table.rowManager.getRenderMode() == \"basic\" && !this.groupManager.table.options.pagination){\r\n\t\t\t\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t\t\r\n\t\t\tvar prev = this.generateElement();\r\n\t\t\t\r\n\t\t\tif(this.groupList.length){\r\n\t\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\t\tvar rows = group.getHeadersAndRows();\r\n\t\t\t\t\t\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\t\trow.initialize();\r\n\t\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.rows.forEach((row) => {\r\n\t\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\t\tprev.parentNode.insertBefore(rowEl, prev.nextSibling);\r\n\t\t\t\t\trow.initialize();\r\n\t\t\t\t\tprev = rowEl;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}else{\r\n\t\t\tthis.groupManager.updateGroupRows(true);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupManager.table.externalEvents.dispatch(\"groupVisibilityChanged\", this.getComponent(), true);\r\n\t}\r\n\t\r\n\t_visSet(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tif(typeof this.visible == \"function\"){\r\n\t\t\t\r\n\t\t\tthis.rows.forEach(function(row){\r\n\t\t\t\tdata.push(row.getData());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.visible = this.visible(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\tif(this.groupList.length){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\t\r\n\t\t\t\tif(result){\r\n\t\t\t\t\tmatch = result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(this.rows.find(function(item){\r\n\t\t\t\treturn item === row;\r\n\t\t\t})){\r\n\t\t\t\tmatch = this;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tgetSubGroups(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(child){\r\n\t\t\toutput.push(component ? child.getComponent() : child);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetRows(component){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\toutput.push(component ? row.getComponent() : row);\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgenerateGroupHeaderContents(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\tthis.elementContents = this.generator(this.key, this.getRowCount(), data, this.getComponent());\r\n\t\t\r\n\t\twhile(this.element.firstChild) this.element.removeChild(this.element.firstChild);\r\n\t\t\r\n\t\tif(typeof this.elementContents === \"string\"){\r\n\t\t\tthis.element.innerHTML = this.elementContents;\r\n\t\t}else{\r\n\t\t\tthis.element.appendChild(this.elementContents);\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.insertBefore(this.arrowElement, this.element.firstChild);\r\n\t}\r\n\t\r\n\tgetPath(path = []) {\r\n\t\tpath.unshift(this.key);\r\n\t\tif(this.parent) {\r\n\t\t\tthis.parent.getPath(path);\r\n\t\t}\r\n\t\treturn path;\r\n\t}\r\n\t\r\n\t////////////// Standard Row Functions //////////////\r\n\t\r\n\tgetElement(){\r\n\t\treturn this.elementContents ? this.element : this.generateElement();\r\n\t}\r\n\t\r\n\tgenerateElement(){\r\n\t\tthis.addBindings = false;\r\n\t\t\r\n\t\tthis._visSet();\r\n\t\t\r\n\t\tif(this.visible){\r\n\t\t\tthis.element.classList.add(\"tabulator-group-visible\");\r\n\t\t}else{\r\n\t\t\tthis.element.classList.remove(\"tabulator-group-visible\");\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i = 0; i < this.element.childNodes.length; ++i){\r\n\t\t\tthis.element.childNodes[i].parentNode.removeChild(this.element.childNodes[i]);\r\n\t\t}\r\n\t\t\r\n\t\tthis.generateGroupHeaderContents();\r\n\t\t\r\n\t\t// this.addBindings();\r\n\t\t\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\tdetachElement(){\r\n\t\tif (this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize the height of elements in the row\r\n\tnormalizeHeight(){\r\n\t\tthis.setHeight(this.element.clientHeight);\r\n\t}\r\n\t\r\n\tinitialize(force){\r\n\t\tif(!this.initialized || force){\r\n\t\t\tthis.normalizeHeight();\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitialize(){\r\n\t\tthis.initialized = false;\r\n\t\tthis.height = 0;\r\n\t\t\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.initialize(true);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tif(this.height != height){\r\n\t\t\tthis.height = height;\r\n\t\t\tthis.outerHeight = this.element.offsetHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return rows outer height\r\n\tgetHeight(){\r\n\t\treturn this.outerHeight;\r\n\t}\r\n\t\r\n\tgetGroup(){\r\n\t\treturn this;\r\n\t}\r\n\t\r\n\treinitializeHeight(){}\r\n\t\r\n\tcalcHeight(){}\r\n\t\r\n\tsetCellHeight(){}\r\n\t\r\n\tclearCellHeight(){}\r\n\t\r\n\tdeinitializeHeight(){}\r\n\t\r\n\t//////////////// Object Generation /////////////////\r\n\tgetComponent(){\r\n\t\tif(!this.component){\r\n\t\t\tthis.component = new GroupComponent(this);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.component;\r\n\t}\r\n}\r\n\r\nexport default Group;","import Module from '../../core/Module.js';\r\n\r\nimport Group from './Group.js';\r\n\r\nclass GroupRows extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.groupIDLookups = false; //enable table grouping and set field to group by\r\n\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\tthis.groupList = []; //ordered list of groups\r\n\t\tthis.allowedValues = false;\r\n\t\tthis.groups = {}; //hold row groups\r\n\t\t\r\n\t\tthis.displayHandler = this.getRows.bind(this);\r\n\t\t\r\n\t\t//register table options\r\n\t\tthis.registerTableOption(\"groupBy\", false); //enable table grouping and set field to group by\r\n\t\tthis.registerTableOption(\"groupStartOpen\", true); //starting state of group\r\n\t\tthis.registerTableOption(\"groupValues\", false);\r\n\t\tthis.registerTableOption(\"groupUpdateOnCellEdit\", false);\r\n\t\tthis.registerTableOption(\"groupHeader\", false); //header generation function\r\n\t\tthis.registerTableOption(\"groupHeaderPrint\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderClipboard\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderHtmlOutput\", null);\r\n\t\tthis.registerTableOption(\"groupHeaderDownload\", null);\r\n\t\tthis.registerTableOption(\"groupToggleElement\", \"arrow\");\r\n\t\tthis.registerTableOption(\"groupClosedShowCalcs\", false);\r\n\t\t\r\n\t\t//register table functions\r\n\t\tthis.registerTableFunction(\"setGroupBy\", this.setGroupBy.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupValues\", this.setGroupValues.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupStartOpen\", this.setGroupStartOpen.bind(this));\r\n\t\tthis.registerTableFunction(\"setGroupHeader\", this.setGroupHeader.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroups\", this.userGetGroups.bind(this));\r\n\t\tthis.registerTableFunction(\"getGroupedData\", this.userGetGroupedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"getGroup\", this.rowGetGroup.bind(this));\r\n\t}\r\n\t\r\n\t//initialize group configuration\r\n\tinitialize(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.groupUpdateOnCellEdit){\r\n\t\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.reassignRowToGroup.bind(this), 0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-built\", this.configureGroupSetup.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleting.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHeaders.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.wipe.bind(this));\r\n\t\t\tthis.subscribe(\"rows-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-moving\", this.rowMoving.bind(this));\r\n\t\t\tthis.subscribe(\"row-adding-index\", this.rowAddingIndex.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"rows-sample\", this.rowSample.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"render-virtual-fill\", this.virtualRenderFill.bind(this));\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.displayHandler, 20);\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tconfigureGroupSetup(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar groupBy = this.table.options.groupBy,\r\n\t\t\tstartOpen = this.table.options.groupStartOpen,\r\n\t\t\tgroupHeader = this.table.options.groupHeader;\r\n\t\t\t\r\n\t\t\tthis.allowedValues = this.table.options.groupValues;\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy) && Array.isArray(groupHeader) && groupBy.length > groupHeader.length){\r\n\t\t\t\tconsole.warn(\"Error creating group headers, groupHeader array is shorter than groupBy array\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.headerGenerator = [function(){return \"\";}];\r\n\t\t\tthis.startOpen = [function(){return false;}]; //starting state of group\r\n\t\t\t\r\n\t\t\tthis.langBind(\"groups|item\", (langValue, lang) => {\r\n\t\t\t\tthis.headerGenerator[0] = (value, count, data) => { //header layout function\r\n\t\t\t\t\treturn (typeof value === \"undefined\" ? \"\" : value) + \"(\" + count + \" \" + ((count === 1) ? langValue : lang.groups.items) + \")\";\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.groupIDLookups = [];\r\n\t\t\t\r\n\t\t\tif(Array.isArray(groupBy)){\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"table\" && this.table.options.columnCalcs != \"both\"){\r\n\t\t\t\t\tthis.table.modules.columnCalcs.removeCalcs();\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.modExists(\"columnCalcs\") && this.table.options.columnCalcs != \"group\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar cols = this.table.columnManager.getRealColumns();\r\n\t\t\t\t\t\r\n\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\tif(col.definition.topCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeTopRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(col.definition.bottomCalc){\r\n\t\t\t\t\t\t\tthis.table.modules.columnCalcs.initializeBottomRow();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(groupBy)){\r\n\t\t\t\tgroupBy = [groupBy];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tgroupBy.forEach((group, i) => {\r\n\t\t\t\tvar lookupFunc, column;\r\n\t\t\t\t\r\n\t\t\t\tif(typeof group == \"function\"){\r\n\t\t\t\t\tlookupFunc = group;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolumn = this.table.columnManager.getColumnByField(group);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(column){\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn column.getFieldValue(data);\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tlookupFunc = function(data){\r\n\t\t\t\t\t\t\treturn data[group];\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.groupIDLookups.push({\r\n\t\t\t\t\tfield: typeof group === \"function\" ? false : group,\r\n\t\t\t\t\tfunc:lookupFunc,\r\n\t\t\t\t\tvalues:this.allowedValues ? this.allowedValues[i] : false,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(startOpen){\r\n\t\t\t\tif(!Array.isArray(startOpen)){\r\n\t\t\t\t\tstartOpen = [startOpen];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstartOpen.forEach((level) => {\r\n\t\t\t\t\tlevel = typeof level == \"function\" ? level : function(){return true;};\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.startOpen = startOpen;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(groupHeader){\r\n\t\t\t\tthis.headerGenerator = Array.isArray(groupHeader) ? groupHeader : [groupHeader];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.groupList = [];\r\n\t\t\tthis.groups = {};\r\n\t\t}\r\n\t}\r\n\t\r\n\trowSample(rows, prevValue){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tvar group = this.getGroups(false)[0];\r\n\t\t\t\r\n\t\t\tprevValue.push(group.getRows(false)[0]);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevValue;\r\n\t}\r\n\t\r\n\tvirtualRenderFill(){\r\n\t\tvar el = this.table.rowManager.tableElement;\r\n\t\tvar rows = this.table.rowManager.getVisibleRows();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\trows = rows.filter((row) => {\r\n\t\t\t\treturn row.type !== \"group\";\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tel.style.minWidth = !rows.length ? this.table.columnManager.getWidth() + \"px\" : \"\";\r\n\t\t}else{\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingIndex(row, index, top){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.assignRowToGroup(row);\r\n\t\t\t\r\n\t\t\tvar groupRows = row.modules.group.rows;\r\n\t\t\t\r\n\t\t\tif(groupRows.length > 1){\r\n\t\t\t\tif(!index || (index && groupRows.indexOf(index) == -1)){\r\n\t\t\t\t\tif(top){\r\n\t\t\t\t\t\tif(groupRows[0] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[0];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(groupRows[groupRows.length -1] !== row){\r\n\t\t\t\t\t\t\tindex = groupRows[groupRows.length -1];\r\n\t\t\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.table.rowManager.moveRowInArray(row.modules.group.rows, row, index, !top);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn index;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"group-changed\");\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tsetGroupBy(groups){\r\n\t\tthis.table.options.groupBy = groups;\r\n\t\t\r\n\t\tif(!this.initialized){\r\n\t\t\tthis.initialize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupValues(groupValues){\r\n\t\tthis.table.options.groupValues = groupValues;\r\n\t\tthis.configureGroupSetup();\r\n\t\tthis.refreshData();\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\tsetGroupStartOpen(values){\r\n\t\tthis.table.options.groupStartOpen = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetGroupHeader(values){\r\n\t\tthis.table.options.groupHeader = values;\r\n\t\tthis.configureGroupSetup();\r\n\t\t\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.refreshData();\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Grouping Update - cant refresh view, no groups have been set\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tuserGetGroups(values){\r\n\t\treturn this.getGroups(true);\r\n\t}\r\n\t\r\n\t// get grouped table data in the same format as getData()\r\n\tuserGetGroupedData(){\r\n\t\treturn this.table.options.groupBy ? this.getGroupedData() : this.getData();\r\n\t}\r\n\t\r\n\t\r\n\t///////////////////////////////////////\r\n\t///////// Component Functions /////////\r\n\t///////////////////////////////////////\r\n\t\r\n\trowGetGroup(row){\r\n\t\treturn row.modules.group ? row.modules.group.getComponent() : false;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowMoving(from, to, after){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(!after && to instanceof Group){\r\n\t\t\t\tto = this.table.rowManager.prevDisplayRow(from) || to;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar toGroup = to instanceof Group ? to : to.modules.group;\r\n\t\t\tvar fromGroup = from instanceof Group ? from : from.modules.group;\r\n\t\t\t\r\n\t\t\tif(toGroup === fromGroup){\r\n\t\t\t\tthis.table.rowManager.moveRowInArray(toGroup.rows, from, to, after);\r\n\t\t\t}else{\r\n\t\t\t\tif(fromGroup){\r\n\t\t\t\t\tfromGroup.removeRow(from);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttoGroup.insertRow(from, to, after);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\trowDeleting(row){\r\n\t\t//remove from group\r\n\t\tif(this.table.options.groupBy && row.modules.group){\r\n\t\t\trow.modules.group.removeRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\trowsUpdated(row){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.updateGroupRows(true);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tcellUpdated(cell){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.reassignRowToGroup(cell.row);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return appropriate rows with group headers\r\n\tgetRows(rows){\r\n\t\tif(this.table.options.groupBy && this.groupIDLookups.length){\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"dataGrouping\");\r\n\t\t\t\r\n\t\t\tthis.generateGroups(rows);\r\n\t\t\t\r\n\t\t\tif(this.subscribedExternal(\"dataGrouped\")){\r\n\t\t\t\tthis.dispatchExternal(\"dataGrouped\", this.getGroups(true));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn this.updateGroupRows();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\treturn rows.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetGroups(component){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tthis.groupList.forEach(function(group){\r\n\t\t\tgroupComponents.push(component ? group.getComponent() : group);\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\tgetChildGroups(group){\r\n\t\tvar groupComponents = [];\r\n\t\t\r\n\t\tif(!group){\r\n\t\t\tgroup = this;\r\n\t\t}\r\n\t\t\r\n\t\tgroup.groupList.forEach((child) => {\r\n\t\t\tif(child.groupList.length){\r\n\t\t\t\tgroupComponents = groupComponents.concat(this.getChildGroups(child));\r\n\t\t\t}else{\r\n\t\t\t\tgroupComponents.push(child);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupComponents;\r\n\t}\r\n\t\r\n\twipe(){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tthis.groupList.forEach(function(group){\r\n\t\t\t\tgroup.wipe();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tpullGroupListData(groupList) {\r\n\t\tvar groupListData = [];\r\n\t\t\r\n\t\tgroupList.forEach((group) => {\r\n\t\t\tvar groupHeader = {};\r\n\t\t\tgroupHeader.level = 0;\r\n\t\t\tgroupHeader.rowCount = 0;\r\n\t\t\tgroupHeader.headerContent = \"\";\r\n\t\t\tvar childData = [];\r\n\t\t\t\r\n\t\t\tif (group.hasSubGroups) {\r\n\t\t\t\tchildData = this.pullGroupListData(group.groupList);\r\n\t\t\t\t\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.rowCount = childData.length - group.groupList.length; // data length minus number of sub-headers\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, groupHeader.rowCount, group.rows, group);\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\tgroupListData = groupListData.concat(childData);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tgroupHeader.level = group.level;\r\n\t\t\t\tgroupHeader.headerContent = group.generator(group.key, group.rows.length, group.rows, group);\r\n\t\t\t\tgroupHeader.rowCount = group.getRows().length;\r\n\t\t\t\t\r\n\t\t\t\tgroupListData.push(groupHeader);\r\n\t\t\t\t\r\n\t\t\t\tgroup.getRows().forEach((row) => {\r\n\t\t\t\t\tgroupListData.push(row.getData(\"data\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn groupListData;\r\n\t}\r\n\t\r\n\tgetGroupedData(){\r\n\t\t\r\n\t\treturn this.pullGroupListData(this.groupList);\r\n\t}\r\n\t\r\n\tgetRowGroup(row){\r\n\t\tvar match = false;\r\n\t\t\r\n\t\tif(this.options(\"dataTree\")){\r\n\t\t\trow = this.table.modules.dataTree.getTreeParentRoot(row);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\tvar result = group.getRowGroup(row);\r\n\t\t\t\r\n\t\t\tif(result){\r\n\t\t\t\tmatch = result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn match;\r\n\t}\r\n\t\r\n\tcountGroups(){\r\n\t\treturn this.groupList.length;\r\n\t}\r\n\t\r\n\tgenerateGroups(rows){\r\n\t\tvar oldGroups = this.groups;\r\n\t\t\r\n\t\tthis.groups = {};\r\n\t\tthis.groupList = [];\r\n\t\t\r\n\t\tif(this.allowedValues && this.allowedValues[0]){\r\n\t\t\tthis.allowedValues[0].forEach((value) => {\r\n\t\t\t\tthis.createGroup(value, 0, oldGroups);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToExistingGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\trows.forEach((row) => {\r\n\t\t\t\tthis.assignRowToGroup(row, oldGroups);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tcreateGroup(groupID, level, oldGroups){\r\n\t\tvar groupKey = level + \"_\" + groupID,\r\n\t\tgroup;\r\n\t\t\r\n\t\toldGroups = oldGroups || [];\r\n\t\t\r\n\t\tgroup = new Group(this, false, level, groupID, this.groupIDLookups[0].field, this.headerGenerator[0], oldGroups[groupKey]);\r\n\t\t\r\n\t\tthis.groups[groupKey] = group;\r\n\t\tthis.groupList.push(group);\r\n\t}\r\n\t\r\n\tassignRowToExistingGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tgroupKey = \"0_\" + groupID;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tthis.groups[groupKey].addRow(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\tassignRowToGroup(row, oldGroups){\r\n\t\tvar groupID = this.groupIDLookups[0].func(row.getData()),\r\n\t\tnewGroupNeeded = !this.groups[\"0_\" + groupID];\r\n\t\t\r\n\t\tif(newGroupNeeded){\r\n\t\t\tthis.createGroup(groupID, 0, oldGroups);\r\n\t\t}\r\n\t\t\r\n\t\tthis.groups[\"0_\" + groupID].addRow(row);\r\n\t\t\r\n\t\treturn !newGroupNeeded;\r\n\t}\r\n\t\r\n\treassignRowToGroup(row){\r\n\t\tif(row.type === \"row\"){\r\n\t\t\tvar oldRowGroup = row.modules.group,\r\n\t\t\toldGroupPath = oldRowGroup.getPath(),\r\n\t\t\tnewGroupPath = this.getExpectedPath(row),\r\n\t\t\tsamePath;\r\n\t\t\t\r\n\t\t\t// figure out if new group path is the same as old group path\r\n\t\t\tsamePath = (oldGroupPath.length == newGroupPath.length) && oldGroupPath.every((element, index) => {\r\n\t\t\t\treturn element === newGroupPath[index];\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t// refresh if they new path and old path aren't the same (aka the row's groupings have changed)\r\n\t\t\tif(!samePath) {\r\n\t\t\t\toldRowGroup.removeRow(row);\r\n\t\t\t\tthis.assignRowToGroup(row, this.groups);\r\n\t\t\t\tthis.refreshData(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetExpectedPath(row) {\r\n\t\tvar groupPath = [], rowData = row.getData();\r\n\t\t\r\n\t\tthis.groupIDLookups.forEach((groupId) => {\r\n\t\t\tgroupPath.push(groupId.func(rowData));\r\n\t\t});\r\n\t\t\r\n\t\treturn groupPath;\r\n\t}\r\n\t\r\n\tupdateGroupRows(force){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.groupList.forEach((group) => {\r\n\t\t\toutput = output.concat(group.getHeadersAndRows());\r\n\t\t});\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.refreshData(true, this.displayHandler);\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tscrollHeaders(left){\r\n\t\tif(this.table.options.groupBy){\r\n\t\t\tif(this.table.options.renderHorizontal === \"virtual\"){\r\n\t\t\t\tleft -= this.table.columnManager.renderer.vDomPadLeft;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tleft = left + \"px\";\r\n\t\t\t\r\n\t\t\tthis.groupList.forEach((group) => {\r\n\t\t\t\tgroup.scrollHeader(left);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveGroup(group){\r\n\t\tvar groupKey = group.level + \"_\" + group.key,\r\n\t\tindex;\r\n\t\t\r\n\t\tif(this.groups[groupKey]){\r\n\t\t\tdelete this.groups[groupKey];\r\n\t\t\t\r\n\t\t\tindex = this.groupList.indexOf(group);\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.groupList.splice(index, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckBasicModeGroupHeaderWidth(){\r\n\t\tvar element = this.table.rowManager.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\t\t\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row, index) =>{\r\n\t\t\tthis.table.rowManager.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\t\t\t\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\t\r\n}\r\n\r\nGroupRows.moduleName = \"groupRows\";\r\n\r\nexport default GroupRows;","import Module from '../../core/Module.js';\r\nimport Row from '../../core/row/Row.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nimport defaultUndoers from './defaults/undoers.js';\r\nimport defaultRedoers from './defaults/redoers.js';\r\n\r\nclass History extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\r\n\t\tthis.registerTableOption(\"history\", false); //enable edit history\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.history){\r\n\t\t\tthis.subscribe(\"cell-value-updated\", this.cellUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.clearComponentHistory.bind(this));\r\n\t\t\tthis.subscribe(\"row-delete\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clear.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowAdded.bind(this));\r\n\t\t\tthis.subscribe(\"row-move\", this.rowMoved.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"undo\", this.undo.bind(this));\r\n\t\tthis.registerTableFunction(\"redo\", this.redo.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryUndoSize\", this.getHistoryUndoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getHistoryRedoSize\", this.getHistoryRedoSize.bind(this));\r\n\t\tthis.registerTableFunction(\"clearHistory\", this.clear.bind(this));\r\n\t}\r\n\r\n\trowMoved(from, to, after){\r\n\t\tthis.action(\"rowMove\", from, {posFrom:from.getPosition(), posTo:to.getPosition(), to:to, after:after});\r\n\t}\r\n\r\n\trowAdded(row, data, pos, index){\r\n\t\tthis.action(\"rowAdd\", row, {data:data, pos:pos, index:index});\r\n\t}\r\n\r\n\trowDeleted(row){\r\n\t\tvar index, rows;\r\n\r\n\t\tif(this.table.options.groupBy){\r\n\r\n\t\t\trows = row.getComponent().getGroup()._getSelf().rows;\r\n\t\t\tindex = rows.indexOf(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = rows[index-1];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tindex = row.table.rowManager.getRowIndex(row);\r\n\r\n\t\t\tif(index){\r\n\t\t\t\tindex = row.table.rowManager.rows[index-1];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.action(\"rowDelete\", row, {data:row.getData(), pos:!index, index:index});\r\n\t}\r\n\r\n\tcellUpdated(cell){\r\n\t\tthis.action(\"cellEdit\", cell, {oldValue:cell.oldValue, newValue:cell.value});\r\n\t}\r\n\r\n\tclear(){\r\n\t\tthis.history = [];\r\n\t\tthis.index = -1;\r\n\t}\r\n\r\n\taction(type, component, data){\r\n\t\tthis.history = this.history.slice(0, this.index + 1);\r\n\r\n\t\tthis.history.push({\r\n\t\t\ttype:type,\r\n\t\t\tcomponent:component,\r\n\t\t\tdata:data,\r\n\t\t});\r\n\r\n\t\tthis.index ++;\r\n\t}\r\n\r\n\tgetHistoryUndoSize(){\r\n\t\treturn this.index + 1;\r\n\t}\r\n\r\n\tgetHistoryRedoSize(){\r\n\t\treturn this.history.length - (this.index + 1);\r\n\t}\r\n\r\n\tclearComponentHistory(component){\r\n\t\tvar index = this.history.findIndex(function(item){\r\n\t\t\treturn item.component === component;\r\n\t\t});\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis.history.splice(index, 1);\r\n\t\t\tif(index <= this.index){\r\n\t\t\t\tthis.index--;\r\n\t\t\t}\r\n\r\n\t\t\tthis.clearComponentHistory(component);\r\n\t\t}\r\n\t}\r\n\r\n\tundo(){\r\n\t\tif(this.index > -1){\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.undoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.index--;\r\n\r\n\t\t\tthis.dispatchExternal(\"historyUndo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Undo Error - No more history to undo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\tredo(){\r\n\t\tif(this.history.length-1 > this.index){\r\n\r\n\t\t\tthis.index++;\r\n\r\n\t\t\tlet action = this.history[this.index];\r\n\r\n\t\t\tHistory.redoers[action.type].call(this, action);\r\n\r\n\t\t\tthis.dispatchExternal(\"historyRedo\", action.type, action.component.getComponent(), action.data);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"History Redo Error - No more history to redo\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//rebind rows to new element after deletion\r\n\t_rebindRow(oldRow, newRow){\r\n\t\tthis.history.forEach(function(action){\r\n\t\t\tif(action.component instanceof Row){\r\n\t\t\t\tif(action.component === oldRow){\r\n\t\t\t\t\taction.component = newRow;\r\n\t\t\t\t}\r\n\t\t\t}else if(action.component instanceof Cell){\r\n\t\t\t\tif(action.component.row === oldRow){\r\n\t\t\t\t\tvar field = action.component.column.getField();\r\n\r\n\t\t\t\t\tif(field){\r\n\t\t\t\t\t\taction.component = newRow.getCell(field);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nHistory.moduleName = \"history\";\r\n\r\n//load defaults\r\nHistory.undoers = defaultUndoers;\r\nHistory.redoers = defaultRedoers;\r\n\r\nexport default History;","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.oldValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowDelete: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posFrom], !action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","export default {\r\n\tcellEdit: function(action){\r\n\t\taction.component.setValueProcessData(action.data.newValue);\r\n\t\taction.component.cellRendered();\r\n\t},\r\n\r\n\trowAdd: function(action){\r\n\t\tvar newRow = this.table.rowManager.addRowActual(action.data.data, action.data.pos, action.data.index);\r\n\r\n\t\tif(this.table.options.groupBy && this.table.modExists(\"groupRows\")){\r\n\t\t\tthis.table.modules.groupRows.updateGroupRows(true);\r\n\t\t}\r\n\r\n\t\tthis._rebindRow(action.component, newRow);\r\n\t},\r\n\r\n\trowDelete:function(action){\r\n\t\taction.component.deleteActual();\r\n\t},\r\n\r\n\trowMove: function(action){\r\n\t\tthis.table.rowManager.moveRowActual(action.component, this.table.rowManager.rows[action.data.posTo], action.data.after);\r\n\t\tthis.table.rowManager.redraw();\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass HtmlTableImport extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.fieldIndex = [];\r\n\t\tthis.hasIndex = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.tableElementCheck();\r\n\t}\r\n\r\n\ttableElementCheck(){\r\n\t\tif(this.table.originalElement && this.table.originalElement.tagName === \"TABLE\"){\r\n\t\t\tif(this.table.originalElement.childNodes.length){\r\n\t\t\t\tthis.parseTable();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseTable(){\r\n\t\tvar element = this.table.originalElement,\r\n\t\toptions = this.table.options,\r\n\t\theaders = element.getElementsByTagName(\"th\"),\r\n\t\trows = element.getElementsByTagName(\"tbody\")[0],\r\n\t\tdata = [];\r\n\r\n\t\tthis.hasIndex = false;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImporting\");\r\n\r\n\t\trows = rows ? rows.getElementsByTagName(\"tr\") : [];\r\n\r\n\t\t//check for Tabulator inline options\r\n\t\tthis._extractOptions(element, options);\r\n\r\n\t\tif(headers.length){\r\n\t\t\tthis._extractHeaders(headers, rows);\r\n\t\t}else{\r\n\t\t\tthis._generateBlankHeaders(headers, rows);\r\n\t\t}\r\n\r\n\t\t//iterate through table rows and build data set\r\n\t\tfor(var index = 0; index < rows.length; index++){\r\n\t\t\tvar row = rows[index],\r\n\t\t\tcells = row.getElementsByTagName(\"td\"),\r\n\t\t\titem = {};\r\n\r\n\t\t\t//create index if the don't exist in table\r\n\t\t\tif(!this.hasIndex){\r\n\t\t\t\titem[options.index] = index;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\tvar cell = cells[i];\r\n\t\t\t\tif(typeof this.fieldIndex[i] !== \"undefined\"){\r\n\t\t\t\t\titem[this.fieldIndex[i]] = cell.innerHTML;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//add row data to item\r\n\t\t\tdata.push(item);\r\n\t\t}\r\n\r\n\t\toptions.data = data;\r\n\r\n\t\tthis.dispatchExternal(\"htmlImported\");\r\n\t}\r\n\r\n\t//extract tabulator attribute options\r\n\t_extractOptions(element, options, defaultOptions){\r\n\t\tvar attributes = element.attributes;\r\n\t\tvar optionsArr = defaultOptions ? Object.keys(defaultOptions) : Object.keys(options);\r\n\t\tvar optionsList = {};\r\n\r\n\t\toptionsArr.forEach((item) => {\r\n\t\t\toptionsList[item.toLowerCase()] = item;\r\n\t\t});\r\n\r\n\t\tfor(var index in attributes){\r\n\t\t\tvar attrib = attributes[index];\r\n\t\t\tvar name;\r\n\r\n\t\t\tif(attrib && typeof attrib == \"object\" && attrib.name && attrib.name.indexOf(\"tabulator-\") === 0){\r\n\t\t\t\tname = attrib.name.replace(\"tabulator-\", \"\");\r\n\r\n\t\t\t\tif(typeof optionsList[name] !== \"undefined\"){\r\n\t\t\t\t\toptions[optionsList[name]] = this._attribValue(attrib.value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//get value of attribute\r\n\t_attribValue(value){\r\n\t\tif(value === \"true\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(value === \"false\"){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\t//find column if it has already been defined\r\n\t_findCol(title){\r\n\t\tvar match = this.table.options.columns.find((column) => {\r\n\t\t\treturn column.title === title;\r\n\t\t});\r\n\r\n\t\treturn match || false;\r\n\t}\r\n\r\n\t//extract column from headers\r\n\t_extractHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\texists = false,\r\n\t\t\tcol = this._findCol(header.textContent),\r\n\t\t\twidth;\r\n\r\n\t\t\tif(col){\r\n\t\t\t\texists = true;\r\n\t\t\t}else{\r\n\t\t\t\tcol = {title:header.textContent.trim()};\r\n\t\t\t}\r\n\r\n\t\t\tif(!col.field) {\r\n\t\t\t\tcol.field = header.textContent.trim().toLowerCase().replace(\" \", \"_\");\r\n\t\t\t}\r\n\r\n\t\t\twidth = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width && !col.width)\t{\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\t//check for Tabulator inline options\r\n\t\t\tthis._extractOptions(header, col, this.table.columnManager.optionsList.registeredDefaults);\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tif(col.field == this.table.options.index){\r\n\t\t\t\tthis.hasIndex = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(!exists){\r\n\t\t\t\tthis.table.options.columns.push(col);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\r\n\t//generate blank headers\r\n\t_generateBlankHeaders(headers, rows){\r\n\t\tfor(var index = 0; index < headers.length; index++){\r\n\t\t\tvar header = headers[index],\r\n\t\t\tcol = {title:\"\", field:\"col\" + index};\r\n\r\n\t\t\tthis.fieldIndex[index] = col.field;\r\n\r\n\t\t\tvar width = header.getAttribute(\"width\");\r\n\r\n\t\t\tif(width){\r\n\t\t\t\tcol.width = width;\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.options.columns.push(col);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nHtmlTableImport.moduleName = \"htmlTableImport\";\r\n\r\nexport default HtmlTableImport;","import csv from './importers/csv.js';\r\nimport json from './importers/json.js';\r\nimport array from './importers/array.js';\r\n\r\nexport default {\r\n\tcsv:csv,\r\n\tjson:json,\r\n\tarray:array,\r\n};","function csvImporter(input){\r\n\tvar data = [],\r\n\trow = 0, \r\n\tcol = 0,\r\n\tinQuote = false;\r\n \r\n\t//Iterate over each character\r\n\tfor (let index = 0; index < input.length; index++) {\r\n\t\tlet char = input[index], \r\n\t\tnextChar = input[index+1]; \r\n \r\n\t\t//Initialize empty row\r\n\t\tif(!data[row]){\r\n\t\t\tdata[row] = [];\r\n\t\t}\r\n\r\n\t\t//Initialize empty column\r\n\t\tif(!data[row][col]){\r\n\t\t\tdata[row][col] = \"\";\r\n\t\t}\r\n \r\n\t\t//Handle quotation mark inside string\r\n\t\tif (char == '\"' && inQuote && nextChar == '\"') { \r\n\t\t\tdata[row][col] += char; \r\n\t\t\tindex++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//Begin / End Quote\r\n\t\tif (char == '\"') { \r\n\t\t\tinQuote = !inQuote;\r\n\t\t\tcontinue;\r\n\t\t}\r\n \r\n\t\t//Next column (if not in quote)\r\n\t\tif (char == ',' && !inQuote) { \r\n\t\t\tcol++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CRLF) \r\n\t\tif (char == '\\r' && nextChar == '\\n' && !inQuote) { \r\n\t\t\tcol = 0; \r\n\t\t\trow++; \r\n\t\t\tindex++; \r\n\t\t\tcontinue; \r\n\t\t}\r\n \r\n\t\t//New row if new line and not in quote (CR or LF) \r\n\t\tif ((char == '\\r' || char == '\\n') && !inQuote) { \r\n\t\t\tcol = 0;\r\n\t\t\trow++;\r\n\t\t\tcontinue; \r\n\t\t}\r\n\r\n\t\t//Normal Character, append to column\r\n\t\tdata[row][col] += char;\r\n\t}\r\n\r\n\treturn data;\r\n}\r\n\r\nexport default csvImporter;","export default function(input){\r\n\ttry {\r\n\t\treturn JSON.parse(input);\r\n\t} catch(e) {\r\n\t\tconsole.warn(\"JSON Import Error - File contents is invalid JSON\", e);\r\n\t\treturn Promise.reject();\r\n\t}\r\n}","function arrayImporter(input){\r\n\treturn input;\r\n}\r\n\r\nexport default arrayImporter;","import Module from '../../core/Module.js';\r\n\r\nimport defaultImporters from './defaults/importers.js';\r\n\r\nclass Import extends Module{\r\n \r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.registerTableOption(\"importFormat\");\r\n\t\tthis.registerTableOption(\"importReader\", \"text\");\r\n\t}\r\n \r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"import\", this.importFromFile.bind(this));\r\n\r\n\t\tif(this.table.options.importFormat){\r\n\t\t\tthis.subscribe(\"data-loading\", this.loadDataCheck.bind(this), 10);\r\n\t\t\tthis.subscribe(\"data-load\", this.loadData.bind(this), 10);\r\n\t\t}\r\n\t}\r\n\r\n\tloadDataCheck(data){\r\n\t\treturn this.table.options.importFormat && (typeof data === \"string\" || (Array.isArray(data) && data.length && Array.isArray(data)));\r\n\t}\r\n\r\n\tloadData(data, params, config, silent, previousData){\r\n\t\treturn this.importData(this.lookupImporter(), data)\r\n\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t.catch((err) => {\r\n\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import data\");\r\n\t\t\t\treturn Promise.reject(err);\r\n\t\t\t});\r\n\t}\r\n\r\n\tlookupImporter(importFormat){\r\n\t\tvar importer;\r\n \r\n\t\tif(!importFormat){\r\n\t\t\timportFormat = this.table.options.importFormat;\r\n\t\t}\r\n \r\n\t\tif(typeof importFormat === \"string\"){\r\n\t\t\timporter = Import.importers[importFormat];\r\n\t\t}else{\r\n\t\t\timporter = importFormat;\r\n\t\t}\r\n\r\n\t\tif(!importer){\r\n\t\t\tconsole.error(\"Import Error - Importer not found:\", importFormat);\r\n\t\t}\r\n \r\n\t\treturn importer;\r\n\t}\r\n \r\n\timportFromFile(importFormat, extension){\r\n\t\tvar importer = this.lookupImporter(importFormat);\r\n \r\n\t\tif(importer){\r\n\t\t\treturn this.pickFile(extension)\r\n\t\t\t\t.then(this.importData.bind(this, importer))\r\n\t\t\t\t.then(this.structureData.bind(this))\r\n\t\t\t\t.then(this.setData.bind(this))\r\n\t\t\t\t.catch((err) => {\r\n\t\t\t\t\tconsole.error(\"Import Error:\", err || \"Unable to import file\");\r\n\t\t\t\t\treturn Promise.reject(err);\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tpickFile(extensions){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar input = document.createElement(\"input\");\r\n\t\t\tinput.type = \"file\";\r\n\t\t\tinput.accept = extensions;\r\n \r\n\t\t\tinput.addEventListener(\"change\", (e) => {\r\n\t\t\t\tvar file = input.files[0],\r\n\t\t\t\treader = new FileReader();\r\n \r\n\t\t\t\tswitch(this.table.options.importReader){\r\n\t\t\t\t\tcase \"buffer\":\r\n\t\t\t\t\t\treader.readAsArrayBuffer(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"binary\":\r\n\t\t\t\t\t\treader.readAsBinaryString(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"url\":\r\n\t\t\t\t\t\treader.readAsDataURL(file);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"text\":\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treader.readAsText(file);\r\n\t\t\t\t}\r\n \r\n\t\t\t\treader.onload = (e) => {\r\n\t\t\t\t\tresolve(reader.result);\r\n\t\t\t\t};\r\n \r\n\t\t\t\treader.onerror = (e) => {\r\n\t\t\t\t\tconsole.warn(\"File Load Error - Unable to read file\");\r\n\t\t\t\t\treject();\r\n\t\t\t\t};\r\n\t\t\t});\r\n \r\n\t\t\tinput.click();\r\n\t\t});\r\n\t}\r\n \r\n\timportData(importer, fileContents){\r\n\t\tvar data = importer.call(this.table, fileContents);\r\n \r\n\t\tif(data instanceof Promise){\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn data ? Promise.resolve(data) : Promise.reject();\r\n\t\t}\r\n\t}\r\n\r\n\tstructureData(parsedData){\r\n\t\tvar data = [];\r\n \r\n\t\tif(Array.isArray(parsedData) && parsedData.length && Array.isArray(parsedData[0])){\r\n\t\t\tif(this.table.options.autoColumns){\r\n\t\t\t\tdata = this.structureArrayToObject(parsedData);\r\n\t\t\t}else{\r\n\t\t\t\tdata = this.structureArrayToColumns(parsedData);\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\t\t}else{\r\n\t\t\treturn parsedData;\r\n\t\t}\r\n\t}\r\n\r\n\tstructureArrayToObject(parsedData){\r\n\t\tvar columns = parsedData.shift();\r\n\r\n\t\tvar data = parsedData.map((values) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\tcolumns.forEach((key, i) => {\r\n\t\t\t\trow[key] = values[i];\r\n\t\t\t});\r\n\r\n\t\t\treturn row;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tstructureArrayToColumns(parsedData){\r\n\t\tvar data = [],\r\n\t\tcolumns = this.table.getColumns();\r\n\r\n\t\t//remove first row if it is the column names\r\n\t\tif(columns[0] && parsedData[0][0]){\r\n\t\t\tif(columns[0].getDefinition().title === parsedData[0][0]){\r\n\t\t\t\tparsedData.shift();\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\t//convert row arrays to objects\r\n\t\tparsedData.forEach((rowData) => {\r\n\t\t\tvar row = {};\r\n\r\n\t\t\trowData.forEach((value, index) => {\r\n\t\t\t\tvar column = columns[index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\trow[column.getField()] = value;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tdata.push(row);\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n \r\n\tsetData(data){\r\n\t\treturn this.table.setData(data);\r\n\t}\r\n}\r\n\r\nImport.moduleName = \"import\";\r\n\r\n//load defaults\r\nImport.importers = defaultImporters;\r\n\r\nexport default Import;","import Module from '../../core/Module.js';\r\n\r\nimport Cell from '../../core/cell/Cell.js';\r\nimport Column from '../../core/column/Column.js';\r\n\r\nclass Interaction extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.eventMap = {\r\n\t\t\t//row events\r\n\t\t\trowClick:\"row-click\",\r\n\t\t\trowDblClick:\"row-dblclick\",\r\n\t\t\trowContext:\"row-contextmenu\",\r\n\t\t\trowMouseEnter:\"row-mouseenter\",\r\n\t\t\trowMouseLeave:\"row-mouseleave\",\r\n\t\t\trowMouseOver:\"row-mouseover\",\r\n\t\t\trowMouseOut:\"row-mouseout\",\r\n\t\t\trowMouseMove:\"row-mousemove\",\r\n\t\t\trowTap:\"row\",\r\n\t\t\trowDblTap:\"row\",\r\n\t\t\trowTapHold:\"row\",\r\n\r\n\t\t\t//cell events\r\n\t\t\tcellClick:\"cell-click\",\r\n\t\t\tcellDblClick:\"cell-dblclick\",\r\n\t\t\tcellContext:\"cell-contextmenu\",\r\n\t\t\tcellMouseEnter:\"cell-mouseenter\",\r\n\t\t\tcellMouseLeave:\"cell-mouseleave\",\r\n\t\t\tcellMouseOver:\"cell-mouseover\",\r\n\t\t\tcellMouseOut:\"cell-mouseout\",\r\n\t\t\tcellMouseMove:\"cell-mousemove\",\r\n\t\t\tcellTap:\"cell\",\r\n\t\t\tcellDblTap:\"cell\",\r\n\t\t\tcellTapHold:\"cell\",\r\n\r\n\t\t\t//column header events\r\n\t\t\theaderClick:\"column-click\",\r\n\t\t\theaderDblClick:\"column-dblclick\",\r\n\t\t\theaderContext:\"column-contextmenu\",\r\n\t\t\theaderMouseEnter:\"column-mouseenter\",\r\n\t\t\theaderMouseLeave:\"column-mouseleave\",\r\n\t\t\theaderMouseOver:\"column-mouseover\",\r\n\t\t\theaderMouseOut:\"column-mouseout\",\r\n\t\t\theaderMouseMove:\"column-mousemove\",\r\n\t\t\theaderTap:\"column\",\r\n\t\t\theaderDblTap:\"column\",\r\n\t\t\theaderTapHold:\"column\",\r\n\r\n\t\t\t//group header\r\n\t\t\tgroupClick:\"group-click\",\r\n\t\t\tgroupDblClick:\"group-dblclick\",\r\n\t\t\tgroupContext:\"group-contextmenu\",\r\n\t\t\tgroupMouseEnter:\"group-mouseenter\",\r\n\t\t\tgroupMouseLeave:\"group-mouseleave\",\r\n\t\t\tgroupMouseOver:\"group-mouseover\",\r\n\t\t\tgroupMouseOut:\"group-mouseout\",\r\n\t\t\tgroupMouseMove:\"group-mousemove\",\r\n\t\t\tgroupTap:\"group\",\r\n\t\t\tgroupDblTap:\"group\",\r\n\t\t\tgroupTapHold:\"group\",\r\n\t\t};\r\n\r\n\t\tthis.subscribers = {};\r\n\r\n\t\tthis.touchSubscribers = {};\r\n\r\n\t\tthis.columnSubscribers = {};\r\n\r\n\t\tthis.touchWatchers = {\r\n\t\t\trow:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcell:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tcolumn:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t},\r\n\t\t\tgroup:{\r\n\t\t\t\ttap:null,\r\n\t\t\t\ttapDbl:null,\r\n\t\t\t\ttapHold:null,\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.registerColumnOption(\"headerClick\");\r\n\t\tthis.registerColumnOption(\"headerDblClick\");\r\n\t\tthis.registerColumnOption(\"headerContext\");\r\n\t\tthis.registerColumnOption(\"headerMouseEnter\");\r\n\t\tthis.registerColumnOption(\"headerMouseLeave\");\r\n\t\tthis.registerColumnOption(\"headerMouseOver\");\r\n\t\tthis.registerColumnOption(\"headerMouseOut\");\r\n\t\tthis.registerColumnOption(\"headerMouseMove\");\r\n\t\tthis.registerColumnOption(\"headerTap\");\r\n\t\tthis.registerColumnOption(\"headerDblTap\");\r\n\t\tthis.registerColumnOption(\"headerTapHold\");\r\n\r\n\t\tthis.registerColumnOption(\"cellClick\");\r\n\t\tthis.registerColumnOption(\"cellDblClick\");\r\n\t\tthis.registerColumnOption(\"cellContext\");\r\n\t\tthis.registerColumnOption(\"cellMouseEnter\");\r\n\t\tthis.registerColumnOption(\"cellMouseLeave\");\r\n\t\tthis.registerColumnOption(\"cellMouseOver\");\r\n\t\tthis.registerColumnOption(\"cellMouseOut\");\r\n\t\tthis.registerColumnOption(\"cellMouseMove\");\r\n\t\tthis.registerColumnOption(\"cellTap\");\r\n\t\tthis.registerColumnOption(\"cellDblTap\");\r\n\t\tthis.registerColumnOption(\"cellTapHold\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeExternalEvents();\r\n\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"cell-dblclick\", this.cellContentsSelectionFixer.bind(this));\r\n\t}\r\n\r\n\tcellContentsSelectionFixer(e, cell){\r\n\t\tvar range;\r\n\r\n\t\tif(this.table.modExists(\"edit\")){\r\n\t\t\tif (this.table.modules.edit.currentCell === cell){\r\n\t\t\t\treturn; //prevent instant selection of editor content\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\ttry{\r\n\t\t\tif (document.selection) { // IE\r\n\t\t\t\trange = document.body.createTextRange();\r\n\t\t\t\trange.moveToElementText(cell.getElement());\r\n\t\t\t\trange.select();\r\n\t\t\t} else if (window.getSelection) {\r\n\t\t\t\trange = document.createRange();\r\n\t\t\t\trange.selectNode(cell.getElement());\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t\twindow.getSelection().addRange(range);\r\n\t\t\t}\r\n\t\t}catch(e){}\r\n\t}\r\n\r\n\tinitializeExternalEvents(){\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tthis.subscriptionChangeExternal(key, this.subscriptionChanged.bind(this, key));\r\n\t\t}\r\n\t}\r\n\r\n\tsubscriptionChanged(key, added){\r\n\t\tif(added){\r\n\t\t\tif(!this.subscribers[key]){\r\n\t\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\t\tthis.subscribers[key] = this.handle.bind(this, key);\r\n\t\t\t\t\tthis.subscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.subscribeTouchEvents(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.eventMap[key].includes(\"-\")){\r\n\t\t\t\tif(this.subscribers[key] && !this.columnSubscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\t\t\tthis.unsubscribe(this.eventMap[key], this.subscribers[key]);\r\n\t\t\t\t\tdelete this.subscribers[key];\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.unsubscribeTouchEvents(key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tsubscribeTouchEvents(key){\r\n\t\tvar type = this.eventMap[key];\r\n\r\n\t\tif(!this.touchSubscribers[type + \"-touchstart\"]){\r\n\t\t\tthis.touchSubscribers[type + \"-touchstart\"] = this.handleTouch.bind(this, type, \"start\");\r\n\t\t\tthis.touchSubscribers[type + \"-touchend\"] = this.handleTouch.bind(this, type, \"end\");\r\n\r\n\t\t\tthis.subscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\tthis.subscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\t\t}\r\n\r\n\t\tthis.subscribers[key] = true;\r\n\t}\r\n\r\n\tunsubscribeTouchEvents(key){\r\n\t\tvar noTouch = true,\r\n\t\ttype = this.eventMap[key];\r\n\r\n\t\tif(this.subscribers[key] && !this.subscribedExternal(key)){\r\n\t\t\tdelete this.subscribers[key];\r\n\r\n\t\t\tfor(let i in this.eventMap){\r\n\t\t\t\tif(this.eventMap[i] === type){\r\n\t\t\t\t\tif(this.subscribers[i]){\r\n\t\t\t\t\t\tnoTouch = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(noTouch){\r\n\t\t\t\tthis.unsubscribe(type + \"-touchstart\", this.touchSubscribers[type + \"-touchstart\"]);\r\n\t\t\t\tthis.unsubscribe(type + \"-touchend\", this.touchSubscribers[type + \"-touchend\"]);\r\n\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchstart\"];\r\n\t\t\t\tdelete this.touchSubscribers[type + \"-touchend\"];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\r\n\t\tfor(let key in this.eventMap){\r\n\t\t\tif(def[key]){\r\n\t\t\t\tthis.subscriptionChanged(key, true);\r\n\r\n\t\t\t\tif(!this.columnSubscribers[key]){\r\n\t\t\t\t\tthis.columnSubscribers[key] = [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.columnSubscribers[key].push(column);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandle(action, e, component){\r\n\t\tthis.dispatchEvent(action, e, component);\r\n\t}\r\n\r\n\thandleTouch(type, action, e, component){\r\n\t\tvar watchers = this.touchWatchers[type];\r\n\r\n\t\tif(type === \"column\"){\r\n\t\t\ttype = \"header\";\r\n\t\t}\r\n\r\n\t\tswitch(action){\r\n\t\t\tcase \"start\":\r\n\t\t\t\twatchers.tap = true;\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\r\n\t\t\t\twatchers.tapHold = setTimeout(() => {\r\n\t\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\t\twatchers.tapHold = null;\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"TapHold\", e, component);\r\n\t\t\t\t}, 1000);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"end\":\r\n\t\t\t\tif(watchers.tap){\r\n\r\n\t\t\t\t\twatchers.tap = null;\r\n\t\t\t\t\tthis.dispatchEvent(type + \"Tap\", e, component);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(watchers.tapDbl){\r\n\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\twatchers.tapDbl = null;\r\n\r\n\t\t\t\t\tthis.dispatchEvent(type + \"DblTap\", e, component);\r\n\t\t\t\t}else{\r\n\t\t\t\t\twatchers.tapDbl = setTimeout(() => {\r\n\t\t\t\t\t\tclearTimeout(watchers.tapDbl);\r\n\t\t\t\t\t\twatchers.tapDbl = null;\r\n\t\t\t\t\t}, 300);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tclearTimeout(watchers.tapHold);\r\n\t\t\t\twatchers.tapHold = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tdispatchEvent(action, e, component){\r\n\t\tvar componentObj = component.getComponent(),\r\n\t\tcallback;\r\n\r\n\t\tif(this.columnSubscribers[action]){\r\n\r\n\t\t\tif(component instanceof Cell){\r\n\t\t\t\tcallback = component.column.definition[action];\r\n\t\t\t}else if(component instanceof Column){\r\n\t\t\t\tcallback = component.definition[action];\r\n\t\t\t}\r\n\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback(e, componentObj);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(action, e, componentObj);\r\n\t}\r\n}\r\n\r\nInteraction.moduleName = \"interaction\";\r\n\r\nexport default Interaction;\r\n","import Module from '../../core/Module.js';\r\n\r\nimport defaultBindings from './defaults/bindings.js';\r\nimport defaultActions from './defaults/actions.js';\r\n\r\nclass Keybindings extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.watchKeys = null;\r\n\t\tthis.pressedKeys = null;\r\n\t\tthis.keyupBinding = false;\r\n\t\tthis.keydownBinding = false;\r\n\r\n\t\tthis.registerTableOption(\"keybindings\", {}); //array for keybindings\r\n\t\tthis.registerTableOption(\"tabEndNewRow\", false); //create new row when tab to end of table\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tvar bindings = this.table.options.keybindings,\r\n\t\tmergedBindings = {};\r\n\r\n\t\tthis.watchKeys = {};\r\n\t\tthis.pressedKeys = [];\r\n\r\n\t\tif(bindings !== false){\r\n\t\t\tObject.assign(mergedBindings, Keybindings.bindings);\r\n\t\t\tObject.assign(mergedBindings, bindings);\r\n\r\n\t\t\tthis.mapBindings(mergedBindings);\r\n\t\t\tthis.bindEvents();\r\n\t\t}\r\n\r\n\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t}\r\n\r\n\tmapBindings(bindings){\r\n\t\tfor(let key in bindings){\r\n\t\t\tif(Keybindings.actions[key]){\r\n\t\t\t\tif(bindings[key]){\r\n\t\t\t\t\tif(typeof bindings[key] !== \"object\"){\r\n\t\t\t\t\t\tbindings[key] = [bindings[key]];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbindings[key].forEach((binding) => {\r\n\t\t\t\t\t\tvar bindingList = Array.isArray(binding) ? binding : [binding];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbindingList.forEach((item) => {\r\n\t\t\t\t\t\t\tthis.mapBinding(key, item);\r\n\t\t\t\t\t\t});\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Key Binding Error - no such action:\", key);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmapBinding(action, symbolsList){\r\n\t\tvar binding = {\r\n\t\t\taction: Keybindings.actions[action],\r\n\t\t\tkeys: [],\r\n\t\t\tctrl: false,\r\n\t\t\tshift: false,\r\n\t\t\tmeta: false,\r\n\t\t};\r\n\r\n\t\tvar symbols = symbolsList.toString().toLowerCase().split(\" \").join(\"\").split(\"+\");\r\n\r\n\t\tsymbols.forEach((symbol) => {\r\n\t\t\tswitch(symbol){\r\n\t\t\t\tcase \"ctrl\":\r\n\t\t\t\t\tbinding.ctrl = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"shift\":\r\n\t\t\t\t\tbinding.shift = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"meta\":\r\n\t\t\t\t\tbinding.meta = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tsymbol = isNaN(symbol) ? symbol.toUpperCase().charCodeAt(0) : parseInt(symbol);\r\n\t\t\t\t\tbinding.keys.push(symbol);\r\n\r\n\t\t\t\t\tif(!this.watchKeys[symbol]){\r\n\t\t\t\t\t\tthis.watchKeys[symbol] = [];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.watchKeys[symbol].push(binding);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tbindEvents(){\r\n\t\tvar self = this;\r\n\r\n\t\tthis.keyupBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tself.pressedKeys.push(code);\r\n\r\n\t\t\t\tbindings.forEach(function(binding){\r\n\t\t\t\t\tself.checkBinding(e, binding);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.keydownBinding = function(e){\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tvar bindings = self.watchKeys[code];\r\n\r\n\t\t\tif(bindings){\r\n\r\n\t\t\t\tvar index = self.pressedKeys.indexOf(code);\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tself.pressedKeys.splice(index, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.table.element.addEventListener(\"keydown\", this.keyupBinding);\r\n\r\n\t\tthis.table.element.addEventListener(\"keyup\", this.keydownBinding);\r\n\t}\r\n\r\n\tclearBindings(){\r\n\t\tif(this.keyupBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keydown\", this.keyupBinding);\r\n\t\t}\r\n\r\n\t\tif(this.keydownBinding){\r\n\t\t\tthis.table.element.removeEventListener(\"keyup\", this.keydownBinding);\r\n\t\t}\r\n\t}\r\n\r\n\tcheckBinding(e, binding){\r\n\t\tvar match = true;\r\n\r\n\t\tif(e.ctrlKey == binding.ctrl && e.shiftKey == binding.shift && e.metaKey == binding.meta){\r\n\t\t\tbinding.keys.forEach((key) => {\r\n\t\t\t\tvar index = this.pressedKeys.indexOf(key);\r\n\r\n\t\t\t\tif(index == -1){\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tbinding.action.call(this, e);\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nKeybindings.moduleName = \"keybindings\";\r\n\r\n//load defaults\r\nKeybindings.bindings = defaultBindings;\r\nKeybindings.actions = defaultActions;\r\n\r\nexport default Keybindings;","export default {\r\n\tnavPrev:\"shift + 9\",\r\n\tnavNext:9,\r\n\tnavUp:38,\r\n\tnavDown:40,\r\n\tscrollPageUp:33,\r\n\tscrollPageDown:34,\r\n\tscrollToStart:36,\r\n\tscrollToEnd:35,\r\n\tundo:[\"ctrl + 90\", \"meta + 90\"],\r\n\tredo:[\"ctrl + 89\", \"meta + 89\"],\r\n\tcopyToClipboard:[\"ctrl + 67\", \"meta + 89\"],\r\n};","export default {\r\n\tkeyBlock:function(e){\r\n\t\te.stopPropagation();\r\n\t\te.preventDefault();\r\n\t},\r\n\tscrollPageUp:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop - rowManager.element.clientHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos >= 0){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollPageDown:function(e){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tnewPos = rowManager.scrollTop + rowManager.element.clientHeight,\r\n\t\tscrollMax = rowManager.element.scrollHeight;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\tif(newPos <= scrollMax){\r\n\t\t\t\trowManager.element.scrollTop = newPos;\r\n\t\t\t}else{\r\n\t\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\r\n\t},\r\n\tscrollToStart:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[0]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tscrollToEnd:function(e){\r\n\t\tvar rowManager = this.table.rowManager;\r\n\r\n\t\te.preventDefault();\r\n\r\n\t\tif(rowManager.displayRowsCount){\r\n\t\t\trowManager.scrollToRow(rowManager.getDisplayRows()[rowManager.displayRowsCount - 1]);\r\n\t\t}\r\n\r\n\t\tthis.table.element.focus();\r\n\t},\r\n\tnavPrev:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-prev\", e);\r\n\t},\r\n\r\n\tnavNext:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-next\", e);\r\n\t},\r\n\r\n\tnavLeft:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-left\", e);\r\n\t},\r\n\r\n\tnavRight:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-right\", e);\r\n\t},\r\n\r\n\tnavUp:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-up\", e);\r\n\t},\r\n\r\n\tnavDown:function(e){\r\n\t\tthis.dispatch(\"keybinding-nav-down\", e);\r\n\t},\r\n\r\n\tundo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.undo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tredo:function(e){\r\n\t\tvar cell = false;\r\n\t\tif(this.table.options.history && this.table.modExists(\"history\") && this.table.modExists(\"edit\")){\r\n\r\n\t\t\tcell = this.table.modules.edit.currentCell;\r\n\r\n\t\t\tif(!cell){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tthis.table.modules.history.redo();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tcopyToClipboard:function(e){\r\n\t\tif(!this.table.modules.edit.currentCell){\r\n\t\t\tif(this.table.modExists(\"clipboard\", true)){\r\n\t\t\t\tthis.table.modules.clipboard.copy(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nclass Menu extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.menuContainer = null;\r\n\t\tthis.nestedMenuBlock = false;\r\n\t\t\r\n\t\tthis.currentComponent = null;\r\n\t\tthis.rootPopup = null;\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"menuContainer\", undefined); //deprecated\r\n\r\n\t\tthis.registerTableOption(\"rowContextMenu\", false);\r\n\t\tthis.registerTableOption(\"rowClickMenu\", false);\r\n\t\tthis.registerTableOption(\"groupContextMenu\", false);\r\n\t\tthis.registerTableOption(\"groupClickMenu\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextMenu\");\r\n\t\tthis.registerColumnOption(\"headerClickMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenu\");\r\n\t\tthis.registerColumnOption(\"headerMenuIcon\");\r\n\t\tthis.registerColumnOption(\"contextMenu\");\r\n\t\tthis.registerColumnOption(\"clickMenu\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\r\n\tdeprecatedOptionsCheck(){\r\n\t\tif(!this.deprecationCheck(\"menuContainer\", \"popupContainer\")){\r\n\t\t\tthis.table.options.popupContainer = this.table.options.menuContainer;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextMenu){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadMenuEvent.bind(this, this.table.options.rowContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickMenu){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadMenuEvent.bind(this, this.table.options.rowClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextMenu){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadMenuEvent.bind(this, this.table.options.groupContextMenu));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickMenu){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadMenuEvent.bind(this, this.table.options.groupClickMenu));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar\tdef = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextMenu && !this.columnSubscribers.headerContextMenu){\r\n\t\t\tthis.columnSubscribers.headerContextMenu = this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextMenu);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadMenuTableColumnEvent.bind(this, \"headerContextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickMenu && !this.columnSubscribers.headerClickMenu){\r\n\t\t\tthis.columnSubscribers.headerClickMenu = this.loadMenuTableColumnEvent.bind(this, \"headerClickMenu\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickMenu);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerMenu){\r\n\t\t\tthis.initializeColumnHeaderMenu(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextMenu && !this.columnSubscribers.contextMenu){\r\n\t\t\tthis.columnSubscribers.contextMenu = this.loadMenuTableCellEvent.bind(this, \"contextMenu\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextMenu);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadMenuTableCellEvent.bind(this, \"contextMenu\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickMenu && !this.columnSubscribers.clickMenu){\r\n\t\t\tthis.columnSubscribers.clickMenu = this.loadMenuTableCellEvent.bind(this, \"clickMenu\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickMenu);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderMenu(column){\r\n\t\tvar icon = column.definition.headerMenuIcon,\r\n\t\theaderMenuEl;\r\n\t\t\r\n\t\theaderMenuEl = document.createElement(\"span\");\r\n\t\theaderMenuEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderMenuEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderMenuEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderMenuEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderMenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadMenuEvent(column.definition.headerMenu, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerMenuEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadMenuTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadMenuEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadMenuEvent(menu, e, component){\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tmenu = typeof menu == \"function\" ? menu.call(this.table, e, component.getComponent()) : menu;\r\n\t\t\r\n\t\tthis.loadMenu(e, component, menu);\r\n\t}\r\n\t\r\n\tloadMenu(e, component, menu, parentEl, parentPopup){\r\n\t\tvar touch = !(e instanceof MouseEvent),\t\t\r\n\t\tmenuEl = document.createElement(\"div\"),\r\n\t\tpopup;\r\n\t\t\r\n\t\tmenuEl.classList.add(\"tabulator-menu\");\r\n\t\t\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\t//abort if no menu set\r\n\t\tif(!menu || !menu.length){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(!parentEl){\r\n\t\t\tif(this.nestedMenuBlock){\r\n\t\t\t\t//abort if child menu already open\r\n\t\t\t\tif(this.rootPopup){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.nestedMenuBlock = setTimeout(() => {\r\n\t\t\t\t\tthis.nestedMenuBlock = false;\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.rootPopup){\r\n\t\t\t\tthis.rootPopup.hide();\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rootPopup = popup = this.popup(menuEl);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tpopup = parentPopup.child(menuEl);\r\n\t\t}\r\n\t\t\r\n\t\tmenu.forEach((item) => {\r\n\t\t\tvar itemEl = document.createElement(\"div\"),\r\n\t\t\tlabel = item.label,\r\n\t\t\tdisabled = item.disabled;\r\n\t\t\t\r\n\t\t\tif(item.separator){\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-separator\");\r\n\t\t\t}else{\r\n\t\t\t\titemEl.classList.add(\"tabulator-menu-item\");\r\n\t\t\t\t\r\n\t\t\t\tif(typeof label == \"function\"){\r\n\t\t\t\t\tlabel = label.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(label instanceof Node){\r\n\t\t\t\t\titemEl.appendChild(label);\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = label;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(typeof disabled == \"function\"){\r\n\t\t\t\t\tdisabled = disabled.call(this.table, component.getComponent());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(disabled){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-disabled\");\r\n\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\te.stopPropagation();\r\n\t\t\t\t\t\t\tthis.loadMenu(e, component, item.menu, itemEl, popup);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(item.action){\r\n\t\t\t\t\t\t\titemEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\t\t\t\t\titem.action(e, component.getComponent());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(item.menu && item.menu.length){\r\n\t\t\t\t\titemEl.classList.add(\"tabulator-menu-item-submenu\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmenuEl.appendChild(itemEl);\r\n\t\t});\r\n\t\t\r\n\t\tmenuEl.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.rootPopup.hide();\r\n\t\t});\r\n\t\t\r\n\t\tpopup.show(parentEl || e);\r\n\t\t\r\n\t\tif(popup === this.rootPopup){\r\n\t\t\tthis.rootPopup.hideOnBlur(() => {\r\n\t\t\t\tthis.rootPopup = null;\r\n\t\t\t\t\r\n\t\t\t\tif(this.currentComponent){\r\n\t\t\t\t\tthis.dispatchExternal(\"menuClosed\", this.currentComponent.getComponent());\r\n\t\t\t\t\tthis.currentComponent = null;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.currentComponent = component;\r\n\r\n\t\t\tthis.dispatchExternal(\"menuOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMenu.moduleName = \"menu\";\r\n\r\nexport default Menu;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating column header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 250; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving column\r\n\t\tthis.toCol = false; //destination column\r\n\t\tthis.toColAfter = false; //position of moving column relative to the destination column\r\n\t\tthis.startX = 0; //starting position within header element\r\n\t\tthis.autoScrollMargin = 40; //auto scroll on edge when within margin\r\n\t\tthis.autoScrollStep = 5; //auto scroll distance in pixels\r\n\t\tthis.autoScrollTimeout = false; //auto scroll timeout\r\n\t\tthis.touchMove = false;\r\n\t\t\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\t\r\n\t\tthis.registerTableOption(\"movableColumns\", false); //enable movable columns\r\n\t}\r\n\t\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-col\");\r\n\t\tel.classList.add(\"tabulator-col-placeholder\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableColumns){\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\tcolEl;\r\n\t\t\r\n\t\tif(!column.modules.frozen && !column.isGroup){\r\n\t\t\tcolEl = column.getElement();\r\n\t\t\t\r\n\t\t\tconfig.mousemove = function(e){\r\n\t\t\t\tif(column.parent === self.moving.parent){\r\n\t\t\t\t\tif((((self.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(colEl).left) + self.table.columnManager.element.scrollLeft) > (column.getWidth() / 2)){\r\n\t\t\t\t\t\tif(self.toCol !== column || !self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl.nextSibling);\r\n\t\t\t\t\t\t\tself.moveColumn(column, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(self.toCol !== column || self.toColAfter){\r\n\t\t\t\t\t\t\tcolEl.parentNode.insertBefore(self.placeholderElement, colEl);\r\n\t\t\t\t\t\t\tself.moveColumn(column, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}.bind(self);\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tself.touchMove = false;\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, column);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tcolEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tself.bindTouchEvents(column);\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.modules.moveColumn = config;\r\n\t}\r\n\t\r\n\tbindTouchEvents(column){\r\n\t\tvar colEl = column.getElement(),\r\n\t\tstartXMove = false, //shifting center position of the cell\r\n\t\tnextCol, prevCol, nextColWidth, prevColWidth, nextColWidthLast, prevColWidthLast;\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextCol = column.nextColumn();\r\n\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth()/2 : 0;\r\n\t\t\t\tprevCol = column.prevColumn();\r\n\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth()/2 : 0;\r\n\t\t\t\tnextColWidthLast = 0;\r\n\t\t\t\tprevColWidthLast = 0;\r\n\t\t\t\tstartXMove = false;\r\n\t\t\t\t\r\n\t\t\t\tthis.startMove(e, column);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchmove\", (e) => {\r\n\t\t\tvar diff, moveToCol;\r\n\t\t\t\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.moveHover(e);\r\n\t\t\t\t\r\n\t\t\t\tif(!startXMove){\r\n\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdiff = e.touches[0].pageX - startXMove;\r\n\t\t\t\t\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextCol && diff - nextColWidthLast > nextColWidth){\r\n\t\t\t\t\t\tmoveToCol = nextCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevCol && -diff - prevColWidthLast > prevColWidth){\r\n\t\t\t\t\t\tmoveToCol = prevCol;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(moveToCol !== column){\r\n\t\t\t\t\t\t\tstartXMove = e.touches[0].pageX;\r\n\t\t\t\t\t\t\tmoveToCol.getElement().parentNode.insertBefore(this.placeholderElement, moveToCol.getElement());\r\n\t\t\t\t\t\t\tthis.moveColumn(moveToCol, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(moveToCol){\r\n\t\t\t\t\tnextCol = moveToCol.nextColumn();\r\n\t\t\t\t\tnextColWidthLast = nextColWidth;\r\n\t\t\t\t\tnextColWidth = nextCol ? nextCol.getWidth() / 2 : 0;\r\n\t\t\t\t\tprevCol = moveToCol.prevColumn();\r\n\t\t\t\t\tprevColWidthLast = prevColWidth;\r\n\t\t\t\t\tprevColWidth = prevCol ? prevCol.getWidth() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}, {passive: true});\r\n\t\t\r\n\t\tcolEl.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tstartMove(e, column){\r\n\t\tvar element = column.getElement(),\r\n\t\theaderElement = this.table.columnManager.getElement(),\r\n\t\theadersElement = this.table.columnManager.getHeadersElement();\r\n\t\t\r\n\t\tthis.moving = column;\r\n\t\tthis.startX = (this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(element).left;\r\n\t\t\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = column.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = column.getHeight() + \"px\";\r\n\t\t\r\n\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\telement.parentNode.removeChild(element);\r\n\t\t\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\t\t\r\n\t\tthis.table.columnManager.getElement().appendChild(this.hoverElement);\r\n\t\t\r\n\t\tthis.hoverElement.style.left = \"0\";\r\n\t\tthis.hoverElement.style.bottom = (headerElement.clientHeight - headersElement.offsetHeight) + \"px\";\r\n\t\t\r\n\t\tif(!this.touchMove){\r\n\t\t\tthis._bindMouseMove();\r\n\t\t\t\r\n\t\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\t\r\n\t_bindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().addEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.columnManager.columnsByIndex.forEach(function(column){\r\n\t\t\tif(column.modules.moveColumn.mousemove){\r\n\t\t\t\tcolumn.getElement().removeEventListener(\"mousemove\", column.modules.moveColumn.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tmoveColumn(column, after){\r\n\t\tvar movingCells = this.moving.getCells();\r\n\t\t\r\n\t\tthis.toCol = column;\r\n\t\tthis.toColAfter = after;\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl.nextSibling);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tcolumn.getCells().forEach(function(cell, i){\r\n\t\t\t\tvar cellEl = cell.getElement(true);\r\n\t\t\t\t\r\n\t\t\t\tif(cellEl.parentNode && movingCells[i]){\r\n\t\t\t\t\tcellEl.parentNode.insertBefore(movingCells[i].getElement(), cellEl);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tendMove(e){\r\n\t\tif(e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\t\t\t\r\n\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\t\t\t\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(this.toCol){\r\n\t\t\t\tthis.table.columnManager.moveColumnActual(this.moving, this.toCol, this.toColAfter);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toCol = false;\r\n\t\t\tthis.toColAfter = false;\r\n\t\t\t\r\n\t\t\tif(!this.touchMove){\r\n\t\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveHover(e){\r\n\t\tvar columnHolder = this.table.columnManager.getElement(),\r\n\t\tscrollLeft = columnHolder.scrollLeft,\r\n\t\txPos = ((this.touchMove ? e.touches[0].pageX : e.pageX) - Helpers.elOffset(columnHolder).left) + scrollLeft,\r\n\t\tscrollPos;\r\n\t\t\r\n\t\tthis.hoverElement.style.left = (xPos - this.startX) + \"px\";\r\n\t\t\r\n\t\tif(xPos - scrollLeft < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.max(0,scrollLeft-5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(scrollLeft + columnHolder.clientWidth - xPos < this.autoScrollMargin){\r\n\t\t\tif(!this.autoScrollTimeout){\r\n\t\t\t\tthis.autoScrollTimeout = setTimeout(() => {\r\n\t\t\t\t\tscrollPos = Math.min(columnHolder.clientWidth, scrollLeft+5);\r\n\t\t\t\t\tthis.table.rowManager.getElement().scrollLeft = scrollPos;\r\n\t\t\t\t\tthis.autoScrollTimeout = false;\r\n\t\t\t\t}, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveColumns.moduleName = \"moveColumn\";\r\n\r\nexport default MoveColumns;\r\n","import Module from '../../core/Module.js';\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nclass MoveRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.placeholderElement = this.createPlaceholderElement();\r\n\t\tthis.hoverElement = false; //floating row header element\r\n\t\tthis.checkTimeout = false; //click check timeout holder\r\n\t\tthis.checkPeriod = 150; //period to wait on mousedown to consider this a move and not a click\r\n\t\tthis.moving = false; //currently moving row\r\n\t\tthis.toRow = false; //destination row\r\n\t\tthis.toRowAfter = false; //position of moving row relative to the destination row\r\n\t\tthis.hasHandle = false; //row has handle instead of fully movable row\r\n\t\tthis.startY = 0; //starting Y position within header element\r\n\t\tthis.startX = 0; //starting X position within header element\r\n\r\n\t\tthis.moveHover = this.moveHover.bind(this);\r\n\t\tthis.endMove = this.endMove.bind(this);\r\n\t\tthis.tableRowDropEvent = false;\r\n\r\n\t\tthis.touchMove = false;\r\n\r\n\t\tthis.connection = false;\r\n\t\tthis.connectionSelectorsTables = false;\r\n\t\tthis.connectionSelectorsElements = false;\r\n\t\tthis.connectionElements = [];\r\n\t\tthis.connections = [];\r\n\r\n\t\tthis.connectedTable = false;\r\n\t\tthis.connectedRow = false;\r\n\r\n\t\tthis.registerTableOption(\"movableRows\", false); //enable movable rows\r\n\t\tthis.registerTableOption(\"movableRowsConnectedTables\", false); //tables for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsConnectedElements\", false); //other elements for movable rows to be connected to\r\n\t\tthis.registerTableOption(\"movableRowsSender\", false);\r\n\t\tthis.registerTableOption(\"movableRowsReceiver\", \"insert\");\r\n\r\n\t\tthis.registerColumnOption(\"rowHandle\");\r\n\t}\r\n\r\n\tcreatePlaceholderElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\tel.classList.add(\"tabulator-row-placeholder\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.movableRows){\r\n\t\t\tthis.connectionSelectorsTables = this.table.options.movableRowsConnectedTables;\r\n\t\t\tthis.connectionSelectorsElements = this.table.options.movableRowsConnectedElements;\r\n\r\n\t\t\tthis.connection = this.connectionSelectorsTables || this.connectionSelectorsElements;\r\n\r\n\t\t\tthis.subscribe(\"cell-init\", this.initializeCell.bind(this));\r\n\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeGroupHeader(group){\r\n\t\tvar self = this,\r\n\t\tconfig = {};\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, group);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl;\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(group.element).top) + self.table.rowManager.element.scrollTop) > (group.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== group || !self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(group, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== group || self.toRowAfter){\r\n\t\t\t\t\trowEl = group.getElement();\r\n\t\t\t\t\tif(rowEl.previousSibling){\r\n\t\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\t\tself.moveRow(group, false);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\t\tgroup.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\tconfig = {},\r\n\t\trowEl;\r\n\r\n\t\t//inter table drag drop\r\n\t\tconfig.mouseup = function(e){\r\n\t\t\tself.tableRowDrop(e, row);\r\n\t\t}.bind(self);\r\n\r\n\t\t//same table drag drop\r\n\t\tconfig.mousemove = function(e){\r\n\t\t\tvar rowEl = row.getElement();\r\n\r\n\t\t\tif(((e.pageY - Helpers.elOffset(rowEl).top) + self.table.rowManager.element.scrollTop) > (row.getHeight() / 2)){\r\n\t\t\t\tif(self.toRow !== row || !self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl.nextSibling);\r\n\t\t\t\t\tself.moveRow(row, true);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(self.toRow !== row || self.toRowAfter){\r\n\t\t\t\t\trowEl.parentNode.insertBefore(self.placeholderElement, rowEl);\r\n\t\t\t\t\tself.moveRow(row, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.bind(self);\r\n\r\n\r\n\t\tif(!this.hasHandle){\r\n\r\n\t\t\trowEl = row.getElement();\r\n\r\n\t\t\trowEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trowEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(row, row.getElement());\r\n\t\t}\r\n\r\n\t\trow.modules.moveRow = config;\r\n\t}\r\n\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tthis.hasHandle = true;\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeCell(cell){\r\n\t\tif(cell.column.definition.rowHandle && this.table.options.movableRows !== false){\r\n\t\t\tvar self = this,\r\n\t\t\tcellEl = cell.getElement(true);\r\n\r\n\t\t\tcellEl.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tself.checkTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tself.startMove(e, cell.row);\r\n\t\t\t\t\t}, self.checkPeriod);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcellEl.addEventListener(\"mouseup\", function(e){\r\n\t\t\t\tif(e.which === 1){\r\n\t\t\t\t\tif(self.checkTimeout){\r\n\t\t\t\t\t\tclearTimeout(self.checkTimeout);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.bindTouchEvents(cell.row, cellEl);\r\n\t\t}\r\n\t}\r\n\r\n\tbindTouchEvents(row, element){\r\n\t\tvar startYMove = false, //shifting center position of the cell\r\n\t\tnextRow, prevRow, nextRowHeight, prevRowHeight, nextRowHeightLast, prevRowHeightLast;\r\n\r\n\t\telement.addEventListener(\"touchstart\", (e) => {\r\n\t\t\tthis.checkTimeout = setTimeout(() => {\r\n\t\t\t\tthis.touchMove = true;\r\n\t\t\t\tnextRow = row.nextRow();\r\n\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight()/2 : 0;\r\n\t\t\t\tprevRow = row.prevRow();\r\n\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight()/2 : 0;\r\n\t\t\t\tnextRowHeightLast = 0;\r\n\t\t\t\tprevRowHeightLast = 0;\r\n\t\t\t\tstartYMove = false;\r\n\r\n\t\t\t\tthis.startMove(e, row);\r\n\t\t\t}, this.checkPeriod);\r\n\t\t}, {passive: true});\r\n\t\tthis.moving, this.toRow, this.toRowAfter;\r\n\t\telement.addEventListener(\"touchmove\", (e) => {\r\n\r\n\t\t\tvar diff, moveToRow;\r\n\r\n\t\t\tif(this.moving){\r\n\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\tthis.moveHover(e);\r\n\r\n\t\t\t\tif(!startYMove){\r\n\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdiff = e.touches[0].pageY - startYMove;\r\n\r\n\t\t\t\tif(diff > 0){\r\n\t\t\t\t\tif(nextRow && diff - nextRowHeightLast > nextRowHeight){\r\n\t\t\t\t\t\tmoveToRow = nextRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement().nextSibling);\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(prevRow && -diff - prevRowHeightLast > prevRowHeight){\r\n\t\t\t\t\t\tmoveToRow = prevRow;\r\n\r\n\t\t\t\t\t\tif(moveToRow !== row){\r\n\t\t\t\t\t\t\tstartYMove = e.touches[0].pageY;\r\n\t\t\t\t\t\t\tmoveToRow.getElement().parentNode.insertBefore(this.placeholderElement, moveToRow.getElement());\r\n\t\t\t\t\t\t\tthis.moveRow(moveToRow, false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(moveToRow){\r\n\t\t\t\t\tnextRow = moveToRow.nextRow();\r\n\t\t\t\t\tnextRowHeightLast = nextRowHeight;\r\n\t\t\t\t\tnextRowHeight = nextRow ? nextRow.getHeight() / 2 : 0;\r\n\t\t\t\t\tprevRow = moveToRow.prevRow();\r\n\t\t\t\t\tprevRowHeightLast = prevRowHeight;\r\n\t\t\t\t\tprevRowHeight = prevRow ? prevRow.getHeight() / 2 : 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\telement.addEventListener(\"touchend\", (e) => {\r\n\t\t\tif(this.checkTimeout){\r\n\t\t\t\tclearTimeout(this.checkTimeout);\r\n\t\t\t}\r\n\t\t\tif(this.moving){\r\n\t\t\t\tthis.endMove(e);\r\n\t\t\t\tthis.touchMove = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_bindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().addEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t_unbindMouseMove(){\r\n\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\tif((row.type === \"row\" || row.type === \"group\") && row.modules.moveRow && row.modules.moveRow.mousemove){\r\n\t\t\t\trow.getElement().removeEventListener(\"mousemove\", row.modules.moveRow.mousemove);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tstartMove(e, row){\r\n\t\tvar element = row.getElement();\r\n\r\n\t\tthis.setStartPosition(e, row);\r\n\r\n\t\tthis.moving = row;\r\n\r\n\t\tthis.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\t//create placeholder\r\n\t\tthis.placeholderElement.style.width = row.getWidth() + \"px\";\r\n\t\tthis.placeholderElement.style.height = row.getHeight() + \"px\";\r\n\r\n\t\tif(!this.connection){\r\n\t\t\telement.parentNode.insertBefore(this.placeholderElement, element);\r\n\t\t\telement.parentNode.removeChild(element);\r\n\t\t}else{\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-sending\");\r\n\t\t\tthis.connectToTables(row);\r\n\t\t}\r\n\r\n\t\t//create hover element\r\n\t\tthis.hoverElement = element.cloneNode(true);\r\n\t\tthis.hoverElement.classList.add(\"tabulator-moving\");\r\n\r\n\t\tif(this.connection){\r\n\t\t\tdocument.body.appendChild(this.hoverElement);\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\t\t\tthis.hoverElement.style.width = this.table.element.clientWidth + \"px\";\r\n\t\t\tthis.hoverElement.style.whiteSpace = \"nowrap\";\r\n\t\t\tthis.hoverElement.style.overflow = \"hidden\";\r\n\t\t\tthis.hoverElement.style.pointerEvents = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(this.hoverElement);\r\n\r\n\t\t\tthis.hoverElement.style.left = \"0\";\r\n\t\t\tthis.hoverElement.style.top = \"0\";\r\n\r\n\t\t\tthis._bindMouseMove();\r\n\t\t}\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", this.moveHover);\r\n\t\tdocument.body.addEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\tthis.dispatchExternal(\"rowMoving\", row.getComponent());\r\n\r\n\t\tthis.moveHover(e);\r\n\t}\r\n\r\n\tsetStartPosition(e, row){\r\n\t\tvar pageX = this.touchMove ? e.touches[0].pageX : e.pageX,\r\n\t\tpageY = this.touchMove ? e.touches[0].pageY : e.pageY,\r\n\t\telement, position;\r\n\r\n\t\telement = row.getElement();\r\n\t\tif(this.connection){\r\n\t\t\tposition = element.getBoundingClientRect();\r\n\r\n\t\t\tthis.startX = position.left - pageX + window.pageXOffset;\r\n\t\t\tthis.startY = position.top - pageY + window.pageYOffset;\r\n\t\t}else{\r\n\t\t\tthis.startY = (pageY - element.getBoundingClientRect().top);\r\n\t\t}\r\n\t}\r\n\r\n\tendMove(e){\r\n\t\tif(!e || e.which === 1 || this.touchMove){\r\n\t\t\tthis._unbindMouseMove();\r\n\r\n\t\t\tif(!this.connection){\r\n\t\t\t\tthis.placeholderElement.parentNode.insertBefore(this.moving.getElement(), this.placeholderElement.nextSibling);\r\n\t\t\t\tthis.placeholderElement.parentNode.removeChild(this.placeholderElement);\r\n\t\t\t}\r\n\r\n\t\t\tthis.hoverElement.parentNode.removeChild(this.hoverElement);\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tif(this.toRow){\r\n\t\t\t\tthis.table.rowManager.moveRow(this.moving, this.toRow, this.toRowAfter);\r\n\t\t\t}else{\r\n\t\t\t\tthis.dispatchExternal(\"rowMoveCancelled\", this.moving.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tthis.moving = false;\r\n\t\t\tthis.toRow = false;\r\n\t\t\tthis.toRowAfter = false;\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", this.moveHover);\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", this.endMove);\r\n\r\n\t\t\tif(this.connection){\r\n\t\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-sending\");\r\n\t\t\t\tthis.disconnectFromTables();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tmoveRow(row, after){\r\n\t\tthis.toRow = row;\r\n\t\tthis.toRowAfter = after;\r\n\t}\r\n\r\n\tmoveHover(e){\r\n\t\tif(this.connection){\r\n\t\t\tthis.moveHoverConnections.call(this, e);\r\n\t\t}else{\r\n\t\t\tthis.moveHoverTable.call(this, e);\r\n\t\t}\r\n\t}\r\n\r\n\tmoveHoverTable(e){\r\n\t\tvar rowHolder = this.table.rowManager.getElement(),\r\n\t\tscrollTop = rowHolder.scrollTop,\r\n\t\tyPos = ((this.touchMove ? e.touches[0].pageY : e.pageY) - rowHolder.getBoundingClientRect().top) + scrollTop;\r\n\t\t\r\n\t\tthis.hoverElement.style.top = Math.min(yPos - this.startY, this.table.rowManager.element.scrollHeight - this.hoverElement.offsetHeight) + \"px\";\r\n\t}\r\n\r\n\tmoveHoverConnections(e){\r\n\t\tthis.hoverElement.style.left = (this.startX + (this.touchMove ? e.touches[0].pageX : e.pageX)) + \"px\";\r\n\t\tthis.hoverElement.style.top = (this.startY + (this.touchMove ? e.touches[0].pageY : e.pageY)) + \"px\";\r\n\t}\r\n\r\n\telementRowDrop(e, element, row){\r\n\t\tthis.dispatchExternal(\"movableRowsElementDrop\", e, element, row ? row.getComponent() : false);\r\n\t}\r\n\r\n\t//establish connection with other tables\r\n\tconnectToTables(row){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStart\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"connect\", {\r\n\t\t\t\trow:row,\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.connectionSelectorsElements){\r\n\r\n\t\t\tthis.connectionElements = [];\r\n\r\n\t\t\tif(!Array.isArray(this.connectionSelectorsElements)){\r\n\t\t\t\tthis.connectionSelectorsElements = [this.connectionSelectorsElements];\r\n\t\t\t}\r\n\r\n\t\t\tthis.connectionSelectorsElements.forEach((query) => {\r\n\t\t\t\tif(typeof query === \"string\"){\r\n\t\t\t\t\tthis.connectionElements = this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(query)));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.connectionElements.push(query);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\t\tvar dropEvent = (e) => {\r\n\t\t\t\t\tthis.elementRowDrop(e, element, this.moving);\r\n\t\t\t\t};\r\n\r\n\t\t\t\telement.addEventListener(\"mouseup\", dropEvent);\r\n\t\t\t\telement.tabulatorElementDropEvent = dropEvent;\r\n\r\n\t\t\t\telement.classList.add(\"tabulator-movingrow-receiving\");\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t//disconnect from other tables\r\n\tdisconnectFromTables(){\r\n\t\tvar connectionTables;\r\n\r\n\t\tif(this.connectionSelectorsTables){\r\n\t\t\tconnectionTables = this.commsConnections(this.connectionSelectorsTables);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSendingStop\", connectionTables);\r\n\r\n\t\t\tthis.commsSend(this.connectionSelectorsTables, \"moveRow\", \"disconnect\");\r\n\t\t}\r\n\r\n\t\tthis.connectionElements.forEach((element) => {\r\n\t\t\telement.classList.remove(\"tabulator-movingrow-receiving\");\r\n\t\t\telement.removeEventListener(\"mouseup\", element.tabulatorElementDropEvent);\r\n\t\t\tdelete element.tabulatorElementDropEvent;\r\n\t\t});\r\n\t}\r\n\r\n\t//accept incomming connection\r\n\tconnect(table, row){\r\n\t\tif(!this.connectedTable){\r\n\t\t\tthis.connectedTable = table;\r\n\t\t\tthis.connectedRow = row;\r\n\r\n\t\t\tthis.table.element.classList.add(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) => {\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().addEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.tableRowDropEvent = this.tableRowDrop.bind(this);\r\n\r\n\t\t\tthis.table.element.addEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStart\", row, table);\r\n\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - Table cannot accept connection, already connected to table:\", this.connectedTable);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//close incoming connection\r\n\tdisconnect(table){\r\n\t\tif(table === this.connectedTable){\r\n\t\t\tthis.connectedTable = false;\r\n\t\t\tthis.connectedRow = false;\r\n\r\n\t\t\tthis.table.element.classList.remove(\"tabulator-movingrow-receiving\");\r\n\r\n\t\t\tthis.table.rowManager.getDisplayRows().forEach((row) =>{\r\n\t\t\t\tif(row.type === \"row\" && row.modules.moveRow && row.modules.moveRow.mouseup){\r\n\t\t\t\t\trow.getElement().removeEventListener(\"mouseup\", row.modules.moveRow.mouseup);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.table.element.removeEventListener(\"mouseup\", this.tableRowDropEvent);\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivingStop\", table);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Row Error - trying to disconnect from non connected table\");\r\n\t\t}\r\n\t}\r\n\r\n\tdropComplete(table, row, success){\r\n\t\tvar sender = false;\r\n\r\n\t\tif(success){\r\n\r\n\t\t\tswitch(typeof this.table.options.movableRowsSender){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tsender = this.senders[this.table.options.movableRowsSender];\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\tsender = this.table.options.movableRowsSender;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(sender){\r\n\t\t\t\tsender.call(this, this.moving ? this.moving.getComponent() : undefined, row ? row.getComponent() : undefined, table);\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.movableRowsSender){\r\n\t\t\t\t\tconsole.warn(\"Mover Row Error - no matching sender found:\", this.table.options.movableRowsSender);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.dispatchExternal(\"movableRowsSent\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsSentFailed\", this.moving.getComponent(), row ? row.getComponent() : undefined, table);\r\n\t\t}\r\n\r\n\t\tthis.endMove();\r\n\t}\r\n\r\n\ttableRowDrop(e, row){\r\n\t\tvar receiver = false,\r\n\t\tsuccess = false;\r\n\r\n\t\te.stopImmediatePropagation();\r\n\r\n\t\tswitch(typeof this.table.options.movableRowsReceiver){\r\n\t\t\tcase \"string\":\r\n\t\t\t\treceiver = this.receivers[this.table.options.movableRowsReceiver];\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\treceiver = this.table.options.movableRowsReceiver;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(receiver){\r\n\t\t\tsuccess = receiver.call(this, this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Mover Row Error - no matching receiver found:\", this.table.options.movableRowsReceiver);\r\n\t\t}\r\n\r\n\t\tif(success){\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceived\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"movableRowsReceivedFailed\", this.connectedRow.getComponent(), row ? row.getComponent() : undefined, this.connectedTable);\r\n\t\t}\r\n\r\n\t\tthis.commsSend(this.connectedTable, \"moveRow\", \"dropcomplete\", {\r\n\t\t\trow:row,\r\n\t\t\tsuccess:success,\r\n\t\t});\r\n\t}\r\n\r\n\tcommsReceived(table, action, data){\r\n\t\tswitch(action){\r\n\t\t\tcase \"connect\":\r\n\t\t\t\treturn this.connect(table, data.row);\r\n\r\n\t\t\tcase \"disconnect\":\r\n\t\t\t\treturn this.disconnect(table);\r\n\r\n\t\t\tcase \"dropcomplete\":\r\n\t\t\t\treturn this.dropComplete(table, data.row, data.success);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nMoveRows.prototype.receivers = {\r\n\tinsert:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\treturn true;\r\n\t},\r\n\r\n\tadd:function(fromRow, toRow, fromTable){\r\n\t\tthis.table.addRow(fromRow.getData());\r\n\t\treturn true;\r\n\t},\r\n\r\n\tupdate:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\ttoRow.update(fromRow.getData());\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\r\n\treplace:function(fromRow, toRow, fromTable){\r\n\t\tif(toRow){\r\n\t\t\tthis.table.addRow(fromRow.getData(), undefined, toRow);\r\n\t\t\ttoRow.delete();\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n};\r\n\r\nMoveRows.prototype.senders = {\r\n\tdelete:function(fromRow, toRow, toTable){\r\n\t\tfromRow.delete();\r\n\t}\r\n};\r\n\r\nMoveRows.moduleName = \"moveRow\";\r\n\r\nexport default MoveRows;","import Module from '../../core/Module.js';\r\n\r\nimport defaultMutators from './defaults/mutators.js';\r\n\r\nclass Mutator extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.allowedTypes = [\"\", \"data\", \"edit\", \"clipboard\"]; //list of mutation types\r\n\t\tthis.enabled = true;\r\n\r\n\t\tthis.registerColumnOption(\"mutator\");\r\n\t\tthis.registerColumnOption(\"mutatorParams\");\r\n\t\tthis.registerColumnOption(\"mutatorData\");\r\n\t\tthis.registerColumnOption(\"mutatorDataParams\");\r\n\t\tthis.registerColumnOption(\"mutatorEdit\");\r\n\t\tthis.registerColumnOption(\"mutatorEditParams\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboard\");\r\n\t\tthis.registerColumnOption(\"mutatorClipboardParams\");\r\n\t\tthis.registerColumnOption(\"mutateLink\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-value-changing\", this.transformCell.bind(this));\r\n\t\tthis.subscribe(\"cell-value-changed\", this.mutateLink.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"row-data-init-before\", this.rowDataChanged.bind(this));\r\n\t\tthis.subscribe(\"row-data-changing\", this.rowDataChanged.bind(this));\r\n\t}\r\n\r\n\trowDataChanged(row, tempData, updatedData){\r\n\t\treturn this.transformRow(tempData, \"data\", updatedData);\r\n\t}\r\n\r\n\t//initialize column mutator\r\n\tinitializeColumn(column){\r\n\t\tvar match = false,\r\n\t\tconfig = {};\r\n\r\n\t\tthis.allowedTypes.forEach((type) => {\r\n\t\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\t\tmutator;\r\n\r\n\t\t\tif(column.definition[key]){\r\n\t\t\t\tmutator = this.lookupMutator(column.definition[key]);\r\n\r\n\t\t\t\tif(mutator){\r\n\t\t\t\t\tmatch = true;\r\n\r\n\t\t\t\t\tconfig[key] = {\r\n\t\t\t\t\t\tmutator:mutator,\r\n\t\t\t\t\t\tparams: column.definition[key + \"Params\"] || {},\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(match){\r\n\t\t\tcolumn.modules.mutate = config;\r\n\t\t}\r\n\t}\r\n\r\n\tlookupMutator(value){\r\n\t\tvar mutator = false;\r\n\r\n\t\t//set column mutator\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Mutator.mutators[value]){\r\n\t\t\t\t\tmutator = Mutator.mutators[value];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Mutator Error - No such mutator found, ignoring: \", value);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tmutator = value;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn mutator;\r\n\t}\r\n\r\n\t//apply mutator to row\r\n\ttransformRow(data, type, updatedData){\r\n\t\tvar key = \"mutator\" + (type.charAt(0).toUpperCase() + type.slice(1)),\r\n\t\tvalue;\r\n\r\n\t\tif(this.enabled){\r\n\r\n\t\t\tthis.table.columnManager.traverse((column) => {\r\n\t\t\t\tvar mutator, params, component;\r\n\r\n\t\t\t\tif(column.modules.mutate){\r\n\t\t\t\t\tmutator = column.modules.mutate[key] || column.modules.mutate.mutator || false;\r\n\r\n\t\t\t\t\tif(mutator){\r\n\t\t\t\t\t\tvalue = column.getFieldValue(typeof updatedData !== \"undefined\" ? updatedData : data);\r\n\r\n\t\t\t\t\t\tif(type == \"data\" || typeof value !== \"undefined\"){\r\n\t\t\t\t\t\t\tcomponent = column.getComponent();\r\n\t\t\t\t\t\t\tparams = typeof mutator.params === \"function\" ? mutator.params(value, data, type, component) : mutator.params;\r\n\t\t\t\t\t\t\tcolumn.setFieldValue(data, mutator.mutator(value, data, type, params, component));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//apply mutator to new cell value\r\n\ttransformCell(cell, value){\r\n\t\tif(cell.column.modules.mutate){\r\n\t\t\tvar mutator = cell.column.modules.mutate.mutatorEdit || cell.column.modules.mutate.mutator || false,\r\n\t\t\ttempData = {};\r\n\r\n\t\t\tif(mutator){\r\n\t\t\t\ttempData = Object.assign(tempData, cell.row.getData());\r\n\t\t\t\tcell.column.setFieldValue(tempData, value);\r\n\t\t\t\treturn mutator.mutator(value, tempData, \"edit\", mutator.params, cell.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tmutateLink(cell){\r\n\t\tvar links = cell.column.definition.mutateLink;\r\n\r\n\t\tif(links){\r\n\t\t\tif(!Array.isArray(links)){\r\n\t\t\t\tlinks = [links];\r\n\t\t\t}\r\n\r\n\t\t\tlinks.forEach((link) => {\r\n\t\t\t\tvar linkCell = cell.row.getCell(link);\r\n\r\n\t\t\t\tif(linkCell){\r\n\t\t\t\t\tlinkCell.setValue(linkCell.getValue(), true, true);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tenable(){\r\n\t\tthis.enabled = true;\r\n\t}\r\n\r\n\tdisable(){\r\n\t\tthis.enabled = false;\r\n\t}\r\n}\r\n\r\nMutator.moduleName = \"mutator\";\r\n\r\n//load defaults\r\nMutator.mutators = defaultMutators;\r\n\r\nexport default Mutator;","export default {};","import rows from './pageCounters/rows.js';\r\nimport pages from './pageCounters/pages.js';\r\n\r\n\r\nexport default {\r\n\trows:rows,\r\n\tpages:pages,\r\n};","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|rows\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\r\n\tif(totalRows){\r\n\t\tvalueEl.innerHTML = \" \" + currentRow + \"-\" + Math.min((currentRow + pageSize - 1), totalRows) + \" \";\r\n\t\t\r\n\t\ttotalEl.innerHTML = \" \" + totalRows + \" \";\r\n\t\t\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(ofEl);\r\n\t\tel.appendChild(totalEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}else{\r\n\t\tvalueEl.innerHTML = \" 0 \";\r\n\r\n\t\tel.appendChild(showingEl);\r\n\t\tel.appendChild(valueEl);\r\n\t\tel.appendChild(rowsEl);\r\n\t}\r\n\t\r\n\treturn el;\r\n}","export default function(pageSize, currentRow, currentPage, totalRows, totalPages){\r\n\r\n\tvar el = document.createElement(\"span\"),\r\n\tshowingEl = document.createElement(\"span\"),\r\n\tvalueEl = document.createElement(\"span\"),\r\n\tofEl = document.createElement(\"span\"),\r\n\ttotalEl = document.createElement(\"span\"),\r\n\trowsEl = document.createElement(\"span\");\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|showing\", (value) => {\r\n\t\tshowingEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tvalueEl.innerHTML = \" \" + currentPage + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|of\", (value) => {\r\n\t\tofEl.innerHTML = value;\r\n\t});\r\n\t\r\n\ttotalEl.innerHTML = \" \" + totalPages + \" \";\r\n\t\r\n\tthis.table.modules.localize.langBind(\"pagination|counter|pages\", (value) => {\r\n\t\trowsEl.innerHTML = value;\r\n\t});\r\n\t\r\n\tel.appendChild(showingEl);\r\n\tel.appendChild(valueEl);\r\n\tel.appendChild(ofEl);\r\n\tel.appendChild(totalEl);\r\n\tel.appendChild(rowsEl);\r\n\t\r\n\treturn el;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultPageCounters from './defaults/pageCounters.js';\r\n\r\nclass Page extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.mode = \"local\";\r\n\t\tthis.progressiveLoad = false;\r\n\t\t\r\n\t\tthis.element = null;\r\n\t\tthis.pageCounterElement = null;\r\n\t\tthis.pageCounter = null;\r\n\t\t\r\n\t\tthis.size = 0;\r\n\t\tthis.page = 1;\r\n\t\tthis.count = 5;\r\n\t\tthis.max = 1;\r\n\r\n\t\tthis.remoteRowCountEstimate = null;\r\n\t\t\r\n\t\tthis.initialLoad = true;\r\n\t\tthis.dataChanging = false; //flag to check if data is being changed by this module\r\n\t\t\r\n\t\tthis.pageSizes = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"pagination\", false); //set pagination type\r\n\t\tthis.registerTableOption(\"paginationMode\", \"local\"); //local or remote pagination\r\n\t\tthis.registerTableOption(\"paginationSize\", false); //set number of rows to a page\r\n\t\tthis.registerTableOption(\"paginationInitialPage\", 1); //initial page to show on load\r\n\t\tthis.registerTableOption(\"paginationCounter\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationCounterElement\", false); // set pagination counter\r\n\t\tthis.registerTableOption(\"paginationButtonCount\", 5); // set count of page button\r\n\t\tthis.registerTableOption(\"paginationSizeSelector\", false); //add pagination size selector element\r\n\t\tthis.registerTableOption(\"paginationElement\", false); //element to hold pagination numbers\r\n\t\t// this.registerTableOption(\"paginationDataSent\", {}); //pagination data sent to the server\r\n\t\t// this.registerTableOption(\"paginationDataReceived\", {}); //pagination data received from the server\r\n\t\tthis.registerTableOption(\"paginationAddRow\", \"page\"); //add rows on table or page\r\n\t\t\r\n\t\tthis.registerTableOption(\"progressiveLoad\", false); //progressive loading\r\n\t\tthis.registerTableOption(\"progressiveLoadDelay\", 0); //delay between requests\r\n\t\tthis.registerTableOption(\"progressiveLoadScrollMargin\", 0); //margin before scroll begins\r\n\t\t\r\n\t\tthis.registerTableFunction(\"setMaxPage\", this.setMaxPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPage\", this.setPage.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageToRow\", this.userSetPageToRow.bind(this));\r\n\t\tthis.registerTableFunction(\"setPageSize\", this.userSetPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageSize\", this.getPageSize.bind(this));\r\n\t\tthis.registerTableFunction(\"previousPage\", this.previousPage.bind(this));\r\n\t\tthis.registerTableFunction(\"nextPage\", this.nextPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPage\", this.getPage.bind(this));\r\n\t\tthis.registerTableFunction(\"getPageMax\", this.getPageMax.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"pageTo\", this.setPageToRow.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.subscribe(\"row-deleted\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"row-added\", this.rowsUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"footer-redraw\", this.footerRedraw.bind(this));\r\n\r\n\t\t\tif(this.table.options.paginationAddRow == \"page\"){\r\n\t\t\t\tthis.subscribe(\"row-adding-position\", this.rowAddingPosition.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationMode === \"remote\"){\r\n\t\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad){\r\n\t\t\t\tconsole.error(\"Progressive Load Error - Pagination and progressive load cannot be used at the same time\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.registerDisplayHandler(this.restOnRenderBefore.bind(this), 40);\r\n\t\t\tthis.registerDisplayHandler(this.getRows.bind(this), 50);\r\n\t\t\t\r\n\t\t\tthis.createElements();\r\n\t\t\tthis.initializePageCounter();\r\n\t\t\tthis.initializePaginator();\r\n\t\t}else if(this.table.options.progressiveLoad){\r\n\t\t\tthis.subscribe(\"data-params\", this.remotePageParams.bind(this));\r\n\t\t\tthis.subscribe(\"data-loaded\", this._parseRemoteData.bind(this));\r\n\t\t\tthis.subscribe(\"table-built\", this.calculatePageSizes.bind(this));\r\n\t\t\tthis.subscribe(\"data-processed\", this.initialLoadComplete.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initializeProgressive(this.table.options.progressiveLoad);\r\n\t\t\t\r\n\t\t\tif(this.table.options.progressiveLoad === \"scroll\"){\r\n\t\t\t\tthis.subscribe(\"scroll-vertical\", this.scrollVertical.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowAddingPosition(row, top){\r\n\t\tvar rowManager = this.table.rowManager,\r\n\t\tdisplayRows = rowManager.getDisplayRows(),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(top){\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[0];\r\n\t\t\t}else{\r\n\t\t\t\tif(rowManager.activeRows.length){\r\n\t\t\t\t\tindex = rowManager.activeRows[rowManager.activeRows.length-1];\r\n\t\t\t\t\ttop = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(displayRows.length){\r\n\t\t\t\tindex = displayRows[displayRows.length - 1];\r\n\t\t\t\ttop = displayRows.length < this.size ? false : true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn {index, top};\r\n\t}\r\n\t\r\n\tcalculatePageSizes(){\r\n\t\tvar testElRow, testElCell;\r\n\t\t\r\n\t\tif(this.table.options.paginationSize){\r\n\t\t\tthis.size = this.table.options.paginationSize;\r\n\t\t}else{\r\n\t\t\ttestElRow = document.createElement(\"div\");\r\n\t\t\ttestElRow.classList.add(\"tabulator-row\");\r\n\t\t\ttestElRow.style.visibility = \"hidden\";\r\n\t\t\t\r\n\t\t\ttestElCell = document.createElement(\"div\");\r\n\t\t\ttestElCell.classList.add(\"tabulator-cell\");\r\n\t\t\ttestElCell.innerHTML = \"Page Row Test\";\r\n\t\t\t\r\n\t\t\ttestElRow.appendChild(testElCell);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().appendChild(testElRow);\r\n\t\t\t\r\n\t\t\tthis.size = Math.floor(this.table.rowManager.getElement().clientHeight / testElRow.offsetHeight);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.getTableElement().removeChild(testElRow);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"pageSizeChanged\", this.size);\r\n\t\t\r\n\t\tthis.generatePageSizeSelectList();\r\n\t}\r\n\t\r\n\tinitialLoadComplete(){\r\n\t\tthis.initialLoad = false;\r\n\t}\r\n\t\r\n\tremotePageParams(data, config, silent, params){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif((this.progressiveLoad && !silent) || (!this.progressiveLoad && !this.dataChanging)){\r\n\t\t\t\tthis.reset(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//configure request params\r\n\t\tparams.page = this.page;\r\n\t\t\r\n\t\t//set page size if defined\r\n\t\tif(this.size){\r\n\t\t\tparams.size = this.size;\r\n\t\t}\r\n\t\t\r\n\t\treturn params;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tuserSetPageToRow(row){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\trow = this.rowManager.findRow(row);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\treturn this.setPageToRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Promise.reject();\r\n\t}\r\n\t\r\n\tuserSetPageSize(size){\r\n\t\tif(this.table.options.pagination){\r\n\t\t\tthis.setPageSize(size);\r\n\t\t\treturn this.setPage(1);\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tscrollVertical(top, dir){\r\n\t\tvar element, diff, margin;\r\n\t\tif(!dir && !this.table.dataLoader.loading){\r\n\t\t\telement = this.table.rowManager.getElement();\r\n\t\t\tdiff = element.scrollHeight - element.clientHeight - top;\r\n\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (element.clientHeight * 2);\r\n\t\t\t\r\n\t\t\tif(diff < margin){\r\n\t\t\t\tthis.nextPage()\r\n\t\t\t\t\t.catch(() => {}); //consume the exception thrown when on the last page\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trestOnRenderBefore(rows, renderInPosition){\r\n\t\tif(!renderInPosition){\r\n\t\t\tif(this.mode === \"local\"){\r\n\t\t\t\tthis.reset();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\trowsUpdated(){\r\n\t\tthis.refreshData(true, \"all\");\r\n\t}\r\n\t\r\n\tcreateElements(){\r\n\t\tvar button;\r\n\t\t\r\n\t\tthis.element = document.createElement(\"span\");\r\n\t\tthis.element.classList.add(\"tabulator-paginator\");\r\n\t\t\r\n\t\tthis.pagesElement = document.createElement(\"span\");\r\n\t\tthis.pagesElement.classList.add(\"tabulator-pages\");\r\n\t\t\r\n\t\tbutton = document.createElement(\"button\");\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\tbutton.setAttribute(\"aria-label\", \"\");\r\n\t\tbutton.setAttribute(\"title\", \"\");\r\n\t\t\r\n\t\tthis.firstBut = button.cloneNode(true);\r\n\t\tthis.firstBut.setAttribute(\"data-page\", \"first\");\r\n\t\t\r\n\t\tthis.prevBut = button.cloneNode(true);\r\n\t\tthis.prevBut.setAttribute(\"data-page\", \"prev\");\r\n\t\t\r\n\t\tthis.nextBut = button.cloneNode(true);\r\n\t\tthis.nextBut.setAttribute(\"data-page\", \"next\");\r\n\t\t\r\n\t\tthis.lastBut = button.cloneNode(true);\r\n\t\tthis.lastBut.setAttribute(\"data-page\", \"last\");\r\n\t\t\r\n\t\tif(this.table.options.paginationSizeSelector){\r\n\t\t\tthis.pageSizeSelect = document.createElement(\"select\");\r\n\t\t\tthis.pageSizeSelect.classList.add(\"tabulator-page-size\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tgeneratePageSizeSelectList(){\r\n\t\tvar pageSizes = [];\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(this.table.options.paginationSizeSelector)){\r\n\t\t\t\tpageSizes = this.table.options.paginationSizeSelector;\r\n\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes.unshift(this.size);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\tif(this.pageSizes.indexOf(this.size) == -1){\r\n\t\t\t\t\tpageSizes = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (let i = 1; i < 5; i++){\r\n\t\t\t\t\t\tpageSizes.push(this.size * i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.pageSizes = pageSizes;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpageSizes = this.pageSizes;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile(this.pageSizeSelect.firstChild) this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);\r\n\t\t\t\r\n\t\t\tpageSizes.forEach((item) => {\r\n\t\t\t\tvar itemEl = document.createElement(\"option\");\r\n\t\t\t\titemEl.value = item;\r\n\t\t\t\t\r\n\t\t\t\tif(item === true){\r\n\t\t\t\t\tthis.langBind(\"pagination|all\", function(value){\r\n\t\t\t\t\t\titemEl.innerHTML = value;\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\titemEl.innerHTML = item;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.appendChild(itemEl);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.pageSizeSelect.value = this.size;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializePageCounter(){\r\n\t\tvar counter = this.table.options.paginationCounter,\r\n\t\tpageCounter = null;\r\n\t\t\r\n\t\tif(counter){\r\n\t\t\tif(typeof counter === \"function\"){\r\n\t\t\t\tpageCounter = counter;\r\n\t\t\t}else{\r\n\t\t\t\tpageCounter = Page.pageCounters[counter];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(pageCounter){\r\n\t\t\t\tthis.pageCounter = pageCounter;\r\n\t\t\t\t\r\n\t\t\t\tthis.pageCounterElement = document.createElement(\"span\");\r\n\t\t\t\tthis.pageCounterElement.classList.add(\"tabulator-page-counter\");\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Pagination Error - No such page counter found: \", counter);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup pagination\r\n\tinitializePaginator(hidden){\r\n\t\tvar pageSelectLabel, paginationCounterHolder;\r\n\t\t\r\n\t\tif(!hidden){\r\n\t\t\t//build pagination element\r\n\t\t\t\r\n\t\t\t//bind localizations\r\n\t\t\tthis.langBind(\"pagination|first\", (value) => {\r\n\t\t\t\tthis.firstBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|first_title\", (value) => {\r\n\t\t\t\tthis.firstBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.firstBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev\", (value) => {\r\n\t\t\t\tthis.prevBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|prev_title\", (value) => {\r\n\t\t\t\tthis.prevBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.prevBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next\", (value) => {\r\n\t\t\t\tthis.nextBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|next_title\", (value) => {\r\n\t\t\t\tthis.nextBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.nextBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last\", (value) => {\r\n\t\t\t\tthis.lastBut.innerHTML = value;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.langBind(\"pagination|last_title\", (value) => {\r\n\t\t\t\tthis.lastBut.setAttribute(\"aria-label\", value);\r\n\t\t\t\tthis.lastBut.setAttribute(\"title\", value);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//click bindings\r\n\t\t\tthis.firstBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(1);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.prevBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.previousPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.nextBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.nextPage();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.lastBut.addEventListener(\"click\", () => {\r\n\t\t\t\tthis.setPage(this.max);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(this.table.options.paginationElement){\r\n\t\t\t\tthis.element = this.table.options.paginationElement;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.pageSizeSelect){\r\n\t\t\t\tpageSelectLabel = document.createElement(\"label\");\r\n\t\t\t\t\r\n\t\t\t\tthis.langBind(\"pagination|page_size\", (value) => {\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"aria-label\", value);\r\n\t\t\t\t\tthis.pageSizeSelect.setAttribute(\"title\", value);\r\n\t\t\t\t\tpageSelectLabel.innerHTML = value;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.element.appendChild(pageSelectLabel);\r\n\t\t\t\tthis.element.appendChild(this.pageSizeSelect);\r\n\t\t\t\t\r\n\t\t\t\tthis.pageSizeSelect.addEventListener(\"change\", (e) => {\r\n\t\t\t\t\tthis.setPageSize(this.pageSizeSelect.value == \"true\" ? true : this.pageSizeSelect.value);\r\n\t\t\t\t\tthis.setPage(1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//append to DOM\r\n\t\t\tthis.element.appendChild(this.firstBut);\r\n\t\t\tthis.element.appendChild(this.prevBut);\r\n\t\t\tthis.element.appendChild(this.pagesElement);\r\n\t\t\tthis.element.appendChild(this.nextBut);\r\n\t\t\tthis.element.appendChild(this.lastBut);\r\n\t\t\t\r\n\t\t\tif(!this.table.options.paginationElement){\r\n\t\t\t\tif(this.table.options.paginationCounter){\r\n\r\n\t\t\t\t\tpaginationCounterHolder; \r\n\r\n\t\t\t\t\tif(this.table.options.paginationCounterElement){\r\n\t\t\t\t\t\tif(this.table.options.paginationCounterElement instanceof HTMLElement){\r\n\t\t\t\t\t\t\tthis.table.options.paginationCounterElement.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t}else if(typeof this.table.options.paginationCounterElement === \"string\"){\r\n\t\t\t\t\t\t\tpaginationCounterHolder = document.querySelector(this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(paginationCounterHolder){\r\n\t\t\t\t\t\t\t\tpaginationCounterHolder.appendChild(this.pageCounterElement);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Pagination Error - Unable to find element matching paginationCounterElement selector:\", this.table.options.paginationCounterElement);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.footerAppend(this.pageCounterElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.footerAppend(this.element);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.page = this.table.options.paginationInitialPage;\r\n\t\t\tthis.count = this.table.options.paginationButtonCount;\r\n\t\t}\r\n\t\t\r\n\t\t//set default values\r\n\t\tthis.mode = this.table.options.paginationMode;\r\n\t}\r\n\t\r\n\tinitializeProgressive(mode){\r\n\t\tthis.initializePaginator(true);\r\n\t\tthis.mode = \"progressive_\" + mode;\r\n\t\tthis.progressiveLoad = true;\r\n\t}\r\n\t\r\n\ttrackChanges(){\r\n\t\tthis.dispatch(\"page-changed\");\r\n\t}\r\n\t\r\n\t//calculate maximum page from number of rows\r\n\tsetMaxRows(rowCount){\r\n\t\tif(!rowCount){\r\n\t\t\tthis.max = 1;\r\n\t\t}else{\r\n\t\t\tthis.max = this.size === true ? 1 : Math.ceil(rowCount/this.size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//reset to first page without triggering action\r\n\treset(force){\r\n\t\tif(!this.initialLoad){\r\n\t\t\tif(this.mode == \"local\" || force){\r\n\t\t\t\tthis.page = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set the maximum page\r\n\tsetMaxPage(max){\r\n\t\t\r\n\t\tmax = parseInt(max);\r\n\t\t\r\n\t\tthis.max = max || 1;\r\n\t\t\r\n\t\tif(this.page > this.max){\r\n\t\t\tthis.page = this.max;\r\n\t\t\tthis.trigger();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set current page number\r\n\tsetPage(page){\r\n\t\tswitch(page){\r\n\t\t\tcase \"first\":\r\n\t\t\t\treturn this.setPage(1);\r\n\t\r\n\t\t\tcase \"prev\":\r\n\t\t\t\treturn this.previousPage();\r\n\t\t\t\r\n\t\t\tcase \"next\":\r\n\t\t\t\treturn this.nextPage();\r\n\t\t\t\r\n\t\t\tcase \"last\":\r\n\t\t\t\treturn this.setPage(this.max);\r\n\t\t}\r\n\t\t\r\n\t\tpage = parseInt(page);\r\n\t\t\r\n\t\tif((page > 0 && page <= this.max) || this.mode !== \"local\"){\r\n\t\t\tthis.page = page;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested page is out of range of 1 - \" + this.max + \":\", page);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageToRow(row){\r\n\t\tvar rows = this.displayRows(-1);\r\n\t\tvar index = rows.indexOf(row);\r\n\t\r\n\t\tif(index > -1){\r\n\t\t\tvar page = this.size === true ? 1 : Math.ceil((index + 1) / this.size);\r\n\t\t\t\r\n\t\t\treturn this.setPage(page);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Requested row is not visible\");\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetPageSize(size){\r\n\t\tif(size !== true){\r\n\t\t\tsize = parseInt(size);\r\n\t\t}\r\n\r\n\t\tif(size > 0){\r\n\t\t\tthis.size = size;\r\n\t\t\tthis.dispatchExternal(\"pageSizeChanged\", size);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.pageSizeSelect){\r\n\t\t\t// this.pageSizeSelect.value = size;\r\n\t\t\tthis.generatePageSizeSelectList();\r\n\t\t}\r\n\t\t\r\n\t\tthis.trackChanges();\r\n\t}\r\n\t\r\n\t_setPageCounter(totalRows, size, currentRow){\r\n\t\tvar content;\r\n\t\t\r\n\t\tif(this.pageCounter){\r\n\r\n\t\t\tif(this.mode === \"remote\"){\r\n\t\t\t\tsize = this.size;\r\n\t\t\t\tcurrentRow = ((this.page - 1) * this.size) + 1;\r\n\t\t\t\ttotalRows = this.remoteRowCountEstimate;\r\n\t\t\t}\r\n\r\n\t\t\tcontent = this.pageCounter.call(this, size, currentRow, this.page, totalRows, this.max);\r\n\t\t\t\r\n\t\t\tswitch(typeof content){\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tif(content instanceof Node){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//clear previous cell contents\r\n\t\t\t\t\t\twhile(this.pageCounterElement.firstChild) this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.pageCounterElement.appendChild(content);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(content != null){\r\n\t\t\t\t\t\t\tconsole.warn(\"Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:\", content);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.pageCounterElement.innerHTML = content;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//setup the pagination buttons\r\n\t_setPageButtons(){\r\n\t\tlet leftSize = Math.floor((this.count-1) / 2);\r\n\t\tlet rightSize = Math.ceil((this.count-1) / 2);\r\n\t\tlet min = this.max - this.page + leftSize + 1 < this.count ? this.max-this.count+1: Math.max(this.page-leftSize,1);\r\n\t\tlet max = this.page <= rightSize? Math.min(this.count, this.max) :Math.min(this.page+rightSize, this.max);\r\n\t\t\r\n\t\twhile(this.pagesElement.firstChild) this.pagesElement.removeChild(this.pagesElement.firstChild);\r\n\t\t\r\n\t\tif(this.page == 1){\r\n\t\t\tthis.firstBut.disabled = true;\r\n\t\t\tthis.prevBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.firstBut.disabled = false;\r\n\t\t\tthis.prevBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.page == this.max){\r\n\t\t\tthis.lastBut.disabled = true;\r\n\t\t\tthis.nextBut.disabled = true;\r\n\t\t}else{\r\n\t\t\tthis.lastBut.disabled = false;\r\n\t\t\tthis.nextBut.disabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tfor(let i = min; i <= max; i++){\r\n\t\t\tif(i>0 && i <= this.max){\r\n\t\t\t\tthis.pagesElement.appendChild(this._generatePageButton(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.footerRedraw();\r\n\t}\r\n\t\r\n\t_generatePageButton(page){\r\n\t\tvar button = document.createElement(\"button\");\r\n\t\t\r\n\t\tbutton.classList.add(\"tabulator-page\");\r\n\t\tif(page == this.page){\r\n\t\t\tbutton.classList.add(\"active\");\r\n\t\t}\r\n\t\t\r\n\t\tbutton.setAttribute(\"type\", \"button\");\r\n\t\tbutton.setAttribute(\"role\", \"button\");\r\n\t\t\r\n\t\tthis.langBind(\"pagination|page_title\", (value) => {\r\n\t\t\tbutton.setAttribute(\"aria-label\", value + \" \" + page);\r\n\t\t\tbutton.setAttribute(\"title\", value + \" \" + page);\r\n\t\t});\r\n\t\t\r\n\t\tbutton.setAttribute(\"data-page\", page);\r\n\t\tbutton.textContent = page;\r\n\t\t\r\n\t\tbutton.addEventListener(\"click\", (e) => {\r\n\t\t\tthis.setPage(page);\r\n\t\t});\r\n\t\t\r\n\t\treturn button;\r\n\t}\r\n\t\r\n\t//previous page\r\n\tpreviousPage(){\r\n\t\tif(this.page > 1){\r\n\t\t\tthis.page--;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Pagination Error - Previous page would be less than page 1:\", 0);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//next page\r\n\tnextPage(){\r\n\t\tif(this.page < this.max){\r\n\t\t\tthis.page++;\r\n\t\t\t\r\n\t\t\tthis.trackChanges();\r\n\t\t\t\r\n\t\t\treturn this.trigger();\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(!this.progressiveLoad){\r\n\t\t\t\tconsole.warn(\"Pagination Error - Next page would be greater than maximum page of \" + this.max + \":\", this.max + 1);\r\n\t\t\t}\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return current page number\r\n\tgetPage(){\r\n\t\treturn this.page;\r\n\t}\r\n\t\r\n\t//return max page number\r\n\tgetPageMax(){\r\n\t\treturn this.max;\r\n\t}\r\n\t\r\n\tgetPageSize(size){\r\n\t\treturn this.size;\r\n\t}\r\n\t\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\t\r\n\t//return appropriate rows for current page\r\n\tgetRows(data){\r\n\t\tvar actualRowPageSize = 0,\r\n\t\toutput, start, end, actualStartRow;\r\n\r\n\t\tvar actualRows = data.filter((row) => {\r\n\t\t\treturn row.type === \"row\";\r\n\t\t});\r\n\t\t\r\n\t\tif(this.mode == \"local\"){\r\n\t\t\toutput = [];\r\n\t\t\t\r\n\t\t\tthis.setMaxRows(data.length);\r\n\t\t\t\r\n\t\t\tif(this.size === true){\r\n\t\t\t\tstart = 0;\r\n\t\t\t\tend = data.length;\r\n\t\t\t}else{\r\n\t\t\t\tstart = this.size * (this.page - 1);\r\n\t\t\t\tend = start + parseInt(this.size);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageButtons();\r\n\t\t\t\r\n\t\t\tfor(let i = start; i < end; i++){\r\n\t\t\t\tlet row = data[i];\r\n\r\n\t\t\t\tif(row){\r\n\t\t\t\t\toutput.push(row);\r\n\r\n\t\t\t\t\tif(row.type === \"row\"){\r\n\t\t\t\t\t\tif(!actualStartRow){\r\n\t\t\t\t\t\t\tactualStartRow = row;\r\n\t\t\t\t\t\t}\t\r\n\r\n\t\t\t\t\t\tactualRowPageSize++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._setPageCounter(actualRows.length, actualRowPageSize, actualStartRow ? (actualRows.indexOf(actualStartRow) + 1) : 0);\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t}else{\r\n\t\t\tthis._setPageButtons();\r\n\t\t\tthis._setPageCounter(actualRows.length);\r\n\t\t\t\r\n\t\t\treturn data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrigger(){\r\n\t\tvar left;\r\n\t\t\r\n\t\tswitch(this.mode){\r\n\t\t\tcase \"local\":\r\n\t\t\t\tleft = this.table.rowManager.scrollLeft;\r\n\t\t\t\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\r\n\t\t\t\treturn Promise.resolve();\r\n\t\t\t\r\n\t\t\tcase \"remote\":\r\n\t\t\t\tthis.dataChanging = true;\r\n\t\t\t\treturn this.reloadData(null)\r\n\t\t\t\t\t.finally(() => {\r\n\t\t\t\t\t\tthis.dataChanging = false;\r\n\t\t\t\t\t});\r\n\t\t\t\r\n\t\t\tcase \"progressive_load\":\r\n\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\treturn this.reloadData(null, true);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn(\"Pagination Error - no such pagination mode:\", this.mode);\r\n\t\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_parseRemoteData(data){\r\n\t\tvar margin;\r\n\t\t\r\n\t\tif(typeof data.last_page === \"undefined\"){\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").last_page || \"last_page\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\tif(data.data){\r\n\t\t\tthis.max = parseInt(data.last_page) || 1;\r\n\r\n\t\t\tthis.remoteRowCountEstimate = typeof data.last_row !== \"undefined\" ? data.last_row : (data.last_page * this.size - (this.page == data.last_page ? (this.size - data.data.length) : 0));\r\n\t\t\t\r\n\t\t\tif(this.progressiveLoad){\r\n\t\t\t\tswitch(this.mode){\r\n\t\t\t\t\tcase \"progressive_load\":\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page == 1){\r\n\t\t\t\t\t\t\tthis.table.rowManager.setData(data.data, false, this.page == 1);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.table.rowManager.addRows(data.data);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t}, this.table.options.progressiveLoadDelay);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"progressive_scroll\":\r\n\t\t\t\t\t\tdata = this.page === 1 ? data.data : this.table.rowManager.getData().concat(data.data);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.rowManager.setData(data, this.page !== 1, this.page == 1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tmargin = this.table.options.progressiveLoadScrollMargin || (this.table.rowManager.element.clientHeight * 2);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.rowManager.element.scrollHeight <= (this.table.rowManager.element.clientHeight + margin)){\r\n\t\t\t\t\t\t\tif(this.page < this.max){\r\n\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tthis.nextPage();\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t// left = this.table.rowManager.scrollLeft;\r\n\t\t\t\tthis.dispatchExternal(\"pageLoaded\", this.getPage());\r\n\t\t\t\t// this.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\t// this.table.columnManager.scrollHorizontal(left);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Remote Pagination Error - Server response missing '\" + (this.options(\"dataReceiveParams\").data || \"data\") + \"' property\");\r\n\t\t}\r\n\t\t\r\n\t\treturn data.data;\r\n\t}\r\n\t\r\n\t//handle the footer element being redrawn\r\n\tfooterRedraw(){\r\n\t\tvar footer = this.table.footerManager.containerElement;\r\n\r\n\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t}else{\r\n\t\t\tthis.pagesElement.style.display = '';\r\n\t\t\t\r\n\t\t\tif((Math.ceil(footer.clientWidth) - footer.scrollWidth) < 0){\r\n\t\t\t\tthis.pagesElement.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nPage.moduleName = \"page\";\r\n\r\n//load defaults\r\nPage.pageCounters = defaultPageCounters;\r\n\r\nexport default Page;\r\n","// read persistance information from storage\r\nexport default {\r\n\tlocal:function(id, type){\r\n\t\tvar data = localStorage.getItem(id + \"-\" + type);\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t},\r\n\tcookie:function(id, type){\r\n\t\tvar cookie = document.cookie,\r\n\t\tkey = id + \"-\" + type,\r\n\t\tcookiePos = cookie.indexOf(key + \"=\"),\r\n\t\tend, data;\r\n\r\n\t\t//if cookie exists, decode and load column data into tabulator\r\n\t\tif(cookiePos > -1){\r\n\t\t\tcookie = cookie.slice(cookiePos);\r\n\r\n\t\t\tend = cookie.indexOf(\";\");\r\n\r\n\t\t\tif(end > -1){\r\n\t\t\t\tcookie = cookie.slice(0, end);\r\n\t\t\t}\r\n\r\n\t\t\tdata = cookie.replace(key + \"=\", \"\");\r\n\t\t}\r\n\r\n\t\treturn data ? JSON.parse(data) : false;\r\n\t}\r\n};\r\n","//write persistence information to storage\r\nexport default {\r\n\tlocal:function(id, type, data){\r\n\t\tlocalStorage.setItem(id + \"-\" + type, JSON.stringify(data));\r\n\t},\r\n\tcookie:function(id, type, data){\r\n\t\tvar expireDate = new Date();\r\n\r\n\t\texpireDate.setDate(expireDate.getDate() + 10000);\r\n\r\n\t\tdocument.cookie = id + \"-\" + type + \"=\" + JSON.stringify(data) + \"; expires=\" + expireDate.toUTCString();\r\n\t}\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultReaders from './defaults/readers.js';\r\nimport defaultWriters from './defaults/writers.js';\r\n\r\nclass Persistence extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.mode = \"\";\r\n\t\tthis.id = \"\";\r\n\t\t// this.persistProps = [\"field\", \"width\", \"visible\"];\r\n\t\tthis.defWatcherBlock = false;\r\n\t\tthis.config = {};\r\n\t\tthis.readFunc = false;\r\n\t\tthis.writeFunc = false;\r\n\r\n\t\tthis.registerTableOption(\"persistence\", false);\r\n\t\tthis.registerTableOption(\"persistenceID\", \"\"); //key for persistent storage\r\n\t\tthis.registerTableOption(\"persistenceMode\", true); //mode for storing persistence information\r\n\t\tthis.registerTableOption(\"persistenceReaderFunc\", false); //function for handling persistence data reading\r\n\t\tthis.registerTableOption(\"persistenceWriterFunc\", false); //function for handling persistence data writing\r\n\t}\r\n\r\n\t// Test for whether localStorage is available for use.\r\n\tlocalStorageTest() {\r\n\t\tvar testKey = \"_tabulator_test\";\r\n\r\n\t\ttry {\r\n\t\t\twindow.localStorage.setItem( testKey, testKey);\r\n\t\t\twindow.localStorage.removeItem( testKey );\r\n\t\t\treturn true;\r\n\t\t} catch(e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup parameters\r\n\tinitialize(){\r\n\t\tif(this.table.options.persistence){\r\n\t\t\t//determine persistent layout storage type\r\n\t\t\tvar mode = this.table.options.persistenceMode,\r\n\t\t\tid = this.table.options.persistenceID,\r\n\t\t\tretrievedData;\r\n\r\n\t\t\tthis.mode = mode !== true ? mode : (this.localStorageTest() ? \"local\" : \"cookie\");\r\n\r\n\t\t\tif(this.table.options.persistenceReaderFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceReaderFunc === \"function\"){\r\n\t\t\t\t\tthis.readFunc = this.table.options.persistenceReaderFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.readers[this.table.options.persistenceReaderFunc]){\r\n\t\t\t\t\t\tthis.readFunc = Persistence.readers[this.table.options.persistenceReaderFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.table.options.persistenceReaderFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.readers[this.mode]){\r\n\t\t\t\t\tthis.readFunc = Persistence.readers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Read Error - invalid reader set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.table.options.persistenceWriterFunc){\r\n\t\t\t\tif(typeof this.table.options.persistenceWriterFunc === \"function\"){\r\n\t\t\t\t\tthis.writeFunc = this.table.options.persistenceWriterFunc;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(Persistence.writers[this.table.options.persistenceWriterFunc]){\r\n\t\t\t\t\t\tthis.writeFunc = Persistence.writers[this.table.options.persistenceWriterFunc];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid reader set\", this.table.options.persistenceWriterFunc);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(Persistence.writers[this.mode]){\r\n\t\t\t\t\tthis.writeFunc = Persistence.writers[this.mode];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Persistence Write Error - invalid writer set\", this.mode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//set storage tag\r\n\t\t\tthis.id = \"tabulator-\" + (id || (this.table.element.getAttribute(\"id\") || \"\"));\r\n\r\n\t\t\tthis.config = {\r\n\t\t\t\tsort:this.table.options.persistence === true || this.table.options.persistence.sort,\r\n\t\t\t\tfilter:this.table.options.persistence === true || this.table.options.persistence.filter,\r\n\t\t\t\tgroup:this.table.options.persistence === true || this.table.options.persistence.group,\r\n\t\t\t\tpage:this.table.options.persistence === true || this.table.options.persistence.page,\r\n\t\t\t\tcolumns:this.table.options.persistence === true ? [\"title\", \"width\", \"visible\"] : this.table.options.persistence.columns,\r\n\t\t\t};\r\n\r\n\t\t\t//load pagination data if needed\r\n\t\t\tif(this.config.page){\r\n\t\t\t\tretrievedData = this.retrieveData(\"page\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.paginationSize !== \"undefined\" && (this.config.page === true || this.config.page.size)){\r\n\t\t\t\t\t\tthis.table.options.paginationSize = retrievedData.paginationSize;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(typeof retrievedData.paginationInitialPage !== \"undefined\" && (this.config.page === true || this.config.page.page)){\r\n\t\t\t\t\t\tthis.table.options.paginationInitialPage = retrievedData.paginationInitialPage;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//load group data if needed\r\n\t\t\tif(this.config.group){\r\n\t\t\t\tretrievedData = this.retrieveData(\"group\");\r\n\r\n\t\t\t\tif(retrievedData){\r\n\t\t\t\t\tif(typeof retrievedData.groupBy !== \"undefined\" && (this.config.group === true || this.config.group.groupBy)){\r\n\t\t\t\t\t\tthis.table.options.groupBy = retrievedData.groupBy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupStartOpen !== \"undefined\" && (this.config.group === true || this.config.group.groupStartOpen)){\r\n\t\t\t\t\t\tthis.table.options.groupStartOpen = retrievedData.groupStartOpen;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(typeof retrievedData.groupHeader !== \"undefined\" && (this.config.group === true || this.config.group.groupHeader)){\r\n\t\t\t\t\t\tthis.table.options.groupHeader = retrievedData.groupHeader;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.columns){\r\n\t\t\t\tthis.table.options.columns = this.load(\"columns\", this.table.options.columns);\r\n\t\t\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t\t\t\tthis.subscribe(\"column-show\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-hide\", this.save.bind(this, \"columns\"));\r\n\t\t\t\tthis.subscribe(\"column-moved\", this.save.bind(this, \"columns\"));\r\n\t\t\t}\r\n\r\n\t\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this), 0);\r\n\r\n\t\t\tthis.subscribe(\"table-redraw\", this.tableRedraw.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"filter-changed\", this.eventSave.bind(this, \"filter\"));\r\n\t\t\tthis.subscribe(\"sort-changed\", this.eventSave.bind(this, \"sort\"));\r\n\t\t\tthis.subscribe(\"group-changed\", this.eventSave.bind(this, \"group\"));\r\n\t\t\tthis.subscribe(\"page-changed\", this.eventSave.bind(this, \"page\"));\r\n\t\t\tthis.subscribe(\"column-resized\", this.eventSave.bind(this, \"columns\"));\r\n\t\t\tthis.subscribe(\"layout-refreshed\", this.eventSave.bind(this, \"columns\"));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"getColumnLayout\", this.getColumnLayout.bind(this));\r\n\t\tthis.registerTableFunction(\"setColumnLayout\", this.setColumnLayout.bind(this));\r\n\t}\r\n\r\n\teventSave(type){\r\n\t\tif(this.config[type]){\r\n\t\t\tthis.save(type);\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tvar sorters, filters;\r\n\r\n\t\tif(this.config.sort){\r\n\t\t\tsorters = this.load(\"sort\");\r\n\r\n\t\t\tif(!sorters === false){\r\n\t\t\t\tthis.table.options.initialSort = sorters;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.config.filter){\r\n\t\t\tfilters = this.load(\"filter\");\r\n\r\n\t\t\tif(!filters === false){\r\n\t\t\t\tthis.table.options.initialFilter = filters;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif(force && this.config.columns){\r\n\t\t\tthis.save(\"columns\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tgetColumnLayout(){\r\n\t\treturn this.parseColumns(this.table.columnManager.getColumns());\r\n\t}\r\n\r\n\tsetColumnLayout(layout){\r\n\t\tthis.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns, layout));\r\n\t\treturn true;\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\tinitializeColumn(column){\r\n\t\tvar def, keys;\r\n\r\n\t\tif(this.config.columns){\r\n\t\t\tthis.defWatcherBlock = true;\r\n\r\n\t\t\tdef = column.getDefinition();\r\n\r\n\t\t\tkeys = this.config.columns === true ? Object.keys(def) : this.config.columns;\r\n\r\n\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\tvar props = Object.getOwnPropertyDescriptor(def, key);\r\n\t\t\t\tvar value = def[key];\r\n\r\n\t\t\t\tif(props){\r\n\t\t\t\t\tObject.defineProperty(def, key, {\r\n\t\t\t\t\t\tset: (newValue) => {\r\n\t\t\t\t\t\t\tvalue = newValue;\r\n\r\n\t\t\t\t\t\t\tif(!this.defWatcherBlock){\r\n\t\t\t\t\t\t\t\tthis.save(\"columns\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif(props.set){\r\n\t\t\t\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tget:() => {\r\n\t\t\t\t\t\t\tif(props.get){\r\n\t\t\t\t\t\t\t\tprops.get();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.defWatcherBlock = false;\r\n\t\t}\r\n\t}\r\n\r\n\t//load saved definitions\r\n\tload(type, current){\r\n\t\tvar data = this.retrieveData(type);\r\n\r\n\t\tif(current){\r\n\t\t\tdata = data ? this.mergeDefinition(current, data) : current;\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//retrieve data from memory\r\n\tretrieveData(type){\r\n\t\treturn this.readFunc ? this.readFunc(this.id, type) : false;\r\n\t}\r\n\r\n\t//merge old and new column definitions\r\n\tmergeDefinition(oldCols, newCols){\r\n\t\tvar output = [];\r\n\r\n\t\tnewCols = newCols || [];\r\n\r\n\t\tnewCols.forEach((column, to) => {\r\n\t\t\tvar from = this._findColumn(oldCols, column),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(from){\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(from);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tif(key !== \"columns\" && typeof column[key] !== \"undefined\"){\r\n\t\t\t\t\t\tfrom[key] = column[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(from.columns){\r\n\t\t\t\t\tfrom.columns = this.mergeDefinition(from.columns, column.columns);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutput.push(from);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\toldCols.forEach((column, i) => {\r\n\t\t\tvar from = this._findColumn(newCols, column);\r\n\r\n\t\t\tif (!from) {\r\n\t\t\t\tif(output.length>i){\r\n\t\t\t\t\toutput.splice(i, 0, column);\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push(column);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\t//find matching columns\r\n\t_findColumn(columns, subject){\r\n\t\tvar type = subject.columns ? \"group\" : (subject.field ? \"field\" : \"object\");\r\n\r\n\t\treturn columns.find(function(col){\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"group\":\r\n\t\t\t\t\treturn col.title === subject.title && col.columns.length === subject.columns.length;\r\n\r\n\t\t\t\tcase \"field\":\r\n\t\t\t\t\treturn col.field === subject.field;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\treturn col === subject;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//save data\r\n\tsave(type){\r\n\t\tvar data = {};\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"columns\":\r\n\t\t\t\tdata = this.parseColumns(this.table.columnManager.getColumns());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"filter\":\r\n\t\t\t\tdata = this.table.modules.filter.getFilters();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sort\":\r\n\t\t\t\tdata = this.validateSorters(this.table.modules.sort.getSort());\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"group\":\r\n\t\t\t\tdata = this.getGroupConfig();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"page\":\r\n\t\t\t\tdata = this.getPageConfig();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(this.writeFunc){\r\n\t\t\tthis.writeFunc(this.id, type, data);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//ensure sorters contain no function data\r\n\tvalidateSorters(data){\r\n\t\tdata.forEach(function(item){\r\n\t\t\titem.column = item.field;\r\n\t\t\tdelete item.field;\r\n\t\t});\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetGroupConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.group){\r\n\t\t\tif(this.config.group === true || this.config.group.groupBy){\r\n\t\t\t\tdata.groupBy = this.table.options.groupBy;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupStartOpen){\r\n\t\t\t\tdata.groupStartOpen = this.table.options.groupStartOpen;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.group === true || this.config.group.groupHeader){\r\n\t\t\t\tdata.groupHeader = this.table.options.groupHeader;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\tgetPageConfig(){\r\n\t\tvar data = {};\r\n\r\n\t\tif(this.config.page){\r\n\t\t\tif(this.config.page === true || this.config.page.size){\r\n\t\t\t\tdata.paginationSize = this.table.modules.page.getPageSize();\r\n\t\t\t}\r\n\r\n\t\t\tif(this.config.page === true || this.config.page.page){\r\n\t\t\t\tdata.paginationInitialPage = this.table.modules.page.getPage();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\r\n\t//parse columns for data to store\r\n\tparseColumns(columns){\r\n\t\tvar definitions = [],\r\n\t\texcludedKeys = [\"headerContextMenu\", \"headerMenu\", \"contextMenu\", \"clickMenu\"];\r\n\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\tvar defStore = {},\r\n\t\t\tcolDef = column.getDefinition(),\r\n\t\t\tkeys;\r\n\r\n\t\t\tif(column.isGroup){\r\n\t\t\t\tdefStore.title = colDef.title;\r\n\t\t\t\tdefStore.columns = this.parseColumns(column.getColumns());\r\n\t\t\t}else{\r\n\t\t\t\tdefStore.field = column.getField();\r\n\r\n\t\t\t\tif(this.config.columns === true || this.config.columns == undefined){\r\n\t\t\t\t\tkeys = Object.keys(colDef);\r\n\t\t\t\t\tkeys.push(\"width\");\r\n\t\t\t\t\tkeys.push(\"visible\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tkeys = this.config.columns;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tkeys.forEach((key)=>{\r\n\t\t\t\t\tswitch(key){\r\n\t\t\t\t\t\tcase \"width\":\r\n\t\t\t\t\t\t\tdefStore.width = column.getWidth();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"visible\":\r\n\t\t\t\t\t\t\tdefStore.visible = column.visible;\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tif(typeof colDef[key] !== \"function\" && excludedKeys.indexOf(key) === -1){\r\n\t\t\t\t\t\t\t\tdefStore[key] = colDef[key];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tdefinitions.push(defStore);\r\n\t\t});\r\n\r\n\t\treturn definitions;\r\n\t}\r\n}\r\n\r\nPersistence.moduleName = \"persistence\";\r\n\r\nPersistence.moduleInitOrder = -10;\r\n\r\n//load defaults\r\nPersistence.readers = defaultReaders;\r\nPersistence.writers = defaultWriters;\r\n\r\nexport default Persistence;","import Module from '../../core/Module.js';\r\n\r\nclass Popup extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.columnSubscribers = {};\r\n\t\t\r\n\t\tthis.registerTableOption(\"rowContextPopup\", false);\r\n\t\tthis.registerTableOption(\"rowClickPopup\", false);\r\n\t\tthis.registerTableOption(\"groupContextPopup\", false);\r\n\t\tthis.registerTableOption(\"groupClickPopup\", false);\r\n\t\t\r\n\t\tthis.registerColumnOption(\"headerContextPopup\");\r\n\t\tthis.registerColumnOption(\"headerClickPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopup\");\r\n\t\tthis.registerColumnOption(\"headerPopupIcon\");\r\n\t\tthis.registerColumnOption(\"contextPopup\");\r\n\t\tthis.registerColumnOption(\"clickPopup\");\r\n\t\t\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRowWatchers();\r\n\t\tthis.initializeGroupWatchers();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRowWatchers(){\r\n\t\tif(this.table.options.rowContextPopup){\r\n\t\t\tthis.subscribe(\"row-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t\tthis.table.on(\"rowTapHold\", this.loadPopupEvent.bind(this, this.table.options.rowContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.rowClickPopup){\r\n\t\t\tthis.subscribe(\"row-click\", this.loadPopupEvent.bind(this, this.table.options.rowClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeGroupWatchers(){\r\n\t\tif(this.table.options.groupContextPopup){\r\n\t\t\tthis.subscribe(\"group-contextmenu\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t\tthis.table.on(\"groupTapHold\", this.loadPopupEvent.bind(this, this.table.options.groupContextPopup));\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.groupClickPopup){\r\n\t\t\tthis.subscribe(\"group-click\", this.loadPopupEvent.bind(this, this.table.options.groupClickPopup));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.definition;\r\n\t\t\r\n\t\t//handle column events\r\n\t\tif(def.headerContextPopup && !this.columnSubscribers.headerContextPopup){\r\n\t\t\tthis.columnSubscribers.headerContextPopup = this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\");\r\n\t\t\tthis.subscribe(\"column-contextmenu\", this.columnSubscribers.headerContextPopup);\r\n\t\t\tthis.table.on(\"headerTapHold\", this.loadPopupTableColumnEvent.bind(this, \"headerContextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerClickPopup && !this.columnSubscribers.headerClickPopup){\r\n\t\t\tthis.columnSubscribers.headerClickPopup = this.loadPopupTableColumnEvent.bind(this, \"headerClickPopup\");\r\n\t\t\tthis.subscribe(\"column-click\", this.columnSubscribers.headerClickPopup);\r\n\t\t}\r\n\t\t\r\n\t\tif(def.headerPopup){\r\n\t\t\tthis.initializeColumnHeaderPopup(column);\r\n\t\t}\r\n\t\t\r\n\t\t//handle cell events\r\n\t\tif(def.contextPopup && !this.columnSubscribers.contextPopup){\r\n\t\t\tthis.columnSubscribers.contextPopup = this.loadPopupTableCellEvent.bind(this, \"contextPopup\");\r\n\t\t\tthis.subscribe(\"cell-contextmenu\", this.columnSubscribers.contextPopup);\r\n\t\t\tthis.table.on(\"cellTapHold\", this.loadPopupTableCellEvent.bind(this, \"contextPopup\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(def.clickPopup && !this.columnSubscribers.clickPopup){\r\n\t\t\tthis.columnSubscribers.clickPopup = this.loadPopupTableCellEvent.bind(this, \"clickPopup\");\r\n\t\t\tthis.subscribe(\"cell-click\", this.columnSubscribers.clickPopup);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumnHeaderPopup(column){\r\n\t\tvar icon = column.definition.headerPopupIcon,\r\n\t\theaderPopupEl;\r\n\t\t\r\n\t\theaderPopupEl = document.createElement(\"span\");\r\n\t\theaderPopupEl.classList.add(\"tabulator-header-popup-button\");\r\n\r\n\t\tif(icon){\r\n\t\t\tif(typeof icon === \"function\"){\r\n\t\t\t\ticon = icon(column.getComponent());\r\n\t\t\t}\r\n\r\n\t\t\tif(icon instanceof HTMLElement){\r\n\t\t\t\theaderPopupEl.appendChild(icon);\r\n\t\t\t}else{\r\n\t\t\t\theaderPopupEl.innerHTML = icon;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\theaderPopupEl.innerHTML = \"⋮\";\r\n\t\t}\r\n\t\t\r\n\t\theaderPopupEl.addEventListener(\"click\", (e) => {\r\n\t\t\te.stopPropagation();\r\n\t\t\te.preventDefault();\r\n\t\t\t\r\n\t\t\tthis.loadPopupEvent(column.definition.headerPopup, e, column);\r\n\t\t});\r\n\t\t\r\n\t\tcolumn.titleElement.insertBefore(headerPopupEl, column.titleElement.firstChild);\r\n\t}\r\n\t\r\n\tloadPopupTableCellEvent(option, e, cell){\r\n\t\tif(cell._cell){\r\n\t\t\tcell = cell._cell;\r\n\t\t}\r\n\t\t\r\n\t\tif(cell.column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(cell.column.definition[option], e, cell);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupTableColumnEvent(option, e, column){\r\n\t\tif(column._column){\r\n\t\t\tcolumn = column._column;\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition[option]){\r\n\t\t\tthis.loadPopupEvent(column.definition[option], e, column);\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadPopupEvent(contents, e, component){\r\n\t\tvar renderedCallback;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(component._group){\r\n\t\t\tcomponent = component._group;\r\n\t\t}else if(component._row){\r\n\t\t\tcomponent = component._row;\r\n\t\t}\r\n\t\t\r\n\t\tcontents = typeof contents == \"function\" ? contents.call(this.table, e, component.getComponent(), onRendered) : contents;\r\n\t\t\r\n\t\tthis.loadPopup(e, component, contents, renderedCallback);\r\n\t}\r\n\t\r\n\tloadPopup(e, component, contents, renderedCallback){\r\n\t\tvar touch = !(e instanceof MouseEvent),\r\n\t\tcontentsEl, popup;\r\n\t\t\r\n\t\tif(contents instanceof HTMLElement){\r\n\t\t\tcontentsEl = contents;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\tcontentsEl.innerHTML = contents;\r\n\t\t}\r\n\t\t\r\n\t\tcontentsEl.classList.add(\"tabulator-popup\");\r\n\r\n\t\tcontentsEl.addEventListener(\"click\", (e) =>{\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tif(!touch){\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t\t\r\n\t\tpopup = this.popup(contentsEl);\r\n\r\n\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\tpopup.renderCallback(renderedCallback);\r\n\t\t}\r\n\t\t\r\n\t\tpopup.show(e).hideOnBlur(() => {\r\n\t\t\tthis.dispatchExternal(\"popupClosed\", component.getComponent());\r\n\t\t});\r\n\r\n\r\n\r\n\t\tthis.dispatchExternal(\"popupOpened\", component.getComponent());\r\n\t}\r\n}\r\n\r\nPopup.moduleName = \"popup\";\r\n\r\nexport default Popup;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass Print extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.element = false;\r\n\t\tthis.manualBlock = false;\r\n\r\n\t\tthis.registerTableOption(\"printAsHtml\", false); //enable print as html\r\n\t\tthis.registerTableOption(\"printFormatter\", false); //printing page formatter\r\n\t\tthis.registerTableOption(\"printHeader\", false); //page header contents\r\n\t\tthis.registerTableOption(\"printFooter\", false); //page footer contents\r\n\t\tthis.registerTableOption(\"printStyled\", true); //enable print as html styling\r\n\t\tthis.registerTableOption(\"printRowRange\", \"visible\"); //restrict print to visible rows only\r\n\t\tthis.registerTableOption(\"printConfig\", {}); //print config options\r\n\r\n\t\tthis.registerColumnOption(\"print\");\r\n\t\tthis.registerColumnOption(\"titlePrint\");\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.printAsHtml){\r\n\t\t\twindow.addEventListener(\"beforeprint\", this.replaceTable.bind(this));\r\n\t\t\twindow.addEventListener(\"afterprint\", this.cleanup.bind(this));\r\n\t\t}\r\n\r\n\t\tthis.registerTableFunction(\"print\", this.printFullscreen.bind(this));\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\treplaceTable(){\r\n\t\tif(!this.manualBlock){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"tabulator-print-table\");\r\n\r\n\t\t\tthis.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig, this.table.options.printStyled, this.table.options.printRowRange, \"print\"));\r\n\r\n\t\t\tthis.table.element.style.display = \"none\";\r\n\r\n\t\t\tthis.table.element.parentNode.insertBefore(this.element, this.table.element);\r\n\t\t}\r\n\t}\r\n\r\n\tcleanup(){\r\n\t\tdocument.body.classList.remove(\"tabulator-print-fullscreen-hide\");\r\n\r\n\t\tif(this.element && this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\tthis.table.element.style.display = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\tprintFullscreen(visible, style, config){\r\n\t\tvar scrollX = window.scrollX,\r\n\t\tscrollY = window.scrollY,\r\n\t\theaderEl = document.createElement(\"div\"),\r\n\t\tfooterEl = document.createElement(\"div\"),\r\n\t\ttableEl = this.table.modules.export.generateTable(typeof config != \"undefined\" ? config : this.table.options.printConfig, typeof style != \"undefined\" ? style : this.table.options.printStyled, visible || this.table.options.printRowRange, \"print\"),\r\n\t\theaderContent, footerContent;\r\n\r\n\t\tthis.manualBlock = true;\r\n\r\n\t\tthis.element = document.createElement(\"div\");\r\n\t\tthis.element.classList.add(\"tabulator-print-fullscreen\");\r\n\r\n\t\tif(this.table.options.printHeader){\r\n\t\t\theaderEl.classList.add(\"tabulator-print-header\");\r\n\r\n\t\t\theaderContent = typeof this.table.options.printHeader == \"function\" ? this.table.options.printHeader.call(this.table) : this.table.options.printHeader;\r\n\r\n\t\t\tif(typeof headerContent == \"string\"){\r\n\t\t\t\theaderEl.innerHTML = headerContent;\r\n\t\t\t}else{\r\n\t\t\t\theaderEl.appendChild(headerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(headerEl);\r\n\t\t}\r\n\r\n\t\tthis.element.appendChild(tableEl);\r\n\r\n\t\tif(this.table.options.printFooter){\r\n\t\t\tfooterEl.classList.add(\"tabulator-print-footer\");\r\n\r\n\t\t\tfooterContent = typeof this.table.options.printFooter == \"function\" ? this.table.options.printFooter.call(this.table) : this.table.options.printFooter;\r\n\r\n\r\n\t\t\tif(typeof footerContent == \"string\"){\r\n\t\t\t\tfooterEl.innerHTML = footerContent;\r\n\t\t\t}else{\r\n\t\t\t\tfooterEl.appendChild(footerContent);\r\n\t\t\t}\r\n\r\n\t\t\tthis.element.appendChild(footerEl);\r\n\t\t}\r\n\r\n\t\tdocument.body.classList.add(\"tabulator-print-fullscreen-hide\");\r\n\t\tdocument.body.appendChild(this.element);\r\n\r\n\t\tif(this.table.options.printFormatter){\r\n\t\t\tthis.table.options.printFormatter(this.element, tableEl);\r\n\t\t}\r\n\r\n\t\twindow.print();\r\n\r\n\t\tthis.cleanup();\r\n\r\n\t\twindow.scrollTo(scrollX, scrollY);\r\n\r\n\t\tthis.manualBlock = false;\r\n\t}\r\n}\r\n\r\nPrint.moduleName = \"print\";\r\n\r\nexport default Print;","import Module from '../../core/Module.js';\r\n\r\nclass ReactiveData extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.data = false;\r\n\t\tthis.blocked = false; //block reactivity while performing update\r\n\t\tthis.origFuncs = {}; // hold original data array functions to allow replacement after data is done with\r\n\t\tthis.currentVersion = 0;\r\n\t\t\r\n\t\tthis.registerTableOption(\"reactiveData\", false); //enable data reactivity\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.reactiveData){\r\n\t\t\tthis.subscribe(\"cell-value-save-before\", this.block.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"cell-value-save-after\", this.unblock.bind(this, \"cellsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-before\", this.block.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-save-after\", this.unblock.bind(this, \"rowsave\"));\r\n\t\t\tthis.subscribe(\"row-data-init-after\", this.watchRow.bind(this));\r\n\t\t\tthis.subscribe(\"data-processing\", this.watchData.bind(this));\r\n\t\t\tthis.subscribe(\"table-destroy\", this.unwatchData.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchData(data){\r\n\t\tvar self = this,\r\n\t\tversion;\r\n\t\t\r\n\t\tthis.currentVersion ++;\r\n\t\t\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tthis.unwatchData();\r\n\t\t\r\n\t\tthis.data = data;\r\n\t\t\r\n\t\t//override array push function\r\n\t\tthis.origFuncs.push = data.push;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"push\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\t\r\n\t\t\t\t\tself.block(\"data-push\");\r\n\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.push.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-push\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array unshift function\r\n\t\tthis.origFuncs.unshift = data.unshift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"unshift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tresult;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-unshift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\targs.forEach((arg) => {\r\n\t\t\t\t\t\tself.table.rowManager.addRowActual(arg, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tresult = self.origFuncs.unshift.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-unshift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array shift function\r\n\t\tthis.origFuncs.shift = data.shift;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"shift\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-shift\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[0]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.shift.call(data);\r\n\r\n\t\t\t\t\tself.unblock(\"data-shift\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t//override array pop function\r\n\t\tthis.origFuncs.pop = data.pop;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"pop\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar row, result;\r\n\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-pop\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(self.data.length){\r\n\t\t\t\t\t\trow = self.table.rowManager.getRowFromDataObject(self.data[self.data.length - 1]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\trow.deleteActual();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.pop.call(data);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-pop\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t//override array splice function\r\n\t\tthis.origFuncs.splice = data.splice;\r\n\t\t\r\n\t\tObject.defineProperty(this.data, \"splice\", {\r\n\t\t\tenumerable: false,\r\n\t\t\tconfigurable: true,\r\n\t\t\tvalue: function(){\r\n\t\t\t\tvar args = Array.from(arguments),\r\n\t\t\t\tstart = args[0] < 0 ? data.length + args[0] : args[0],\r\n\t\t\t\tend = args[1],\r\n\t\t\t\tnewRows = args[2] ? args.slice(2) : false,\r\n\t\t\t\tstartRow, result;\r\n\t\t\t\t\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"data-splice\");\r\n\t\t\t\t\t//add new rows\r\n\t\t\t\t\tif(newRows){\r\n\t\t\t\t\t\tstartRow = data[start] ? self.table.rowManager.getRowFromDataObject(data[start]) : false;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(startRow){\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, startRow, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnewRows = newRows.slice().reverse();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tnewRows.forEach((rowData) => {\r\n\t\t\t\t\t\t\t\tself.table.rowManager.addRowActual(rowData, true, false, true);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//delete removed rows\r\n\t\t\t\t\tif(end !== 0){\r\n\t\t\t\t\t\tvar oldRows = data.slice(start, typeof args[1] === \"undefined\" ? args[1] : start + end);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toldRows.forEach((rowData, i) => {\r\n\t\t\t\t\t\t\tvar row = self.table.rowManager.getRowFromDataObject(rowData);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(row){\r\n\t\t\t\t\t\t\t\trow.deleteActual(i !== oldRows.length - 1);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(newRows || end !== 0){\r\n\t\t\t\t\t\tself.table.rowManager.reRenderInPosition();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult = self.origFuncs.splice.apply(data, arguments);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"data-splice\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn result ;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchData(){\r\n\t\tif(this.data !== false){\r\n\t\t\tfor(var key in this.origFuncs){\r\n\t\t\t\tObject.defineProperty(this.data, key, {\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\tconfigurable:true,\r\n\t\t\t\t\twritable:true,\r\n\t\t\t\t\tvalue: this.origFuncs.key,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tthis.watchKey(row, data, key);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.table.options.dataTree){\r\n\t\t\tthis.watchTreeChildren(row);\r\n\t\t}\r\n\t}\r\n\t\r\n\twatchTreeChildren (row){\r\n\t\tvar self = this,\r\n\t\tchildField = row.getData()[this.table.options.dataTreeChildField],\r\n\t\torigFuncs = {};\r\n\t\t\r\n\t\tif(childField){\r\n\t\t\t\r\n\t\t\torigFuncs.push = childField.push;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"push\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-push\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.push.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-push\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.unshift = childField.unshift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"unshift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-unshift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.unshift.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-unshift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.shift = childField.shift;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"shift\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-shift\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.shift.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-shift\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.pop = childField.pop;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"pop\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-pop\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.pop.call(childField);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-pop\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\torigFuncs.splice = childField.splice;\r\n\t\t\t\r\n\t\t\tObject.defineProperty(childField, \"splice\", {\r\n\t\t\t\tenumerable: false,\r\n\t\t\t\tconfigurable: true,\r\n\t\t\t\tvalue: () => {\r\n\t\t\t\t\tif(!self.blocked){\r\n\t\t\t\t\t\tself.block(\"tree-splice\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar result = origFuncs.splice.apply(childField, arguments);\r\n\t\t\t\t\t\tthis.rebuildTree(row);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.unblock(\"tree-splice\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn result;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trebuildTree(row){\r\n\t\tthis.table.modules.dataTree.initializeRow(row);\r\n\t\tthis.table.modules.dataTree.layoutRow(row);\r\n\t\tthis.table.rowManager.refreshActiveData(\"tree\", false, true);\r\n\t}\r\n\t\r\n\twatchKey(row, data, key){\r\n\t\tvar self = this,\r\n\t\tprops = Object.getOwnPropertyDescriptor(data, key),\r\n\t\tvalue = data[key],\r\n\t\tversion = this.currentVersion;\r\n\t\t\r\n\t\tObject.defineProperty(data, key, {\r\n\t\t\tset: (newValue) => {\r\n\t\t\t\tvalue = newValue;\r\n\t\t\t\tif(!self.blocked && version === self.currentVersion){\r\n\t\t\t\t\tself.block(\"key\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar update = {};\r\n\t\t\t\t\tupdate[key] = newValue;\r\n\t\t\t\t\trow.updateData(update);\r\n\t\t\t\t\t\r\n\t\t\t\t\tself.unblock(\"key\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(props.set){\r\n\t\t\t\t\tprops.set(newValue);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tget:() => {\r\n\t\t\t\t\r\n\t\t\t\tif(props.get){\r\n\t\t\t\t\tprops.get();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn value;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tunwatchRow(row){\r\n\t\tvar data = row.getData();\r\n\t\t\r\n\t\tfor(var key in data){\r\n\t\t\tObject.defineProperty(data, key, {\r\n\t\t\t\tvalue:data[key],\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\tblock(key){\r\n\t\tif(!this.blocked){\r\n\t\t\tthis.blocked = key;\r\n\t\t}\r\n\t}\r\n\t\r\n\tunblock(key){\r\n\t\tif(this.blocked === key){\r\n\t\t\tthis.blocked = false;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nReactiveData.moduleName = \"reactiveData\";\r\n\r\nexport default ReactiveData;\r\n\r\n\r\n\r\n","import Module from '../../core/Module.js';\r\n\r\nclass ResizeColumns extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startX = false;\r\n\t\tthis.startWidth = false;\r\n\t\tthis.latestX = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.initialNextColumn = null;\r\n\t\tthis.nextColumn = null;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.registerColumnOption(\"resizable\", true);\r\n\t\tthis.registerTableOption(\"resizableColumnFit\", false);\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-rendered\", this.layoutColumnHeader.bind(this));\r\n\t}\r\n\t\r\n\tinitializeEventWatchers(){\r\n\t\tif(!this.initialized){\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-rendered\", this.layoutCellHandles.bind(this));\r\n\t\t\tthis.subscribe(\"cell-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-height\", this.resizeHandle.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.columnLayoutUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-hide\", this.deInitializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.columnLayoutUpdated.bind(this));\r\n\t\t\tthis.subscribe(\"column-width\", this.columnWidthUpdated.bind(this));\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-delete\", this.deInitializeComponent.bind(this));\r\n\t\t\tthis.subscribe(\"column-height\", this.resizeHandle.bind(this));\r\n\t\t\t\r\n\t\t\tthis.initialized = true;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tlayoutCellHandles(cell){\r\n\t\tif(cell.row.type === \"row\"){\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t\tthis.initializeColumn(\"cell\", cell, cell.column, cell.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tlayoutColumnHeader(column){\r\n\t\tif(column.definition.resizable){\r\n\t\t\tthis.initializeEventWatchers();\r\n\t\t\tthis.deInitializeComponent(column);\r\n\t\t\tthis.initializeColumn(\"header\", column, column, column.element);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnLayoutUpdated(column){\r\n\t\tvar prev = column.prevColumn();\r\n\t\t\r\n\t\tthis.reinitializeColumn(column);\r\n\t\t\r\n\t\tif(prev){\r\n\t\t\tthis.reinitializeColumn(prev);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolumnWidthUpdated(column){\r\n\t\tif(column.modules.frozen){\r\n\t\t\tif(this.table.modules.frozenColumns.leftColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.leftColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}else if(this.table.modules.frozenColumns.rightColumns.includes(column)){\r\n\t\t\t\tthis.table.modules.frozenColumns.rightColumns.forEach((col) => {\r\n\t\t\t\t\tthis.reinitializeColumn(col);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeColumn(column){\r\n\t\tvar frozenOffset = column.modules.frozen ? (column.modules.frozen.marginValue + column.getWidth() + \"px\") : false;\r\n\t\t\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(cell.modules.resize && cell.modules.resize.handleEl){\r\n\t\t\t\tif(frozenOffset){\r\n\t\t\t\t\tcell.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcell.element.after(cell.modules.resize.handleEl);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(column.modules.resize && column.modules.resize.handleEl){\r\n\t\t\tif(frozenOffset){\r\n\t\t\t\tcolumn.modules.resize.handleEl.style.left = frozenOffset;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.element.after(column.modules.resize.handleEl);\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeColumn(type, component, column, element){\r\n\t\tvar self = this,\r\n\t\tvariableHeight = false,\r\n\t\tmode = column.definition.resizable,\r\n\t\tconfig = {},\r\n\t\tnearestColumn = column.getLastColumn();\r\n\t\t\r\n\t\t//set column resize mode\r\n\t\tif(type === \"header\"){\r\n\t\t\tvariableHeight = column.definition.formatter == \"textarea\" || column.definition.variableHeight;\r\n\t\t\tconfig = {variableHeight:variableHeight};\r\n\t\t}\r\n\t\t\r\n\t\tif((mode === true || mode == type) && this._checkResizability(nearestColumn)){\r\n\t\t\t\r\n\t\t\tvar handle = document.createElement('span');\r\n\t\t\thandle.className = \"tabulator-col-resize-handle\";\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar handleDown = function(e){\r\n\t\t\t\tself.startColumn = column;\r\n\t\t\t\tself.initialNextColumn = self.nextColumn = nearestColumn.nextColumn();\r\n\t\t\t\tself._mouseDown(e, nearestColumn, handle);\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\t\t\t\r\n\t\t\t//resize column on double click\r\n\t\t\thandle.addEventListener(\"dblclick\", (e) => {\r\n\t\t\t\tvar oldWidth = nearestColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\tnearestColumn.reinitializeWidth(true);\r\n\t\t\t\t\r\n\t\t\t\tif(oldWidth !== nearestColumn.getWidth()){\r\n\t\t\t\t\tself.dispatch(\"column-resized\", nearestColumn);\r\n\t\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", nearestColumn.getComponent());\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(column.modules.frozen){\r\n\t\t\t\thandle.style.position = \"absolute\";\r\n\t\t\t\thandle.style.left = column.modules.frozen.marginValue + column.getWidth() + \"px\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconfig.handleEl = handle;\r\n\t\t\t\r\n\t\t\tif(element.parentNode && column.visible){\r\n\t\t\t\telement.after(handle);\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcomponent.modules.resize = config;\r\n\t}\r\n\t\r\n\tdeInitializeColumn(column){\r\n\t\tthis.deInitializeComponent(column);\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tthis.deInitializeComponent(cell);\r\n\t\t});\r\n\t}\r\n\t\r\n\tdeInitializeComponent(component){\r\n\t\tvar handleEl;\r\n\t\t\r\n\t\tif(component.modules.resize){\r\n\t\t\thandleEl = component.modules.resize.handleEl;\r\n\t\t\t\r\n\t\t\tif(handleEl && handleEl.parentElement){\r\n\t\t\t\thandleEl.parentElement.removeChild(handleEl);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tresizeHandle(component, height){\r\n\t\tif(component.modules.resize && component.modules.resize.handleEl){\r\n\t\t\tcomponent.modules.resize.handleEl.style.height = height;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_checkResizability(column){\r\n\t\treturn column.definition.resizable;\r\n\t}\r\n\t\r\n\t_mouseDown(e, column, handle){\r\n\t\tvar self = this;\r\n\t\t\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tfunction mouseMove(e){\r\n\t\t\tvar x = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX,\r\n\t\t\tstartDiff = x - self.startX,\r\n\t\t\tmoveDiff = x - self.latestX,\r\n\t\t\tblockedBefore, blockedAfter;\r\n\t\t\t\r\n\t\t\tself.latestX = x;\r\n\t\t\t\r\n\t\t\tif(self.table.rtl){\r\n\t\t\t\tstartDiff = -startDiff;\r\n\t\t\t\tmoveDiff = -moveDiff;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tblockedBefore = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tcolumn.setWidth(self.startWidth + startDiff);\r\n\t\t\t\r\n\t\t\tblockedAfter = column.width == column.minWidth || column.width == column.maxWidth;\r\n\t\t\t\r\n\t\t\tif(moveDiff < 0){\r\n\t\t\t\tself.nextColumn = self.initialNextColumn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.options.resizableColumnFit && self.nextColumn && !(blockedBefore && blockedAfter)){\r\n\t\t\t\tlet colWidth = self.nextColumn.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(moveDiff > 0){\r\n\t\t\t\t\tif(colWidth <= self.nextColumn.minWidth){\r\n\t\t\t\t\t\tself.nextColumn = self.nextColumn.nextColumn();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.nextColumn){\r\n\t\t\t\t\tself.nextColumn.setWidth(self.nextColumn.getWidth() - moveDiff);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tself.table.columnManager.rerenderColumns(true);\r\n\t\t\t\r\n\t\t\tif(!self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfunction mouseUp(e){\r\n\t\t\t\r\n\t\t\t//block editor from taking action while resizing is taking place\r\n\t\t\tif(self.startColumn.modules.edit){\r\n\t\t\t\tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(self.table.browserSlow && column.modules.resize && column.modules.resize.variableHeight){\r\n\t\t\t\tcolumn.checkCellHeights();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseUp);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\t\t\t\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\t\t\t\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\t\t\t\r\n\t\t\tif(self.startWidth !== column.getWidth()){\r\n\t\t\t\tself.dispatch(\"column-resized\", column);\r\n\t\t\t\tself.table.externalEvents.dispatch(\"columnResized\", column.getComponent());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\t\t\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\tif(self.startColumn.modules.edit){\r\n\t\t\tself.startColumn.modules.edit.blocked = true;\r\n\t\t}\r\n\t\t\r\n\t\tself.startX = typeof e.screenX === \"undefined\" ? e.touches[0].screenX : e.screenX;\r\n\t\tself.latestX = self.startX;\r\n\t\tself.startWidth = column.getWidth();\r\n\t\t\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeColumns.moduleName = \"resizeColumns\";\r\n\r\nexport default ResizeColumns;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeRows extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.startColumn = false;\r\n\t\tthis.startY = false;\r\n\t\tthis.startHeight = false;\r\n\t\tthis.handle = null;\r\n\t\tthis.prevHandle = null;\r\n\r\n\t\tthis.registerTableOption(\"resizableRows\", false); //resizable rows\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tif(this.table.options.resizableRows){\r\n\t\t\tthis.subscribe(\"row-layout-after\", this.initializeRow.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\trowEl = row.getElement();\r\n\r\n\t\tvar handle = document.createElement('div');\r\n\t\thandle.className = \"tabulator-row-resize-handle\";\r\n\r\n\t\tvar prevHandle = document.createElement('div');\r\n\t\tprevHandle.className = \"tabulator-row-resize-handle prev\";\r\n\r\n\t\thandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar handleDown = function(e){\r\n\t\t\tself.startRow = row;\r\n\t\t\tself._mouseDown(e, row, handle);\r\n\t\t};\r\n\r\n\t\thandle.addEventListener(\"mousedown\", handleDown);\r\n\t\thandle.addEventListener(\"touchstart\", handleDown, {passive: true});\r\n\r\n\t\tprevHandle.addEventListener(\"click\", function(e){\r\n\t\t\te.stopPropagation();\r\n\t\t});\r\n\r\n\t\tvar prevHandleDown = function(e){\r\n\t\t\tvar prevRow = self.table.rowManager.prevDisplayRow(row);\r\n\r\n\t\t\tif(prevRow){\r\n\t\t\t\tself.startRow = prevRow;\r\n\t\t\t\tself._mouseDown(e, prevRow, prevHandle);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tprevHandle.addEventListener(\"mousedown\",prevHandleDown);\r\n\t\tprevHandle.addEventListener(\"touchstart\",prevHandleDown, {passive: true});\r\n\r\n\t\trowEl.appendChild(handle);\r\n\t\trowEl.appendChild(prevHandle);\r\n\t}\r\n\r\n\t_mouseDown(e, row, handle){\r\n\t\tvar self = this;\r\n\r\n\t\tself.table.element.classList.add(\"tabulator-block-select\");\r\n\r\n\t\tfunction mouseMove(e){\r\n\t\t\trow.setHeight(self.startHeight + ((typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY) - self.startY));\r\n\t\t}\r\n\r\n\t\tfunction mouseUp(e){\r\n\r\n\t\t\t// //block editor from taking action while resizing is taking place\r\n\t\t\t// if(self.startColumn.modules.edit){\r\n\t\t\t// \tself.startColumn.modules.edit.blocked = false;\r\n\t\t\t// }\r\n\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", mouseMove);\r\n\t\t\tdocument.body.removeEventListener(\"mousemove\", mouseMove);\r\n\r\n\t\t\thandle.removeEventListener(\"touchmove\", mouseMove);\r\n\t\t\thandle.removeEventListener(\"touchend\", mouseUp);\r\n\r\n\t\t\tself.table.element.classList.remove(\"tabulator-block-select\");\r\n\r\n\t\t\tself.dispatchExternal(\"rowResized\", row.getComponent());\r\n\t\t}\r\n\r\n\t\te.stopPropagation(); //prevent resize from interfering with movable columns\r\n\r\n\t\t//block editor from taking action while resizing is taking place\r\n\t\t// if(self.startColumn.modules.edit){\r\n\t\t// \tself.startColumn.modules.edit.blocked = true;\r\n\t\t// }\r\n\r\n\t\tself.startY = typeof e.screenY === \"undefined\" ? e.touches[0].screenY : e.screenY;\r\n\t\tself.startHeight = row.getHeight();\r\n\r\n\t\tdocument.body.addEventListener(\"mousemove\", mouseMove);\r\n\t\tdocument.body.addEventListener(\"mouseup\", mouseUp);\r\n\r\n\t\thandle.addEventListener(\"touchmove\", mouseMove, {passive: true});\r\n\t\thandle.addEventListener(\"touchend\", mouseUp);\r\n\t}\r\n}\r\n\r\nResizeRows.moduleName = \"resizeRows\";\r\n\r\nexport default ResizeRows;","import Module from '../../core/Module.js';\r\n\r\nclass ResizeTable extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.binding = false;\r\n\t\tthis.visibilityObserver = false;\r\n\t\tthis.resizeObserver = false;\r\n\t\tthis.containerObserver = false;\r\n\t\t\r\n\t\tthis.tableHeight = 0;\r\n\t\tthis.tableWidth = 0;\r\n\t\tthis.containerHeight = 0;\r\n\t\tthis.containerWidth = 0;\r\n\t\t\r\n\t\tthis.autoResize = false;\r\n\t\t\r\n\t\tthis.visible = false;\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.initialRedraw = false;\r\n\t\t\r\n\t\tthis.registerTableOption(\"autoResize\", true); //auto resize table\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.autoResize){\r\n\t\t\tvar table = this.table,\r\n\t\t\ttableStyle;\r\n\t\t\t\r\n\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\r\n\t\t\tif(table.element.parentNode){\r\n\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof IntersectionObserver !== \"undefined\" && typeof ResizeObserver !== \"undefined\" && table.rowManager.getRenderMode() === \"virtual\"){\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeVisibilityObserver();\r\n\t\t\t\t\r\n\t\t\t\tthis.autoResize = true;\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.tableHeight != nodeHeight || this.tableWidth != nodeWidth){\r\n\t\t\t\t\t\t\tthis.tableHeight = nodeHeight;\r\n\t\t\t\t\t\t\tthis.tableWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(table.element.parentNode){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = table.element.parentNode.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = table.element.parentNode.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.resizeObserver.observe(table.element);\r\n\t\t\t\t\r\n\t\t\t\ttableStyle = window.getComputedStyle(table.element);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.element.parentNode && !this.table.rowManager.fixedHeight && (tableStyle.getPropertyValue(\"max-height\") || tableStyle.getPropertyValue(\"min-height\"))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver = new ResizeObserver((entry) => {\r\n\t\t\t\t\t\tif(!table.browserMobile || (table.browserMobile &&!table.modules.edit.currentCell)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar nodeHeight = Math.floor(entry[0].contentRect.height);\r\n\t\t\t\t\t\t\tvar nodeWidth = Math.floor(entry[0].contentRect.width);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(this.containerHeight != nodeHeight || this.containerWidth != nodeWidth){\r\n\t\t\t\t\t\t\t\tthis.containerHeight = nodeHeight;\r\n\t\t\t\t\t\t\t\tthis.containerWidth = nodeWidth;\r\n\t\t\t\t\t\t\t\tthis.tableHeight = table.element.clientHeight;\r\n\t\t\t\t\t\t\t\tthis.tableWidth = table.element.clientWidth;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.redrawTable();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.containerObserver.observe(this.table.element.parentNode);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.subscribe(\"table-resize\", this.tableResized.bind(this));\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tthis.binding = function(){\r\n\t\t\t\t\tif(!table.browserMobile || (table.browserMobile && !table.modules.edit.currentCell)){\r\n\t\t\t\t\t\ttable.columnManager.rerenderColumns(true);\r\n\t\t\t\t\t\ttable.redraw();\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\twindow.addEventListener(\"resize\", this.binding);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"table-destroy\", this.clearBindings.bind(this));\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeVisibilityObserver(){\r\n\t\tthis.visibilityObserver = new IntersectionObserver((entries) => {\r\n\t\t\tthis.visible = entries[0].isIntersecting;\r\n\r\n\t\t\tif(!this.initialized){\r\n\t\t\t\tthis.initialized = true;\r\n\t\t\t\tthis.initialRedraw = !this.visible;\r\n\t\t\t}\r\n\r\n\t\t\tif(this.visible){\r\n\t\t\t\tthis.redrawTable(this.initialRedraw);\r\n\t\t\t\tthis.initialRedraw = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\tthis.visibilityObserver.observe(this.table.element);\r\n\t}\r\n\t\r\n\tredrawTable(force){\r\n\t\tif(this.initialized && this.visible){\r\n\t\t\tthis.table.columnManager.rerenderColumns(true);\r\n\t\t\tthis.table.redraw(force);\r\n\t\t}\r\n\t}\r\n\t\r\n\ttableResized(){\r\n\t\tthis.table.rowManager.redraw();\r\n\t}\r\n\t\r\n\tclearBindings(){\r\n\t\tif(this.binding){\r\n\t\t\twindow.removeEventListener(\"resize\", this.binding);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.resizeObserver){\r\n\t\t\tthis.resizeObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.visibilityObserver){\r\n\t\t\tthis.visibilityObserver.unobserve(this.table.element);\r\n\t\t}\r\n\t\t\r\n\t\tif(this.containerObserver){\r\n\t\t\tthis.containerObserver.unobserve(this.table.element.parentNode);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nResizeTable.moduleName = \"resizeTable\";\r\n\r\nexport default ResizeTable;","import Module from '../../core/Module.js';\r\n\r\nclass ResponsiveLayout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.columns = [];\r\n\t\tthis.hiddenColumns = [];\r\n\t\tthis.mode = \"\";\r\n\t\tthis.index = 0;\r\n\t\tthis.collapseFormatter = [];\r\n\t\tthis.collapseStartOpen = true;\r\n\t\tthis.collapseHandleColumn = false;\r\n\r\n\t\tthis.registerTableOption(\"responsiveLayout\", false); //responsive layout flags\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseStartOpen\", true); //start showing collapsed data\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseUseFormatters\", true); //responsive layout collapse formatter\r\n\t\tthis.registerTableOption(\"responsiveLayoutCollapseFormatter\", false); //responsive layout collapse formatter\r\n\r\n\t\tthis.registerColumnOption(\"responsive\");\r\n\t}\r\n\r\n\t//generate responsive columns list\r\n\tinitialize(){\r\n\t\tif(this.table.options.responsiveLayout){\r\n\t\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\t\tthis.subscribe(\"column-show\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"column-hide\", this.updateColumnVisibility.bind(this));\r\n\t\t\tthis.subscribe(\"columns-loaded\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-moved\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-add\", this.initializeResponsivity.bind(this));\r\n\t\t\tthis.subscribe(\"column-delete\", this.initializeResponsivity.bind(this));\r\n\r\n\t\t\tthis.subscribe(\"table-redrawing\", this.tableRedraw.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.responsiveLayout === \"collapse\"){\r\n\t\t\t\tthis.subscribe(\"row-data-changed\", this.generateCollapsedRowContent.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\t\tthis.subscribe(\"row-layout\", this.layoutRow.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttableRedraw(force){\r\n\t\tif([\"fitColumns\", \"fitDataStretch\"].indexOf(this.layoutMode()) === -1){\r\n\t\t\tif(!force){\r\n\t\t\t\tthis.update();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tinitializeResponsivity(){\r\n\t\tvar columns = [];\r\n\r\n\t\tthis.mode = this.table.options.responsiveLayout;\r\n\t\tthis.collapseFormatter = this.table.options.responsiveLayoutCollapseFormatter || this.formatCollapsedData;\r\n\t\tthis.collapseStartOpen = this.table.options.responsiveLayoutCollapseStartOpen;\r\n\t\tthis.hiddenColumns = [];\r\n\r\n\t\t//determine level of responsivity for each column\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column, i) => {\r\n\t\t\tif(column.modules.responsive){\r\n\t\t\t\tif(column.modules.responsive.order && column.modules.responsive.visible){\r\n\t\t\t\t\tcolumn.modules.responsive.index = i;\r\n\t\t\t\t\tcolumns.push(column);\r\n\r\n\t\t\t\t\tif(!column.visible && this.mode === \"collapse\"){\r\n\t\t\t\t\t\tthis.hiddenColumns.push(column);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//sort list by responsivity\r\n\t\tcolumns = columns.reverse();\r\n\t\tcolumns = columns.sort((a, b) => {\r\n\t\t\tvar diff = b.modules.responsive.order - a.modules.responsive.order;\r\n\t\t\treturn diff || (b.modules.responsive.index - a.modules.responsive.index);\r\n\t\t});\r\n\r\n\t\tthis.columns = columns;\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.generateCollapsedContent();\r\n\t\t}\r\n\r\n\t\t//assign collapse column\r\n\t\tfor (let col of this.table.columnManager.columnsByIndex){\r\n\t\t\tif(col.definition.formatter == \"responsiveCollapse\"){\r\n\t\t\t\tthis.collapseHandleColumn = col;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(this.collapseHandleColumn){\r\n\t\t\tif(this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}else{\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//define layout information\r\n\tinitializeColumn(column){\r\n\t\tvar def = column.getDefinition();\r\n\r\n\t\tcolumn.modules.responsive = {order: typeof def.responsive === \"undefined\" ? 1 : def.responsive, visible:def.visible === false ? false : true};\r\n\t}\r\n\r\n\tinitializeRow(row){\r\n\t\tvar el;\r\n\r\n\t\tif(row.type !== \"calc\"){\r\n\t\t\tel = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-responsive-collapse\");\r\n\r\n\t\t\trow.modules.responsiveLayout = {\r\n\t\t\t\telement:el,\r\n\t\t\t\topen:this.collapseStartOpen,\r\n\t\t\t};\r\n\r\n\t\t\tif(!this.collapseStartOpen){\r\n\t\t\t\tel.style.display = 'none';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tlayoutRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\trowEl.appendChild(row.modules.responsiveLayout.element);\r\n\t\t\tthis.generateCollapsedRowContent(row);\r\n\t\t}\r\n\t}\r\n\r\n\t//update column visibility\r\n\tupdateColumnVisibility(column, responsiveToggle){\r\n\t\tif(!responsiveToggle && column.modules.responsive){\r\n\t\t\tcolumn.modules.responsive.visible = column.visible;\r\n\t\t\tthis.initializeResponsivity();\r\n\t\t}\r\n\t}\r\n\r\n\thideColumn(column){\r\n\t\tvar colCount = this.hiddenColumns.length;\r\n\r\n\t\tcolumn.hide(false, true);\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tthis.hiddenColumns.unshift(column);\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !colCount){\r\n\t\t\t\tthis.collapseHandleColumn.show();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tshowColumn(column){\r\n\t\tvar index;\r\n\r\n\t\tcolumn.show(false, true);\r\n\t\t//set column width to prevent calculation loops on uninitialized columns\r\n\t\tcolumn.setWidth(column.getWidth());\r\n\r\n\t\tif(this.mode === \"collapse\"){\r\n\t\t\tindex = this.hiddenColumns.indexOf(column);\r\n\r\n\t\t\tif(index > -1){\r\n\t\t\t\tthis.hiddenColumns.splice(index, 1);\r\n\t\t\t}\r\n\r\n\t\t\tthis.generateCollapsedContent();\r\n\r\n\t\t\tif(this.collapseHandleColumn && !this.hiddenColumns.length){\r\n\t\t\t\tthis.collapseHandleColumn.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//redraw columns to fit space\r\n\tupdate(){\r\n\t\tvar self = this,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\r\n\t\t\tlet width = self.table.modules.layout.getMode() == \"fitColumns\" ? self.table.columnManager.getFlexBaseWidth() : self.table.columnManager.getWidth();\r\n\r\n\t\t\tlet diff = (self.table.options.headerVisible ? self.table.columnManager.element.clientWidth : self.table.element.clientWidth) - width;\r\n\r\n\t\t\tif(diff < 0){\r\n\t\t\t\t//table is too wide\r\n\t\t\t\tlet column = self.columns[self.index];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tself.hideColumn(column);\r\n\t\t\t\t\tself.index ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t//table has spare space\r\n\t\t\t\tlet column = self.columns[self.index -1];\r\n\r\n\t\t\t\tif(column){\r\n\t\t\t\t\tif(diff > 0){\r\n\t\t\t\t\t\tif(diff >= column.getWidth()){\r\n\t\t\t\t\t\t\tself.showColumn(column);\r\n\t\t\t\t\t\t\tself.index --;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(!self.table.rowManager.activeRowsCount){\r\n\t\t\t\tself.table.rowManager.renderEmptyScroll();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedContent(){\r\n\t\tvar self = this,\r\n\t\trows = this.table.rowManager.getDisplayRows();\r\n\r\n\t\trows.forEach(function(row){\r\n\t\t\tself.generateCollapsedRowContent(row);\r\n\t\t});\r\n\t}\r\n\r\n\tgenerateCollapsedRowContent(row){\r\n\t\tvar el, contents;\r\n\r\n\t\tif(row.modules.responsiveLayout){\r\n\t\t\tel = row.modules.responsiveLayout.element;\r\n\r\n\t\t\twhile(el.firstChild) el.removeChild(el.firstChild);\r\n\r\n\t\t\tcontents = this.collapseFormatter(this.generateCollapsedRowData(row));\r\n\t\t\tif(contents){\r\n\t\t\t\tel.appendChild(contents);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgenerateCollapsedRowData(row){\r\n\t\tvar self = this,\r\n\t\tdata = row.getData(),\r\n\t\toutput = [],\r\n\t\tmockCellComponent;\r\n\r\n\t\tthis.hiddenColumns.forEach(function(column){\r\n\t\t\tvar value = column.getFieldValue(data);\r\n\r\n\t\t\tif(column.definition.title && column.field){\r\n\t\t\t\tif(column.modules.format && self.table.options.responsiveLayoutCollapseUseFormatters){\r\n\r\n\t\t\t\t\tmockCellComponent = {\r\n\t\t\t\t\t\tvalue:false,\r\n\t\t\t\t\t\tdata:{},\r\n\t\t\t\t\t\tgetValue:function(){\r\n\t\t\t\t\t\t\treturn value;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetData:function(){\r\n\t\t\t\t\t\t\treturn data;\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetElement:function(){\r\n\t\t\t\t\t\t\treturn document.createElement(\"div\");\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetRow:function(){\r\n\t\t\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tgetColumn:function(){\r\n\t\t\t\t\t\t\treturn column.getComponent();\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tfunction onRendered(callback){\r\n\t\t\t\t\t\tcallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: column.modules.format.formatter.call(self.table.modules.format, mockCellComponent, column.modules.format.params, onRendered)\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\toutput.push({\r\n\t\t\t\t\t\tfield: column.field,\r\n\t\t\t\t\t\ttitle: column.definition.title,\r\n\t\t\t\t\t\tvalue: value\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tformatCollapsedData(data){\r\n\t\tvar list = document.createElement(\"table\");\r\n\r\n\t\tdata.forEach(function(item){\r\n\t\t\tvar row = document.createElement(\"tr\");\r\n\t\t\tvar titleData = document.createElement(\"td\");\r\n\t\t\tvar valueData = document.createElement(\"td\");\r\n\t\t\tvar node_content;\r\n\r\n\t\t\tvar titleHighlight = document.createElement(\"strong\");\r\n\t\t\ttitleData.appendChild(titleHighlight);\r\n\t\t\tthis.langBind(\"columns|\" + item.field, function(text){\r\n\t\t\t\ttitleHighlight.innerHTML = text || item.title;\r\n\t\t\t});\r\n\r\n\t\t\tif(item.value instanceof Node){\r\n\t\t\t\tnode_content = document.createElement(\"div\");\r\n\t\t\t\tnode_content.appendChild(item.value);\r\n\t\t\t\tvalueData.appendChild(node_content);\r\n\t\t\t}else{\r\n\t\t\t\tvalueData.innerHTML = item.value;\r\n\t\t\t}\r\n\r\n\t\t\trow.appendChild(titleData);\r\n\t\t\trow.appendChild(valueData);\r\n\t\t\tlist.appendChild(row);\r\n\t\t}, this);\r\n\r\n\t\treturn Object.keys(data).length ? list : \"\";\r\n\t}\r\n}\r\n\r\nResponsiveLayout.moduleName = \"responsiveLayout\";\r\n\r\nexport default ResponsiveLayout;\r\n","import Module from '../../core/Module.js';\r\n\r\nclass SelectRow extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.selecting = false; //flag selecting in progress\r\n\t\tthis.lastClickedRow = false; //last clicked row\r\n\t\tthis.selectPrev = []; //hold previously selected element for drag drop selection\r\n\t\tthis.selectedRows = []; //hold selected rows\r\n\t\tthis.headerCheckboxElement = null; // hold header select element\r\n\t\t\r\n\t\tthis.registerTableOption(\"selectable\", \"highlight\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRangeMode\", \"drag\"); //highlight rows on hover\r\n\t\tthis.registerTableOption(\"selectableRollingSelection\", true); //roll selection once maximum number of selectable rows is reached\r\n\t\tthis.registerTableOption(\"selectablePersistence\", true); // maintain selection when table view is updated\r\n\t\tthis.registerTableOption(\"selectableCheck\", function(data, row){return true;}); //check whether row is selectable\r\n\t\t\r\n\t\tthis.registerTableFunction(\"selectRow\", this.selectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"deselectRow\", this.deselectRows.bind(this));\r\n\t\tthis.registerTableFunction(\"toggleSelectRow\", this.toggleRow.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedRows\", this.getSelectedRows.bind(this));\r\n\t\tthis.registerTableFunction(\"getSelectedData\", this.getSelectedData.bind(this));\r\n\t\t\r\n\t\t//register component functions\r\n\t\tthis.registerComponentFunction(\"row\", \"select\", this.selectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"deselect\", this.deselectRows.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"toggleSelect\", this.toggleRow.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"isSelected\", this.isRowSelected.bind(this));\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tif(this.table.options.selectable !== false){\r\n\t\t\tthis.subscribe(\"row-init\", this.initializeRow.bind(this));\r\n\t\t\tthis.subscribe(\"row-deleting\", this.rowDeleted.bind(this));\r\n\t\t\tthis.subscribe(\"rows-wipe\", this.clearSelectionData.bind(this));\r\n\t\t\tthis.subscribe(\"rows-retrieve\", this.rowRetrieve.bind(this));\r\n\t\t\t\r\n\t\t\tif(this.table.options.selectable && !this.table.options.selectablePersistence){\r\n\t\t\t\tthis.subscribe(\"data-refreshing\", this.deselectRows.bind(this));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trowRetrieve(type, prevValue){\r\n\t\treturn type === \"selected\" ? this.selectedRows : prevValue;\r\n\t}\r\n\t\r\n\trowDeleted(row){\r\n\t\tthis._deselectRow(row, true);\r\n\t}\r\n\t\r\n\tclearSelectionData(silent){\r\n\t\tthis.selecting = false;\r\n\t\tthis.lastClickedRow = false;\r\n\t\tthis.selectPrev = [];\r\n\t\tthis.selectedRows = [];\r\n\t\t\r\n\t\tif(silent !== true){\r\n\t\t\tthis._rowSelectionChanged();\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tvar self = this,\r\n\t\telement = row.getElement();\r\n\t\t\r\n\t\t// trigger end of row selection\r\n\t\tvar endSelect = function(){\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tself.selecting = false;\r\n\t\t\t}, 50);\r\n\t\t\t\r\n\t\t\tdocument.body.removeEventListener(\"mouseup\", endSelect);\r\n\t\t};\r\n\t\t\r\n\t\trow.modules.select = {selected:false};\r\n\t\t\r\n\t\t//set row selection class\r\n\t\tif(self.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\telement.classList.add(\"tabulator-selectable\");\r\n\t\t\telement.classList.remove(\"tabulator-unselectable\");\r\n\t\t\t\r\n\t\t\tif(self.table.options.selectable && self.table.options.selectable != \"highlight\"){\r\n\t\t\t\tif(self.table.options.selectableRangeMode === \"click\"){\r\n\t\t\t\t\telement.addEventListener(\"click\", this.handleComplexRowClick.bind(this, row));\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement.addEventListener(\"click\", function(e){\r\n\t\t\t\t\t\tif(!self.table.modExists(\"edit\") || !self.table.modules.edit.getCurrentCell()){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!self.selecting){\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mousedown\", function(e){\r\n\t\t\t\t\t\tif(e.shiftKey){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selecting = true;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.selectPrev = [];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"mouseup\", endSelect);\r\n\t\t\t\t\t\t\tdocument.body.addEventListener(\"keyup\", endSelect);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseenter\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.toggleRow(row);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(self.selectPrev[1] == row){\r\n\t\t\t\t\t\t\t\tself.toggleRow(self.selectPrev[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\telement.addEventListener(\"mouseout\", function(e){\r\n\t\t\t\t\t\tif(self.selecting){\r\n\t\t\t\t\t\t\tself.table._clearSelection();\r\n\t\t\t\t\t\t\tself.selectPrev.unshift(row);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\telement.classList.add(\"tabulator-unselectable\");\r\n\t\t\telement.classList.remove(\"tabulator-selectable\");\r\n\t\t}\r\n\t}\r\n\t\r\n\thandleComplexRowClick(row, e){\r\n\t\tif(e.shiftKey){\r\n\t\t\tthis.table._clearSelection();\r\n\t\t\tthis.lastClickedRow = this.lastClickedRow || row;\r\n\t\t\t\r\n\t\t\tvar lastClickedRowIdx = this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);\r\n\t\t\tvar rowIdx = this.table.rowManager.getDisplayRowIndex(row);\r\n\t\t\t\r\n\t\t\tvar fromRowIdx = lastClickedRowIdx <= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\tvar toRowIdx = lastClickedRowIdx >= rowIdx ? lastClickedRowIdx : rowIdx;\r\n\t\t\t\r\n\t\t\tvar rows = this.table.rowManager.getDisplayRows().slice(0);\r\n\t\t\tvar toggledRows = rows.splice(fromRowIdx, toRowIdx - fromRowIdx + 1);\r\n\t\t\t\r\n\t\t\tif(e.ctrlKey || e.metaKey){\r\n\t\t\t\ttoggledRows.forEach((toggledRow)=>{\r\n\t\t\t\t\tif(toggledRow !== this.lastClickedRow){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(this.table.options.selectable !== true && !this.isRowSelected(row)){\r\n\t\t\t\t\t\t\tif(this.selectedRows.length < this.table.options.selectable){\r\n\t\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.toggleRow(toggledRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.lastClickedRow = row;\r\n\t\t\t}else{\r\n\t\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.selectable !== true){\r\n\t\t\t\t\tif(toggledRows.length > this.table.options.selectable){\r\n\t\t\t\t\t\ttoggledRows = toggledRows.slice(0, this.table.options.selectable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectRows(toggledRows);\r\n\t\t\t}\r\n\t\t\tthis.table._clearSelection();\r\n\t\t}\r\n\t\telse if(e.ctrlKey || e.metaKey){\r\n\t\t\tthis.toggleRow(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}else{\r\n\t\t\tthis.deselectRows(undefined, true);\r\n\t\t\tthis.selectRows(row);\r\n\t\t\tthis.lastClickedRow = row;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//toggle row selection\r\n\ttoggleRow(row){\r\n\t\tif(this.table.options.selectableCheck.call(this.table, row.getComponent())){\r\n\t\t\tif(row.modules.select && row.modules.select.selected){\r\n\t\t\t\tthis._deselectRow(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis._selectRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select a number of rows\r\n\tselectRows(rows){\r\n\t\tvar rowMatch;\r\n\t\t\r\n\t\tswitch(typeof rows){\r\n\t\t\tcase \"undefined\":\r\n\t\t\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"string\":\r\n\t\t\t\trowMatch = this.table.rowManager.findRow(rows);\r\n\t\t\t\r\n\t\t\t\tif(rowMatch){\r\n\t\t\t\t\tthis._selectRow(rowMatch, true, true);\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowMatch = this.table.rowManager.getRows(rows);\r\n\t\t\t\t\t\r\n\t\t\t\t\trowMatch.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif(rowMatch.length){\r\n\t\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\t\trows.forEach((row) => {\r\n\t\t\t\t\t\tthis._selectRow(row, true, true);\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\tthis._rowSelectionChanged();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis._selectRow(rows, false, true);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//select an individual row\r\n\t_selectRow(rowInfo, silent, force){\r\n\t\t//handle max row count\r\n\t\tif(!isNaN(this.table.options.selectable) && this.table.options.selectable !== true && !force){\r\n\t\t\tif(this.selectedRows.length >= this.table.options.selectable){\r\n\t\t\t\tif(this.table.options.selectableRollingSelection){\r\n\t\t\t\t\tthis._deselectRow(this.selectedRows[0]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar row = this.table.rowManager.findRow(rowInfo);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tif(this.selectedRows.indexOf(row) == -1){\r\n\t\t\t\trow.getElement().classList.add(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = true;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.selectedRows.push(row);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowSelected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tthis._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Selection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tisRowSelected(row){\r\n\t\treturn this.selectedRows.indexOf(row) !== -1;\r\n\t}\r\n\t\r\n\t//deselect a number of rows\r\n\tdeselectRows(rows, silent){\r\n\t\tvar self = this,\r\n\t\trowCount;\r\n\t\t\r\n\t\tif(typeof rows == \"undefined\"){\r\n\t\t\t\r\n\t\t\trowCount = self.selectedRows.length;\r\n\t\t\t\r\n\t\t\tfor(let i = 0; i < rowCount; i++){\r\n\t\t\t\tself._deselectRow(self.selectedRows[0], true);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(rowCount){\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tif(Array.isArray(rows)){\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tself._deselectRow(row, true);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}else{\r\n\t\t\t\tself._deselectRow(rows, silent);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//deselect an individual row\r\n\t_deselectRow(rowInfo, silent){\r\n\t\tvar self = this,\r\n\t\trow = self.table.rowManager.findRow(rowInfo),\r\n\t\tindex;\r\n\t\t\r\n\t\tif(row){\r\n\t\t\tindex = self.selectedRows.findIndex(function(selectedRow){\r\n\t\t\t\treturn selectedRow == row;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(index > -1){\r\n\t\t\t\t\r\n\t\t\t\trow.getElement().classList.remove(\"tabulator-selected\");\r\n\t\t\t\tif(!row.modules.select){\r\n\t\t\t\t\trow.modules.select = {};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\trow.modules.select.selected = false;\r\n\t\t\t\tif(row.modules.select.checkboxEl){\r\n\t\t\t\t\trow.modules.select.checkboxEl.checked = false;\r\n\t\t\t\t}\r\n\t\t\t\tself.selectedRows.splice(index, 1);\r\n\t\t\t\t\r\n\t\t\t\tif(this.table.options.dataTreeSelectPropagate){\r\n\t\t\t\t\tthis.childRowSelection(row, false);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatchExternal(\"rowDeselected\", row.getComponent());\r\n\t\t\t\t\r\n\t\t\t\tself._rowSelectionChanged(silent);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Deselection Error - No such row found, ignoring selection:\" + rowInfo);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSelectedData(){\r\n\t\tvar data = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\tdata.push(row.getData());\r\n\t\t});\r\n\t\t\r\n\t\treturn data;\r\n\t}\r\n\t\r\n\tgetSelectedRows(){\r\n\t\t\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\tthis.selectedRows.forEach(function(row){\r\n\t\t\trows.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t_rowSelectionChanged(silent){\r\n\t\tif(this.headerCheckboxElement){\r\n\t\t\tif(this.selectedRows.length === 0){\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else if(this.table.rowManager.rows.length === this.selectedRows.length){\r\n\t\t\t\tthis.headerCheckboxElement.checked = true;\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = false;\r\n\t\t\t} else {\r\n\t\t\t\tthis.headerCheckboxElement.indeterminate = true;\r\n\t\t\t\tthis.headerCheckboxElement.checked = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(!silent){\r\n\t\t\tthis.dispatchExternal(\"rowSelectionChanged\", this.getSelectedData(), this.getSelectedRows());\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterRowSelectCheckbox (row, element) {\r\n\t\tif(!row._row.modules.select){\r\n\t\t\trow._row.modules.select = {};\r\n\t\t}\r\n\t\t\r\n\t\trow._row.modules.select.checkboxEl = element;\r\n\t}\r\n\t\r\n\tregisterHeaderSelectCheckbox (element) {\r\n\t\tthis.headerCheckboxElement = element;\r\n\t}\r\n\t\r\n\tchildRowSelection(row, select){\r\n\t\tvar children = this.table.modules.dataTree.getChildren(row, true);\r\n\t\t\r\n\t\tif(select){\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._selectRow(child, true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tfor(let child of children){\r\n\t\t\t\tthis._deselectRow(child, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nSelectRow.moduleName = \"selectRow\";\r\n\r\nexport default SelectRow;","//sort datetime\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar DT = window.DateTime || luxon.DateTime;\r\n\tvar format = params.format || \"dd/MM/yyyy HH:mm:ss\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tif(typeof DT != \"undefined\"){\r\n\t\tif(!DT.isDateTime(a)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\ta = DT.fromISO(String(a));\r\n\t\t\t}else{\r\n\t\t\t\ta = DT.fromFormat(String(a), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!DT.isDateTime(b)){\r\n\t\t\tif(format === \"iso\"){\r\n\t\t\t\tb = DT.fromISO(String(b));\r\n\t\t\t}else{\r\n\t\t\t\tb = DT.fromFormat(String(b), format);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!a.isValid){\r\n\t\t\temptyAlign = !b.isValid ? 0 : -1;\r\n\t\t}else if(!b.isValid){\r\n\t\t\temptyAlign = 1;\r\n\t\t}else{\r\n\t\t\t//compare valid values\r\n\t\t\treturn a - b;\r\n\t\t}\r\n\r\n\t\t//fix empty values in position\r\n\t\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\t\temptyAlign *= -1;\r\n\t\t}\r\n\r\n\t\treturn emptyAlign;\r\n\r\n\t}else{\r\n\t\tconsole.error(\"Sort Error - 'datetime' sorter is dependant on luxon.js\");\r\n\t}\r\n}","import number from './sorters/number.js';\r\nimport string from './sorters/string.js';\r\nimport date from './sorters/date.js';\r\nimport time from './sorters/time.js';\r\nimport datetime from './sorters/datetime.js';\r\nimport boolean from './sorters/boolean.js';\r\nimport array from './sorters/array.js';\r\nimport exists from './sorters/exists.js';\r\nimport alphanum from './sorters/alphanum.js';\r\n\r\nexport default {\r\n\tnumber:number,\r\n\tstring:string,\r\n\tdate:date,\r\n\ttime:time,\r\n\tdatetime:datetime,\r\n\tboolean:boolean,\r\n\tarray:array,\r\n\texists:exists,\r\n\talphanum:alphanum\r\n};","//sort numbers\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar decimal = params.decimalSeparator;\r\n\tvar thousand = params.thousandSeparator;\r\n\tvar emptyAlign = 0;\r\n\r\n\ta = String(a);\r\n\tb = String(b);\r\n\r\n\tif(thousand){\r\n\t\ta = a.split(thousand).join(\"\");\r\n\t\tb = b.split(thousand).join(\"\");\r\n\t}\r\n\r\n\tif(decimal){\r\n\t\ta = a.split(decimal).join(\".\");\r\n\t\tb = b.split(decimal).join(\".\");\r\n\t}\r\n\r\n\ta = parseFloat(a);\r\n\tb = parseFloat(b);\r\n\r\n\t//handle non numeric values\r\n\tif(isNaN(a)){\r\n\t\temptyAlign = isNaN(b) ? 0 : -1;\r\n\t}else if(isNaN(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\treturn a - b;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort strings\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\tvar locale;\r\n\r\n\t//handle empty values\r\n\tif(!a){\r\n\t\temptyAlign = !b ? 0 : -1;\r\n\t}else if(!b){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\t//compare valid values\r\n\t\tswitch(typeof params.locale){\r\n\t\t\tcase \"boolean\":\r\n\t\t\t\tif(params.locale){\r\n\t\t\t\t\tlocale = this.langLocale();\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"string\":\r\n\t\t\t\tlocale = params.locale;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn String(a).toLowerCase().localeCompare(String(b).toLowerCase(), locale);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import datetime from './datetime.js';\r\n\r\n//sort date\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"dd/MM/yyyy\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","import datetime from './datetime.js';\r\n\r\n//sort times\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tif(!params.format){\r\n\t\tparams.format = \"HH:mm\";\r\n\t}\r\n\r\n\treturn datetime.call(this, a, b, aRow, bRow, column, dir, params);\r\n}","//sort booleans\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = a === true || a === \"true\" || a === \"True\" || a === 1 ? 1 : 0;\r\n\tvar el2 = b === true || b === \"true\" || b === \"True\" || b === 1 ? 1 : 0;\r\n\r\n\treturn el1 - el2;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar type = params.type || \"length\",\r\n\talignEmptyValues = params.alignEmptyValues,\r\n\temptyAlign = 0;\r\n\r\n\tfunction calc(value){\r\n\t\tvar result;\r\n\r\n\t\tswitch(type){\r\n\t\t\tcase \"length\":\r\n\t\t\t\tresult = value.length;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"sum\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"max\":\r\n\t\t\t\tresult = Math.max.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"min\":\r\n\t\t\t\tresult = Math.min.apply(null, value) ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"avg\":\r\n\t\t\t\tresult = value.reduce(function(c, d){\r\n\t\t\t\t\treturn c + d;\r\n\t\t\t\t}) / value.length;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t//handle non array values\r\n\tif(!Array.isArray(a)){\r\n\t\temptyAlign = !Array.isArray(b) ? 0 : -1;\r\n\t}else if(!Array.isArray(b)){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\t\treturn calc(b) - calc(a);\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","//sort if element contains any data\r\nexport default function(a, b, aRow, bRow, column, dir, params){\r\n\tvar el1 = typeof a == \"undefined\" ? 0 : 1;\r\n\tvar el2 = typeof b == \"undefined\" ? 0 : 1;\r\n\r\n\treturn el1 - el2;\r\n}","//sort alpha numeric strings\r\nexport default function(as, bs, aRow, bRow, column, dir, params){\r\n\tvar a, b, a1, b1, i= 0, L, rx = /(\\d+)|(\\D+)/g, rd = /\\d/;\r\n\tvar alignEmptyValues = params.alignEmptyValues;\r\n\tvar emptyAlign = 0;\r\n\r\n\t//handle empty values\r\n\tif(!as && as!== 0){\r\n\t\temptyAlign = !bs && bs!== 0 ? 0 : -1;\r\n\t}else if(!bs && bs!== 0){\r\n\t\temptyAlign = 1;\r\n\t}else{\r\n\r\n\t\tif(isFinite(as) && isFinite(bs)) return as - bs;\r\n\t\ta = String(as).toLowerCase();\r\n\t\tb = String(bs).toLowerCase();\r\n\t\tif(a === b) return 0;\r\n\t\tif(!(rd.test(a) && rd.test(b))) return a > b ? 1 : -1;\r\n\t\ta = a.match(rx);\r\n\t\tb = b.match(rx);\r\n\t\tL = a.length > b.length ? b.length : a.length;\r\n\t\twhile(i < L){\r\n\t\t\ta1= a[i];\r\n\t\t\tb1= b[i++];\r\n\t\t\tif(a1 !== b1){\r\n\t\t\t\tif(isFinite(a1) && isFinite(b1)){\r\n\t\t\t\t\tif(a1.charAt(0) === \"0\") a1 = \".\" + a1;\r\n\t\t\t\t\tif(b1.charAt(0) === \"0\") b1 = \".\" + b1;\r\n\t\t\t\t\treturn a1 - b1;\r\n\t\t\t\t}\r\n\t\t\t\telse return a1 > b1 ? 1 : -1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn a.length > b.length;\r\n\t}\r\n\r\n\t//fix empty values in position\r\n\tif((alignEmptyValues === \"top\" && dir === \"desc\") || (alignEmptyValues === \"bottom\" && dir === \"asc\")){\r\n\t\temptyAlign *= -1;\r\n\t}\r\n\r\n\treturn emptyAlign;\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultSorters from './defaults/sorters.js';\r\n\r\nclass Sort extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.sortList = []; //holder current sort\r\n\t\tthis.changed = false; //has the sort changed since last render\r\n\r\n\t\tthis.registerTableOption(\"sortMode\", \"local\"); //local or remote sorting\r\n\r\n\t\tthis.registerTableOption(\"initialSort\", false); //initial sorting criteria\r\n\t\tthis.registerTableOption(\"columnHeaderSortMulti\", true); //multiple or single column sorting\r\n\t\tthis.registerTableOption(\"sortOrderReverse\", false); //reverse internal sort ordering\r\n\t\tthis.registerTableOption(\"headerSortElement\", \"
\"); //header sort element\r\n\r\n\t\tthis.registerColumnOption(\"sorter\");\r\n\t\tthis.registerColumnOption(\"sorterParams\");\r\n\r\n\t\tthis.registerColumnOption(\"headerSort\", true);\r\n\t\tthis.registerColumnOption(\"headerSortStartingDir\");\r\n\t\tthis.registerColumnOption(\"headerSortTristate\");\r\n\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumn.bind(this));\r\n\t\tthis.subscribe(\"table-built\", this.tableBuilt.bind(this));\r\n\t\tthis.registerDataHandler(this.sort.bind(this), 20);\r\n\r\n\t\tthis.registerTableFunction(\"setSort\", this.userSetSort.bind(this));\r\n\t\tthis.registerTableFunction(\"getSorters\", this.getSort.bind(this));\r\n\t\tthis.registerTableFunction(\"clearSort\", this.clearSort.bind(this));\r\n\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.subscribe(\"data-params\", this.remoteSortParams.bind(this));\r\n\t\t}\r\n\t}\r\n\r\n\ttableBuilt(){\r\n\t\tif(this.table.options.initialSort){\r\n\t\t\tthis.setSort(this.table.options.initialSort);\r\n\t\t}\r\n\t}\r\n\r\n\tremoteSortParams(data, config, silent, params){\r\n\t\tvar sorters = this.getSort();\r\n\r\n\t\tsorters.forEach((item) => {\r\n\t\t\tdelete item.column;\r\n\t\t});\r\n\r\n\t\tparams.sort = sorters;\r\n\r\n\t\treturn params;\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\tuserSetSort(sortList, dir){\r\n\t\tthis.setSort(sortList, dir);\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\tclearSort(){\r\n\t\tthis.clear();\r\n\t\t// this.table.rowManager.sorterRefresh();\r\n\t\tthis.refreshSort();\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\r\n\t//initialize column header for sorting\r\n\tinitializeColumn(column){\r\n\t\tvar sorter = false,\r\n\t\tcolEl,\r\n\t\tarrowEl;\r\n\r\n\t\tswitch(typeof column.definition.sorter){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tif(Sort.sorters[column.definition.sorter]){\r\n\t\t\t\t\tsorter = Sort.sorters[column.definition.sorter];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Sort Error - No such sorter found: \", column.definition.sorter);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"function\":\r\n\t\t\t\tsorter = column.definition.sorter;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcolumn.modules.sort = {\r\n\t\t\tsorter:sorter, dir:\"none\",\r\n\t\t\tparams:column.definition.sorterParams || {},\r\n\t\t\tstartingDir:column.definition.headerSortStartingDir || \"asc\",\r\n\t\t\ttristate: column.definition.headerSortTristate,\r\n\t\t};\r\n\r\n\t\tif(column.definition.headerSort !== false){\r\n\r\n\t\t\tcolEl = column.getElement();\r\n\r\n\t\t\tcolEl.classList.add(\"tabulator-sortable\");\r\n\r\n\r\n\t\t\tarrowEl = document.createElement(\"div\");\r\n\t\t\tarrowEl.classList.add(\"tabulator-col-sorter\");\r\n\r\n\t\t\tswitch(this.table.options.headerSortElement){\r\n\t\t\t\tcase \"function\":\r\n\t\t\t\t\t//do nothing\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase \"object\":\r\n\t\t\t\t\tarrowEl.appendChild(this.table.options.headerSortElement);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tarrowEl.innerHTML = this.table.options.headerSortElement;\r\n\t\t\t}\r\n\r\n\t\t\t//create sorter arrow\r\n\t\t\tcolumn.titleHolderElement.appendChild(arrowEl);\r\n\r\n\t\t\tcolumn.modules.sort.element = arrowEl;\r\n\r\n\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\r\n\t\t\t//sort on click\r\n\t\t\tcolEl.addEventListener(\"click\", (e) => {\r\n\t\t\t\tvar dir = \"\",\r\n\t\t\t\tsorters=[],\r\n\t\t\t\tmatch = false;\r\n\r\n\t\t\t\tif(column.modules.sort){\r\n\t\t\t\t\tif(column.modules.sort.tristate){\r\n\t\t\t\t\t\tif(column.modules.sort.dir == \"none\"){\r\n\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(column.modules.sort.dir == column.modules.sort.startingDir){\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.dir == \"asc\" ? \"desc\" : \"asc\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tdir = \"none\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tswitch(column.modules.sort.dir){\r\n\t\t\t\t\t\t\tcase \"asc\":\r\n\t\t\t\t\t\t\t\tdir = \"desc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tcase \"desc\":\r\n\t\t\t\t\t\t\t\tdir = \"asc\";\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tdir = column.modules.sort.startingDir;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (this.table.options.columnHeaderSortMulti && (e.shiftKey || e.ctrlKey)) {\r\n\t\t\t\t\t\tsorters = this.getSort();\r\n\r\n\t\t\t\t\t\tmatch = sorters.findIndex((sorter) => {\r\n\t\t\t\t\t\t\treturn sorter.field === column.getField();\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tif(match > -1){\r\n\t\t\t\t\t\t\tsorters[match].dir = dir;\r\n\r\n\t\t\t\t\t\t\tmatch = sorters.splice(match, 1)[0];\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push(match);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(dir != \"none\"){\r\n\t\t\t\t\t\t\t\tsorters.push({column:column, dir:dir});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//add to existing sort\r\n\t\t\t\t\t\tthis.setSort(sorters);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(dir == \"none\"){\r\n\t\t\t\t\t\t\tthis.clear();\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//sort by column only\r\n\t\t\t\t\t\t\tthis.setSort(column, dir);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this.table.rowManager.sorterRefresh(!this.sortList.length);\r\n\t\t\t\t\tthis.refreshSort();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\trefreshSort(){\r\n\t\tif(this.table.options.sortMode === \"remote\"){\r\n\t\t\tthis.reloadData(null, false, false);\r\n\t\t}else{\r\n\t\t\tthis.refreshData(true);\r\n\t\t}\r\n\r\n\t\t//TODO - Persist left position of row manager\r\n\t\t// left = this.scrollLeft;\r\n\t\t// this.scrollHorizontal(left);\r\n\t}\r\n\r\n\t//check if the sorters have changed since last use\r\n\thasChanged(){\r\n\t\tvar changed = this.changed;\r\n\t\tthis.changed = false;\r\n\t\treturn changed;\r\n\t}\r\n\r\n\t//return current sorters\r\n\tgetSort(){\r\n\t\tvar self = this,\r\n\t\tsorters = [];\r\n\r\n\t\tself.sortList.forEach(function(item){\r\n\t\t\tif(item.column){\r\n\t\t\t\tsorters.push({column:item.column.getComponent(), field:item.column.getField(), dir:item.dir});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn sorters;\r\n\t}\r\n\r\n\t//change sort list and trigger sort\r\n\tsetSort(sortList, dir){\r\n\t\tvar self = this,\r\n\t\tnewSortList = [];\r\n\r\n\t\tif(!Array.isArray(sortList)){\r\n\t\t\tsortList = [{column: sortList, dir:dir}];\r\n\t\t}\r\n\r\n\t\tsortList.forEach(function(item){\r\n\t\t\tvar column;\r\n\r\n\t\t\tcolumn = self.table.columnManager.findColumn(item.column);\r\n\r\n\t\t\tif(column){\r\n\t\t\t\titem.column = column;\r\n\t\t\t\tnewSortList.push(item);\r\n\t\t\t\tself.changed = true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Sort Warning - Sort field does not exist and is being ignored: \", item.column);\r\n\t\t\t}\r\n\r\n\t\t});\r\n\r\n\t\tself.sortList = newSortList;\r\n\r\n\t\tthis.dispatch(\"sort-changed\");\r\n\t}\r\n\r\n\t//clear sorters\r\n\tclear(){\r\n\t\tthis.setSort([]);\r\n\t}\r\n\r\n\t//find appropriate sorter for column\r\n\tfindSorter(column){\r\n\t\tvar row = this.table.rowManager.activeRows[0],\r\n\t\tsorter = \"string\",\r\n\t\tfield, value;\r\n\r\n\t\tif(row){\r\n\t\t\trow = row.getData();\r\n\t\t\tfield = column.getField();\r\n\r\n\t\t\tif(field){\r\n\r\n\t\t\t\tvalue = column.getFieldValue(row);\r\n\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Sort.sorters[sorter];\r\n\t}\r\n\r\n\t//work through sort list sorting data\r\n\tsort(data){\r\n\t\tvar self = this,\r\n\t\tsortList = this.table.options.sortOrderReverse ? self.sortList.slice().reverse() : self.sortList,\r\n\t\tsortListActual = [],\r\n\t\trowComponents = [];\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorting\")){\r\n\t\t\tthis.dispatchExternal(\"dataSorting\", self.getSort());\r\n\t\t}\r\n\r\n\t\tself.clearColumnHeaders();\r\n\r\n\t\tif(this.table.options.sortMode !== \"remote\"){\r\n\r\n\t\t\t//build list of valid sorters and trigger column specific callbacks before sort begins\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tvar sortObj;\r\n\r\n\t\t\t\tif(item.column){\r\n\t\t\t\t\tsortObj = item.column.modules.sort;\r\n\r\n\t\t\t\t\tif(sortObj){\r\n\r\n\t\t\t\t\t\t//if no sorter has been defined, take a guess\r\n\t\t\t\t\t\tif(!sortObj.sorter){\r\n\t\t\t\t\t\t\tsortObj.sorter = self.findSorter(item.column);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\titem.params = typeof sortObj.params === \"function\" ? sortObj.params(item.column.getComponent(), item.dir) : sortObj.params;\r\n\r\n\t\t\t\t\t\tsortListActual.push(item);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t//sort data\r\n\t\t\tif (sortListActual.length) {\r\n\t\t\t\tself._sortItems(data, sortListActual);\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tsortList.forEach(function(item, i){\r\n\t\t\t\tself.setColumnHeader(item.column, item.dir);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif(this.subscribedExternal(\"dataSorted\")){\r\n\t\t\tdata.forEach((row) => {\r\n\t\t\t\trowComponents.push(row.getComponent());\r\n\t\t\t});\r\n\r\n\t\t\tthis.dispatchExternal(\"dataSorted\", self.getSort(), rowComponents);\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}\r\n\r\n\t//clear sort arrows on columns\r\n\tclearColumnHeaders(){\r\n\t\tthis.table.columnManager.getRealColumns().forEach((column) => {\r\n\t\t\tif(column.modules.sort){\r\n\t\t\t\tcolumn.modules.sort.dir = \"none\";\r\n\t\t\t\tcolumn.getElement().setAttribute(\"aria-sort\", \"none\");\r\n\t\t\t\tthis.setColumnHeaderSortIcon(column, \"none\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\t//set the column header sort direction\r\n\tsetColumnHeader(column, dir){\r\n\t\tcolumn.modules.sort.dir = dir;\r\n\t\tcolumn.getElement().setAttribute(\"aria-sort\", dir === \"asc\" ? \"ascending\" : \"descending\");\r\n\t\tthis.setColumnHeaderSortIcon(column, dir);\r\n\t}\r\n\r\n\tsetColumnHeaderSortIcon(column, dir){\r\n\t\tvar sortEl = column.modules.sort.element,\r\n\t\tarrowEl;\r\n\r\n\t\tif(column.definition.headerSort && typeof this.table.options.headerSortElement === \"function\"){\r\n\t\t\twhile(sortEl.firstChild) sortEl.removeChild(sortEl.firstChild);\r\n\r\n\t\t\tarrowEl = this.table.options.headerSortElement.call(this.table, column.getComponent(), dir);\r\n\t\t\t\r\n\t\t\tif(typeof arrowEl === \"object\"){\r\n\t\t\t\tsortEl.appendChild(arrowEl);\r\n\t\t\t}else{\r\n\t\t\t\tsortEl.innerHTML = arrowEl;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//sort each item in sort list\r\n\t_sortItems(data, sortList){\r\n\t\tvar sorterCount = sortList.length - 1;\r\n\r\n\t\tdata.sort((a, b) => {\r\n\t\t\tvar result;\r\n\r\n\t\t\tfor(var i = sorterCount; i>= 0; i--){\r\n\t\t\t\tlet sortItem = sortList[i];\r\n\r\n\t\t\t\tresult = this._sortRow(a, b, sortItem.column, sortItem.dir, sortItem.params);\r\n\r\n\t\t\t\tif(result !== 0){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t});\r\n\t}\r\n\r\n\t//process individual rows for a sort function on active data\r\n\t_sortRow(a, b, column, dir, params){\r\n\t\tvar el1Comp, el2Comp;\r\n\r\n\t\t//switch elements depending on search direction\r\n\t\tvar el1 = dir == \"asc\" ? a : b;\r\n\t\tvar el2 = dir == \"asc\" ? b : a;\r\n\r\n\t\ta = column.getFieldValue(el1.getData());\r\n\t\tb = column.getFieldValue(el2.getData());\r\n\r\n\t\ta = typeof a !== \"undefined\" ? a : \"\";\r\n\t\tb = typeof b !== \"undefined\" ? b : \"\";\r\n\r\n\t\tel1Comp = el1.getComponent();\r\n\t\tel2Comp = el2.getComponent();\r\n\r\n\t\treturn column.modules.sort.sorter.call(this, a, b, el1Comp, el2Comp, column.getComponent(), dir, params);\r\n\t}\r\n}\r\n\r\nSort.moduleName = \"sort\";\r\n\r\n//load defaults\r\nSort.sorters = defaultSorters;\r\n\r\nexport default Sort;","import Module from '../../core/Module.js';\r\nimport Cell from '../../core/cell/Cell.js';\r\n\r\nclass Tooltip extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.tooltipSubscriber = null,\r\n\t\tthis.headerSubscriber = null,\r\n\t\t\r\n\t\tthis.timeout = null;\r\n\t\tthis.popupInstance = null;\r\n\t\t\r\n\t\tthis.registerTableOption(\"tooltipGenerationMode\", undefined); //deprecated\r\n\t\tthis.registerTableOption(\"tooltipDelay\", 300); \r\n\t\t\r\n\t\tthis.registerColumnOption(\"tooltip\");\r\n\t\tthis.registerColumnOption(\"headerTooltip\");\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.deprecatedOptionsCheck();\r\n\t\t\r\n\t\tthis.subscribe(\"column-init\", this.initializeColumn.bind(this));\r\n\t}\r\n\t\r\n\tdeprecatedOptionsCheck(){\r\n\t\tthis.deprecationCheckMsg(\"tooltipGenerationMode\", \"This option is no longer needed as tooltips are always generated on hover now\");\r\n\t}\t\r\n\t\r\n\tinitializeColumn(column){\r\n\t\tif(column.definition.headerTooltip && !this.headerSubscriber){\r\n\t\t\tthis.headerSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"column-mousemove\", this.mousemoveCheck.bind(this, \"headerTooltip\"));\r\n\t\t\tthis.subscribe(\"column-mouseout\", this.mouseoutCheck.bind(this, \"headerTooltip\"));\r\n\t\t}\r\n\t\t\r\n\t\tif(column.definition.tooltip && !this.tooltipSubscriber){\r\n\t\t\tthis.tooltipSubscriber = true;\r\n\t\t\t\r\n\t\t\tthis.subscribe(\"cell-mousemove\", this.mousemoveCheck.bind(this, \"tooltip\"));\r\n\t\t\tthis.subscribe(\"cell-mouseout\", this.mouseoutCheck.bind(this, \"tooltip\"));\r\n\t\t}\r\n\t}\r\n\t\r\n\tmousemoveCheck(action, e, component){\r\n\t\tvar tooltip = action === \"tooltip\" ? component.column.definition.tooltip : component.definition.headerTooltip;\r\n\t\t\r\n\t\tif(tooltip){\r\n\t\t\tthis.clearPopup();\r\n\t\t\tthis.timeout = setTimeout(this.loadTooltip.bind(this, e, component, tooltip), this.table.options.tooltipDelay);\r\n\t\t}\r\n\t}\r\n\r\n\tmouseoutCheck(action, e, component){\r\n\t\tif(!this.popupInstance){\r\n\t\t\tthis.clearPopup();\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearPopup(action, e, component){\r\n\t\tclearTimeout(this.timeout);\r\n\t\tthis.timeout = null;\r\n\t\t\r\n\t\tif(this.popupInstance){\r\n\t\t\tthis.popupInstance.hide();\r\n\t\t}\r\n\t}\r\n\t\r\n\tloadTooltip(e, component, tooltip){\r\n\t\tvar contentsEl, renderedCallback, coords;\r\n\r\n\t\tfunction onRendered(callback){\r\n\t\t\trenderedCallback = callback;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof tooltip === \"function\"){\r\n\t\t\ttooltip = tooltip(e, component.getComponent(), onRendered);\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip instanceof HTMLElement){\r\n\t\t\tcontentsEl = tooltip;\r\n\t\t}else{\r\n\t\t\tcontentsEl = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\tif(tooltip === true){\r\n\t\t\t\tif(component instanceof Cell){\r\n\t\t\t\t\ttooltip = component.value;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(component.definition.field){\r\n\t\t\t\t\t\tthis.langBind(\"columns|\" + component.definition.field, (value) => {\r\n\t\t\t\t\t\t\tcontentsEl.innerHTML = tooltip = value || component.definition.title;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\ttooltip = component.definition.title;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcontentsEl.innerHTML = tooltip;\r\n\t\t}\r\n\t\t\r\n\t\tif(tooltip || tooltip === 0 || tooltip === false){\r\n\t\t\tcontentsEl.classList.add(\"tabulator-tooltip\");\r\n\r\n\t\t\tcontentsEl.addEventListener(\"mousemove\", e => e.preventDefault());\r\n\t\t\t\r\n\t\t\tthis.popupInstance = this.popup(contentsEl);\r\n\t\t\t\r\n\t\t\tif(typeof renderedCallback === \"function\"){\r\n\t\t\t\tthis.popupInstance.renderCallback(renderedCallback);\r\n\t\t\t}\r\n\r\n\t\t\tcoords = this.popupInstance.containerEventCoords(e);\r\n\t\t\t\r\n\t\t\tthis.popupInstance.show(coords.x + 15, coords.y + 15).hideOnBlur(() => {\r\n\t\t\t\tthis.dispatchExternal(\"TooltipClosed\", component.getComponent());\r\n\t\t\t\tthis.popupInstance = null;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"TooltipOpened\", component.getComponent());\r\n\t\t}\r\n\t}\r\n}\r\n\r\nTooltip.moduleName = \"tooltip\";\r\n\r\nexport default Tooltip;\r\n","export default {\r\n\t//is integer\r\n\tinteger: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && Math.floor(value) === value;\r\n\t},\r\n\r\n\t//is float\r\n\tfloat: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tvalue = Number(value);\r\n\r\n\t\treturn !isNaN(value) && isFinite(value) && value % 1 !== 0;\r\n\t},\r\n\r\n\t//must be a number\r\n\tnumeric: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn !isNaN(value);\r\n\t},\r\n\r\n\t//must be a string\r\n\tstring: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn isNaN(value);\r\n\t},\r\n\r\n\t//maximum value\r\n\tmax: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) <= parameters;\r\n\t},\r\n\r\n\t//minimum value\r\n\tmin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn parseFloat(value) >= parameters;\r\n\t},\r\n\r\n\t//starts with value\r\n\tstarts: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().startsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\t//ends with value\r\n\tends: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).toLowerCase().endsWith(String(parameters).toLowerCase());\r\n\t},\r\n\r\n\r\n\t//minimum string length\r\n\tminLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length >= parameters;\r\n\t},\r\n\r\n\t//maximum string length\r\n\tmaxLength: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn String(value).length <= parameters;\r\n\t},\r\n\r\n\t//in provided value list\r\n\tin: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(typeof parameters == \"string\"){\r\n\t\t\tparameters = parameters.split(\"|\");\r\n\t\t}\r\n\r\n\t\treturn parameters.indexOf(value) > -1;\r\n\t},\r\n\r\n\t//must match provided regex\r\n\tregex: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar reg = new RegExp(parameters);\r\n\r\n\t\treturn reg.test(value);\r\n\t},\r\n\r\n\t//value must be unique in this column\r\n\tunique: function(cell, value, parameters){\r\n\t\tif(value === \"\" || value === null || typeof value === \"undefined\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar unique = true;\r\n\r\n\t\tvar cellData = cell.getData();\r\n\t\tvar column = cell.getColumn()._getSelf();\r\n\r\n\t\tthis.table.rowManager.rows.forEach(function(row){\r\n\t\t\tvar data = row.getData();\r\n\r\n\t\t\tif(data !== cellData){\r\n\t\t\t\tif(value == column.getFieldValue(data)){\r\n\t\t\t\t\tunique = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn unique;\r\n\t},\r\n\r\n\t//must have a value\r\n\trequired:function(cell, value, parameters){\r\n\t\treturn value !== \"\" && value !== null && typeof value !== \"undefined\";\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\n\r\nimport defaultValidators from './defaults/validators.js';\r\n\r\nclass Validate extends Module{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.invalidCells = [];\r\n\t\t\r\n\t\tthis.registerTableOption(\"validationMode\", \"blocking\");\r\n\t\t\r\n\t\tthis.registerColumnOption(\"validator\");\r\n\t\t\r\n\t\tthis.registerTableFunction(\"getInvalidCells\", this.getInvalidCells.bind(this));\r\n\t\tthis.registerTableFunction(\"clearCellValidation\", this.userClearCellValidation.bind(this));\r\n\t\tthis.registerTableFunction(\"validate\", this.userValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"cell\", \"isValid\", this.cellIsValid.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"clearValidation\", this.clearValidation.bind(this));\r\n\t\tthis.registerComponentFunction(\"cell\", \"validate\", this.cellValidate.bind(this));\r\n\t\t\r\n\t\tthis.registerComponentFunction(\"column\", \"validate\", this.columnValidate.bind(this));\r\n\t\tthis.registerComponentFunction(\"row\", \"validate\", this.rowValidate.bind(this));\r\n\t}\r\n\t\r\n\t\r\n\tinitialize(){\r\n\t\tthis.subscribe(\"cell-delete\", this.clearValidation.bind(this));\r\n\t\tthis.subscribe(\"column-layout\", this.initializeColumnCheck.bind(this));\r\n\t\t\r\n\t\tthis.subscribe(\"edit-success\", this.editValidate.bind(this));\r\n\t\tthis.subscribe(\"edit-editor-clear\", this.editorClear.bind(this));\r\n\t\tthis.subscribe(\"edit-edited-clear\", this.editedClear.bind(this));\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Event Handling //////////\r\n\t///////////////////////////////////\r\n\t\r\n\teditValidate(cell, value, previousValue){\r\n\t\tvar valid = this.table.options.validationMode !== \"manual\" ? this.validate(cell.column.modules.validate, cell, value) : true;\r\n\t\t\r\n\t\t// allow time for editor to make render changes then style cell\r\n\t\tif(valid !== true){\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t\tthis.dispatchExternal(\"validationFailed\", cell.getComponent(), value, valid);\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\treturn valid;\r\n\t}\r\n\t\r\n\teditorClear(cell, cancelled){\r\n\t\tif(cancelled){\r\n\t\t\tif(cell.column.modules.validate){\r\n\t\t\t\tthis.cellValidate(cell);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t}\r\n\t\r\n\teditedClear(cell){\r\n\t\tif(cell.modules.validate){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Cell Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcellIsValid(cell){\r\n\t\treturn cell.modules.validate ? (cell.modules.validate.invalid || true) : true;\r\n\t}\r\n\t\r\n\tcellValidate(cell){\r\n\t\treturn this.validate(cell.column.modules.validate, cell, cell.getValue());\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Column Functions ////////\r\n\t///////////////////////////////////\r\n\t\r\n\tcolumnValidate(column){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\tcolumn.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t////////// Row Functions //////////\r\n\t///////////////////////////////////\r\n\t\r\n\trowValidate(row){\r\n\t\tvar invalid = [];\r\n\t\t\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\tif(this.cellValidate(cell) !== true){\r\n\t\t\t\tinvalid.push(cell.getComponent());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn invalid.length ? invalid : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Table Functions /////////\r\n\t///////////////////////////////////\r\n\t\r\n\t\r\n\tuserClearCellValidation(cells){\r\n\t\tif(!cells){\r\n\t\t\tcells = this.getInvalidCells();\r\n\t\t}\r\n\t\t\r\n\t\tif(!Array.isArray(cells)){\r\n\t\t\tcells = [cells];\r\n\t\t}\r\n\t\t\r\n\t\tcells.forEach((cell) => {\r\n\t\t\tthis.clearValidation(cell._getSelf());\r\n\t\t});\r\n\t}\r\n\t\r\n\tuserValidate(cells){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.table.rowManager.rows.forEach((row) => {\r\n\t\t\trow = row.getComponent();\r\n\t\t\t\r\n\t\t\tvar valid = row.validate();\r\n\t\t\t\r\n\t\t\tif(valid !== true){\r\n\t\t\t\toutput = output.concat(valid);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output.length ? output : true;\r\n\t}\r\n\t\r\n\t///////////////////////////////////\r\n\t///////// Internal Logic //////////\r\n\t///////////////////////////////////\r\n\t\r\n\tinitializeColumnCheck(column){\r\n\t\tif(typeof column.definition.validator !== \"undefined\"){\r\n\t\t\tthis.initializeColumn(column);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//validate\r\n\tinitializeColumn(column){\r\n\t\tvar self = this,\r\n\t\tconfig = [],\r\n\t\tvalidator;\r\n\t\t\r\n\t\tif(column.definition.validator){\r\n\t\t\t\r\n\t\t\tif(Array.isArray(column.definition.validator)){\r\n\t\t\t\tcolumn.definition.validator.forEach((item) => {\r\n\t\t\t\t\tvalidator = self._extractValidator(item);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(validator){\r\n\t\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tvalidator = this._extractValidator(column.definition.validator);\r\n\t\t\t\t\r\n\t\t\t\tif(validator){\r\n\t\t\t\t\tconfig.push(validator);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.validate = config.length ? config : false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t_extractValidator(value){\r\n\t\tvar type, params, pos;\r\n\t\t\r\n\t\tswitch(typeof value){\r\n\t\t\tcase \"string\":\r\n\t\t\t\tpos = value.indexOf(':');\r\n\t\t\t\r\n\t\t\t\tif(pos > -1){\r\n\t\t\t\t\ttype = value.substring(0,pos);\r\n\t\t\t\t\tparams = value.substring(pos+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttype = value;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\treturn this._buildValidator(type, params);\r\n\t\t\t\r\n\t\t\tcase \"function\":\r\n\t\t\t\treturn this._buildValidator(value);\r\n\t\t\t\r\n\t\t\tcase \"object\":\r\n\t\t\t\treturn this._buildValidator(value.type, value.parameters);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_buildValidator(type, params){\r\n\t\t\r\n\t\tvar func = typeof type == \"function\" ? type : Validate.validators[type];\r\n\t\t\r\n\t\tif(!func){\r\n\t\t\tconsole.warn(\"Validator Setup Error - No matching validator found:\", type);\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn {\r\n\t\t\t\ttype:typeof type == \"function\" ? \"function\" : type,\r\n\t\t\t\tfunc:func,\r\n\t\t\t\tparams:params,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\t\r\n\tvalidate(validators, cell, value){\r\n\t\tvar self = this,\r\n\t\tfailedValidators = [],\r\n\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\r\n\t\tif(validators){\r\n\t\t\tvalidators.forEach((item) => {\r\n\t\t\t\tif(!item.func.call(self, cell.getComponent(), value, item.params)){\r\n\t\t\t\t\tfailedValidators.push({\r\n\t\t\t\t\t\ttype:item.type,\r\n\t\t\t\t\t\tparameters:item.params\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tif(!cell.modules.validate){\r\n\t\t\tcell.modules.validate = {};\r\n\t\t}\r\n\t\t\r\n\t\tif(!failedValidators.length){\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcell.modules.validate.invalid = failedValidators;\r\n\t\t\t\r\n\t\t\tif(this.table.options.validationMode !== \"manual\"){\r\n\t\t\t\tcell.getElement().classList.add(\"tabulator-validation-fail\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(invalidIndex == -1){\r\n\t\t\t\tthis.invalidCells.push(cell);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn failedValidators.length ? failedValidators : true;\r\n\t}\r\n\t\r\n\tgetInvalidCells(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.invalidCells.forEach((cell) => {\r\n\t\t\toutput.push(cell.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tclearValidation(cell){\r\n\t\tvar invalidIndex;\r\n\t\t\r\n\t\tif(cell.modules.validate && cell.modules.validate.invalid){\r\n\t\t\t\r\n\t\t\tcell.getElement().classList.remove(\"tabulator-validation-fail\");\r\n\t\t\tcell.modules.validate.invalid = false;\r\n\t\t\t\r\n\t\t\tinvalidIndex = this.invalidCells.indexOf(cell);\r\n\t\t\t\r\n\t\t\tif(invalidIndex > -1){\r\n\t\t\t\tthis.invalidCells.splice(invalidIndex, 1);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nValidate.moduleName = \"validate\";\r\n\r\n//load defaults\r\nValidate.validators = defaultValidators;\r\n\r\nexport default Validate;\r\n","export default class OptionsList {\r\n\tconstructor(table, msgType, defaults = {}){\r\n\t\tthis.table = table;\r\n\t\tthis.msgType = msgType;\r\n\t\tthis.registeredDefaults = Object.assign({}, defaults);\r\n\t}\r\n\r\n\tregister(option, value){\r\n\t\tthis.registeredDefaults[option] = value;\r\n\t}\r\n\r\n\tgenerate(defaultOptions, userOptions = {}){\r\n\t\tvar output = Object.assign({}, this.registeredDefaults);\r\n\r\n\t\tObject.assign(output, defaultOptions);\r\n\r\n\t\tif(userOptions.debugInvalidOptions !== false || this.table.options.debugInvalidOptions){\r\n\t\t\tfor (let key in userOptions){\r\n\t\t\t\tif(!output.hasOwnProperty(key)){\r\n\t\t\t\t\tconsole.warn(\"Invalid \" + this.msgType + \" option:\", key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let key in output){\r\n\t\t\tif(key in userOptions){\r\n\t\t\t\toutput[key] = userOptions[key];\r\n\t\t\t}else{\r\n\t\t\t\tif(Array.isArray(output[key])){\r\n\t\t\t\t\toutput[key] = Object.assign([], output[key]);\r\n\t\t\t\t}else if(typeof output[key] === \"object\" && output[key] !== null){\r\n\t\t\t\t\toutput[key] = Object.assign({}, output[key]);\r\n\t\t\t\t}else if (typeof output[key] === \"undefined\"){\r\n\t\t\t\t\tdelete output[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Helpers from '../tools/Helpers.js';\r\n\r\nexport default class Renderer extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.elementVertical = table.rowManager.element;\r\n\t\tthis.elementHorizontal = table.columnManager.element;\r\n\t\tthis.tableElement = table.rowManager.tableElement;\r\n\r\n\t\tthis.verticalFillMode = \"fit\"; // used by row manager to determine how to size the render area (\"fit\" - fits container to the contents, \"fill\" - fills the container without resizing it)\r\n\t}\r\n\r\n\r\n\t///////////////////////////////////\r\n\t/////// Internal Bindings /////////\r\n\t///////////////////////////////////\r\n\r\n\tinitialize(){\r\n\t\t//initialize core functionality\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\t//clear down existing rows layout\r\n\t}\r\n\r\n\tclearColumns(){\r\n\t\t//clear down existing columns layout\r\n\t}\r\n\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\t//resize columns to fit data\r\n\t}\r\n\r\n\r\n\trenderRows(){\r\n\t\t//render rows from a clean slate\r\n\t}\r\n\r\n\trenderColumns(){\r\n\t\t//render columns from a clean slate\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\t// rerender rows and keep position\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\trerenderColumns(update, blockRedraw){\r\n\t\t//rerender columns\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\t//render the cells in a row\r\n\t}\r\n\r\n\trerenderRowCells(row, force){\r\n\t\t//rerender the cells in a row\r\n\t}\r\n\r\n\tscrollColumns(left, dir){\r\n\t\t//handle horizontal scrolling\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\t//handle vertical scrolling\r\n\t}\r\n\r\n\tresize(){\r\n\t\t//container has resized, carry out any needed recalculations (DO NOT RERENDER IN THIS FUNCTION)\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\t//scroll to a specific row\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\t//determine weather the row is nearest the top or bottom of the table, return true for top or false for bottom\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\t//return the visible rows\r\n\t\treturn [];\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t//////// Helper Functions /////////\r\n\t///////////////////////////////////\r\n\r\n\trows(){\r\n\t\treturn this.table.rowManager.getDisplayRows();\r\n\t}\r\n\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\r\n\t///////////////////////////////////\r\n\t/////// External Triggers /////////\r\n\t/////// (DO NOT OVERRIDE) /////////\r\n\t///////////////////////////////////\r\n\r\n\tclear(){\r\n\t\t//clear down existing layout\r\n\t\tthis.clearRows();\r\n\t\tthis.clearColumns();\r\n\t}\r\n\r\n\trender(){\r\n\t\t//render from a clean slate\r\n\t\tthis.renderRows();\r\n\t\tthis.renderColumns();\r\n\t}\r\n\r\n\trerender(callback){\r\n\t\t// rerender and keep position\r\n\t\tthis.rerenderRows();\r\n\t\tthis.rerenderColumns();\r\n\t}\r\n\r\n\tscrollToRowPosition(row, position, ifVisible){\r\n\t\tvar rowIndex = this.rows().indexOf(row),\r\n\t\trowEl = row.getElement(),\r\n\t\toffset = 0;\r\n\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tif(rowIndex > -1){\r\n\r\n\t\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\t\tifVisible = this.table.options.scrollToRowIfVisible;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//check row visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\tif(Helpers.elVisible(rowEl)){\r\n\t\t\t\t\t\toffset = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(offset > 0 && offset < this.elementVertical.clientHeight - rowEl.offsetHeight){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\t\tposition = this.table.options.scrollToRowPosition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(position === \"nearest\"){\r\n\t\t\t\t\tposition = this.scrollToRowNearestTop(row) ? \"top\" : \"bottom\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scroll to row\r\n\t\t\t\tthis.scrollToRow(row);\r\n\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop + (rowEl.offsetTop - this.elementVertical.scrollTop) - ((this.elementVertical.scrollHeight - rowEl.offsetTop) / 2);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.clientHeight / 2);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"bottom\":\r\n\r\n\t\t\t\t\t\tif(this.elementVertical.scrollHeight - this.elementVertical.scrollTop == this.elementVertical.clientHeight){\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - (this.elementVertical.scrollHeight - rowEl.offsetTop) + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.elementVertical.scrollTop = this.elementVertical.scrollTop - this.elementVertical.clientHeight + rowEl.offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"top\":\r\n\t\t\t\t\t\tthis.elementVertical.scrollTop = rowEl.offsetTop;\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresolve();\r\n\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Row not visible\");\r\n\t\t\t\treject(\"Scroll Error - Row not visible\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class BasicHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\trenderRowCells(row){\r\n\t\trow.cells.forEach((cell) => {\r\n\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\tcell.cellRendered();\r\n\t\t});\r\n\t}\r\n\r\n\treinitializeColumnWidths(columns){\r\n\t\tcolumns.forEach(function(column){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t});\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\n\r\nexport default class VirtualDomHorizontal extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.leftCol = 0;\r\n\t\tthis.rightCol = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\t\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t\t\r\n\t\tthis.fitDataColAvg = 0;\r\n\t\t\r\n\t\tthis.windowBuffer = 200; //pixel margin to make column visible before it is shown on screen\r\n\t\t\r\n\t\tthis.visibleRows = null;\r\n\r\n\t\tthis.initialized = false;\r\n\t\tthis.isFitData = false;\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.compatibilityCheck();\r\n\t\tthis.layoutCheck();\r\n\t\tthis.vertScrollListen();\r\n\t}\r\n\t\r\n\tcompatibilityCheck(){\r\n\t\tvar columns = this.options(\"columns\"),\r\n\t\tfrozen = false,\r\n\t\tok = true;\r\n\t\t\r\n\t\tif(this.options(\"layout\") == \"fitDataTable\"){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with fitDataTable layout mode\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"responsiveLayout\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with responsive columns\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(this.options(\"rtl\")){\r\n\t\t\tconsole.warn(\"Horizontal Virtual DOM is not currently compatible with RTL text direction\");\r\n\t\t\tok = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(columns){\r\n\t\t\tfrozen = columns.find((col) => {\r\n\t\t\t\treturn col.frozen;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(frozen){\r\n\t\t\t\tconsole.warn(\"Horizontal Virtual DOM is not compatible with frozen columns\");\r\n\t\t\t\tok = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// if(!ok){\r\n\t\t// \toptions.virtualDomHoz = false;\r\n\t\t// }\r\n\t\t\r\n\t\treturn ok;\r\n\t}\r\n\t\r\n\tlayoutCheck(){\r\n\t\tthis.isFitData = this.options(\"layout\").startsWith('fitData');\r\n\t}\r\n\r\n\tvertScrollListen(){\r\n\t\tthis.subscribe(\"scroll-vertical\", this.clearVisRowCache.bind(this));\r\n\t\tthis.subscribe(\"data-refreshed\", this.clearVisRowCache.bind(this));\r\n\t}\r\n\r\n\tclearVisRowCache(){\r\n\t\tthis.visibleRows = null;\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\t\r\n\trenderColumns(row, force){\r\n\t\tthis.dataChange();\r\n\t}\r\n\r\n\t\r\n\tscrollColumns(left, dir){\r\n\t\tif(this.scrollLeft != left){\r\n\t\t\tthis.scrollLeft = left;\r\n\t\t\t\r\n\t\t\tthis.scroll(left - (this.vDomScrollPosLeft + this.windowBuffer));\r\n\t\t}\r\n\t}\r\n\t\r\n\tcalcWindowBuffer(){\r\n\t\tvar buffer = this.elementVertical.clientWidth;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tif(width > buffer){\r\n\t\t\t\t\tbuffer = width;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.windowBuffer = buffer * 2;\r\n\t}\r\n\t\r\n\trerenderColumns(update, blockRedraw){\t\t\r\n\t\tvar old = {\r\n\t\t\tcols:this.columns,\r\n\t\t\tleftCol:this.leftCol,\r\n\t\t\trightCol:this.rightCol,\r\n\t\t},\r\n\t\tcolPos = 0;\r\n\t\t\r\n\t\t\r\n\t\tif(update && !this.initialized){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.clear();\r\n\t\t\r\n\t\tthis.calcWindowBuffer();\r\n\t\t\r\n\t\tthis.scrollLeft = this.elementVertical.scrollLeft;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = this.scrollLeft - this.windowBuffer;\r\n\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\r\n\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\tvar config = {};\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\tvar width = column.getWidth();\r\n\t\t\t\t\r\n\t\t\t\tconfig.leftPos = colPos;\r\n\t\t\t\tconfig.rightPos = colPos + width;\r\n\t\t\t\t\r\n\t\t\t\tconfig.width = width;\r\n\t\t\t\t\r\n\t\t\t\tif (this.isFitData) {\r\n\t\t\t\t\tconfig.fitDataCheck = column.modules.vdomHoz ? column.modules.vdomHoz.fitDataCheck : true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif((colPos + width > this.vDomScrollPosLeft) && (colPos < this.vDomScrollPosRight)){\r\n\t\t\t\t\t//column is visible\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol == -1){\r\n\t\t\t\t\t\tthis.leftCol = this.columns.length;\r\n\t\t\t\t\t\tthis.vDomPadLeft = colPos;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol = this.columns.length;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// column is hidden\r\n\t\t\t\t\tif(this.leftCol !== -1){\r\n\t\t\t\t\t\tthis.vDomPadRight += width;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\t\r\n\t\t\t\tcolumn.modules.vdomHoz = config;\r\n\t\t\t\t\r\n\t\t\t\tcolPos += width;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tif(!update || this.reinitChanged(old)){\r\n\t\t\t\tthis.reinitializeRows();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.elementVertical.scrollLeft = this.scrollLeft;\r\n\t}\r\n\t\r\n\trenderRowCells(row){\r\n\t\tif(this.initialized){\r\n\t\t\tthis.initializeRow(row);\r\n\t\t}else{\r\n\t\t\trow.cells.forEach((cell) => {\r\n\t\t\t\trow.element.appendChild(cell.getElement());\r\n\t\t\t\tcell.cellRendered();\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\trerenderRowCells(row, force){\r\n\t\tthis.reinitializeRow(row, force);\r\n\t}\r\n\t\r\n\treinitializeColumnWidths(columns){\r\n\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\tthis.columns[i].reinitializeWidth();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\t\r\n\tdeinitialize(){\r\n\t\tthis.initialized = false;\r\n\t}\r\n\t\r\n\tclear(){\r\n\t\tthis.columns = [];\r\n\t\t\r\n\t\tthis.leftCol = -1;\r\n\t\tthis.rightCol = 0;\r\n\t\t\r\n\t\tthis.vDomScrollPosLeft = 0;\r\n\t\tthis.vDomScrollPosRight = 0;\r\n\t\tthis.vDomPadLeft = 0;\r\n\t\tthis.vDomPadRight = 0;\r\n\t}\r\n\t\r\n\tdataChange(){\r\n\t\tvar change = false,\r\n\t\trow, rowEl;\r\n\t\t\r\n\t\tif(this.isFitData){\r\n\t\t\tthis.table.columnManager.columnsByIndex.forEach((column) => {\r\n\t\t\t\tif(!column.definition.width && column.visible){\r\n\t\t\t\t\tchange = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(change && this.table.rowManager.getDisplayRows().length){\r\n\t\t\t\tthis.vDomScrollPosRight = this.scrollLeft + this.elementVertical.clientWidth + this.windowBuffer;\r\n\t\t\t\t\r\n\t\t\t\trow = this.chain(\"rows-sample\", [1], [], () => {\r\n\t\t\t\t\treturn this.table.rowManager.getDisplayRows();\r\n\t\t\t\t})[0];\r\n\t\t\t\t\r\n\t\t\t\tif(row){\r\n\t\t\t\t\trowEl = row.getElement();\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.generateCells();\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.tableElement.appendChild(rowEl);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor(let colEnd = 0; colEnd < row.cells.length; colEnd++){\r\n\t\t\t\t\t\tlet cell = row.cells[colEnd];\r\n\t\t\t\t\t\trowEl.appendChild(cell.getElement());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcell.column.reinitializeWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\r\n\t\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(this.options(\"layout\") === \"fitColumns\"){\r\n\t\t\t\tthis.layoutRefresh();\r\n\t\t\t\tthis.rerenderColumns(false, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitChanged(old){\r\n\t\tvar match = true;\r\n\t\t\r\n\t\tif(old.cols.length !== this.columns.length || old.leftCol !== this.leftCol || old.rightCol !== this.rightCol){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\told.cols.forEach((col, i) => {\r\n\t\t\tif(col !== this.columns[i]){\r\n\t\t\t\tmatch = false;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn !match;\r\n\t}\r\n\t\r\n\treinitializeRows(){\r\n\t\tvar rows = this.getVisibleRows();\r\n\t\trows.forEach((row) => {\r\n\t\t\tthis.reinitializeRow(row, true);\r\n\t\t});\r\n\t}\r\n\t\r\n\tgetVisibleRows(){\r\n\t\tif (!this.visibleRows){\r\n\t\t\tthis.visibleRows = this.table.rowManager.getVisibleRows();\r\n\t\t}\r\n\r\n\t\treturn this.visibleRows;\t\r\n\t}\r\n\t\r\n\tscroll(diff){\r\n\t\tthis.vDomScrollPosLeft += diff;\r\n\t\tthis.vDomScrollPosRight += diff;\r\n\r\n\t\tif(Math.abs(diff) > (this.windowBuffer / 2)){\r\n\t\t\tthis.rerenderColumns();\r\n\t\t}else{\r\n\t\t\tif(diff > 0){\r\n\t\t\t\t//scroll right\r\n\t\t\t\tthis.addColRight();\r\n\t\t\t\tthis.removeColLeft();\r\n\t\t\t}else{\r\n\t\t\t\t//scroll left\r\n\t\t\t\tthis.addColLeft();\r\n\t\t\t\tthis.removeColRight();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tcolPositionAdjust (start, end, diff){\r\n\t\tfor(let i = start; i < end; i++){\r\n\t\t\tlet column = this.columns[i];\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.leftPos += diff;\r\n\t\t\tcolumn.modules.vdomHoz.rightPos += diff;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\t\r\n\t\t\tlet column = this.columns[this.rightCol + 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos <= this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.rightCol++; // Don't move this below the >= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.rightCol >= (this.columns.length - 1)){\r\n\t\t\t\t\t\tthis.vDomPadRight = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadRight -= column.getWidth();\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol - 1];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos >= this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\trow.getElement().prepend(cell.getElement());\r\n\t\t\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.leftCol--; // don't move this below the <= check below\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(this.leftCol <= 0){ // replicating logic in addColRight\r\n\t\t\t\t\t\tthis.vDomPadLeft = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomPadLeft -= column.getWidth();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tlet diff = this.fitDataColActualWidthCheck(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(diff){\r\n\t\t\t\t\t\tthis.scrollLeft = this.elementVertical.scrollLeft = this.elementVertical.scrollLeft + diff;\r\n\t\t\t\t\t\tthis.vDomPadRight -= diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColRight(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.rightCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.leftPos > this.vDomScrollPosRight){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColRight\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadRight += column.getWidth();\r\n\t\t\t\t\tthis.rightCol --;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingRight = this.vDomPadRight + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tremoveColLeft(){\r\n\t\tvar changes = false,\r\n\t\tworking = true;\r\n\t\t\r\n\t\twhile(working){\r\n\t\t\tlet column = this.columns[this.leftCol];\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\tif(column.modules.vdomHoz.rightPos < this.vDomScrollPosLeft){\r\n\t\t\t\t\tchanges = true;\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.getVisibleRows().forEach((row) => {\t\t\t\t\t\r\n\t\t\t\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\t\t\t\tvar cell = row.getCell(column);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\trow.getElement().removeChild(cell.getElement());\r\n\t\t\t\t\t\t\t} catch (ex) {\r\n\t\t\t\t\t\t\t\tconsole.warn(\"Could not removeColLeft\", ex.message);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.vDomPadLeft += column.getWidth();\r\n\t\t\t\t\tthis.leftCol ++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(changes){\r\n\t\t\tthis.tableElement.style.paddingLeft = this.vDomPadLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tfitDataColActualWidthCheck(column){\r\n\t\tvar newWidth, widthDiff;\r\n\t\t\r\n\t\tif(column.modules.vdomHoz.fitDataCheck){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t\r\n\t\t\tnewWidth = column.getWidth();\r\n\t\t\twidthDiff = newWidth - column.modules.vdomHoz.width;\r\n\t\t\t\r\n\t\t\tif(widthDiff){\r\n\t\t\t\tcolumn.modules.vdomHoz.rightPos += widthDiff;\r\n\t\t\t\tcolumn.modules.vdomHoz.width = newWidth;\r\n\t\t\t\tthis.colPositionAdjust(this.columns.indexOf(column) + 1, this.columns.length, widthDiff);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumn.modules.vdomHoz.fitDataCheck = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn widthDiff;\r\n\t}\r\n\t\r\n\tinitializeRow(row){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\trow.modules.vdomHoz = {\r\n\t\t\t\tleftCol:this.leftCol,\r\n\t\t\t\trightCol:this.rightCol,\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tfor(let i = this.leftCol; i <= this.rightCol; i++){\r\n\t\t\t\tlet column = this.columns[i];\r\n\t\t\t\t\r\n\t\t\t\tif(column && column.visible){\r\n\t\t\t\t\tlet cell = row.getCell(column);\r\n\t\t\t\t\t\r\n\t\t\t\t\trow.getElement().appendChild(cell.getElement());\r\n\t\t\t\t\tcell.cellRendered();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treinitializeRow(row, force){\r\n\t\tif(row.type !== \"group\"){\r\n\t\t\tif(force || !row.modules.vdomHoz || row.modules.vdomHoz.leftCol !== this.leftCol || row.modules.vdomHoz.rightCol !== this.rightCol){\r\n\t\t\t\tvar rowEl = row.getElement();\r\n\t\t\t\twhile(rowEl.firstChild) rowEl.removeChild(rowEl.firstChild);\r\n\t\t\t\t\r\n\t\t\t\tthis.initializeRow(row);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Column from './column/Column.js';\r\nimport ColumnComponent from './column/ColumnComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport RendererBasicHorizontal from './rendering/renderers/BasicHorizontal.js';\r\nimport RendererVirtualDomHorizontal from './rendering/renderers/VirtualDomHorizontal.js';\r\n\r\nimport defaultColumnOptions from './column/defaults/options.js';\r\n\r\nexport default class ColumnManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.blockHozScrollEvent = false;\r\n\t\tthis.headersElement = null;\r\n\t\tthis.element = null ; //containing element\r\n\t\tthis.columns = []; // column definition object\r\n\t\tthis.columnsByIndex = []; //columns by index\r\n\t\tthis.columnsByField = {}; //columns by field\r\n\t\tthis.scrollLeft = 0;\r\n\t\tthis.optionsList = new OptionsList(this.table, \"column definition\", defaultColumnOptions);\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockUpdate = null; //store latest redraw update only status\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t////////////// Setup Functions /////////////////\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\tthis.headersElement = this.createHeadersElement();\r\n\t\tthis.element = this.createHeaderElement();\r\n\t\t\r\n\t\tthis.element.insertBefore(this.headersElement, this.element.firstChild);\r\n\t\t\r\n\t\tthis.subscribe(\"scroll-horizontal\", this.scrollHorizontal.bind(this));\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomHorizontal,\r\n\t\t\t\"basic\": RendererBasicHorizontal,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderHorizontal === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderHorizontal];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderHorizontal;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderHorizontal);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tcreateHeadersElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-headers\");\r\n\t\tel.setAttribute(\"role\", \"row\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateHeaderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-header\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\tif(!this.table.options.headerVisible){\r\n\t\t\tel.classList.add(\"tabulator-header-hidden\");\r\n\t\t}\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return header containing element\r\n\tgetHeadersElement(){\r\n\t\treturn this.headersElement;\r\n\t}\r\n\t\r\n\t//scroll horizontally to match table body\r\n\tscrollHorizontal(left){\r\n\t\tvar hozAdjust = 0,\r\n\t\tscrollWidth = this.element.scrollWidth - this.table.element.clientWidth;\r\n\t\t\r\n\t\t// this.tempScrollBlock();\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar moving table when present\r\n\t\tif(left > scrollWidth){\r\n\t\t\thozAdjust = left - scrollWidth;\r\n\t\t\tthis.element.style.marginLeft = (-(hozAdjust)) + \"px\";\r\n\t\t}else{\r\n\t\t\tthis.element.style.marginLeft = 0;\r\n\t\t}\r\n\t\t\r\n\t\tthis.scrollLeft = left;\r\n\t\t\r\n\t\tthis.renderer.scrollColumns(left);\r\n\t}\r\n\t\r\n\t///////////// Column Setup Functions /////////////\r\n\tgenerateColumnsFromRowData(data){\r\n\t\tvar cols = [],\r\n\t\tdefinitions = this.table.options.autoColumnsDefinitions,\r\n\t\trow, sorter;\r\n\t\t\r\n\t\tif(data && data.length){\r\n\t\t\t\r\n\t\t\trow = data[0];\r\n\t\t\t\r\n\t\t\tfor(var key in row){\r\n\t\t\t\tlet col = {\r\n\t\t\t\t\tfield:key,\r\n\t\t\t\t\ttitle:key,\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tlet value = row[key];\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof value){\r\n\t\t\t\t\tcase \"undefined\":\r\n\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"boolean\":\r\n\t\t\t\t\t\tsorter = \"boolean\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(value)){\r\n\t\t\t\t\t\t\tsorter = \"array\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tif(!isNaN(value) && value !== \"\"){\r\n\t\t\t\t\t\t\tsorter = \"number\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(value.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){\r\n\t\t\t\t\t\t\t\tsorter = \"alphanum\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tsorter = \"string\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcol.sorter = sorter;\r\n\t\t\t\t\r\n\t\t\t\tcols.push(col);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(definitions){\r\n\t\t\t\t\r\n\t\t\t\tswitch(typeof definitions){\r\n\t\t\t\t\tcase \"function\":\r\n\t\t\t\t\t\tthis.table.options.columns = definitions.call(this.table, cols);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"object\":\r\n\t\t\t\t\t\tif(Array.isArray(definitions)){\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tvar match = definitions.find((def) => {\r\n\t\t\t\t\t\t\t\t\treturn def.field === col.field;\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(match){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, match);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tcols.forEach((col) => {\r\n\t\t\t\t\t\t\t\tif(definitions[col.field]){\r\n\t\t\t\t\t\t\t\t\tObject.assign(col, definitions[col.field]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tthis.table.options.columns = cols;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.setColumns(this.table.options.columns);\r\n\t\t}\r\n\t}\r\n\t\r\n\tsetColumns(cols, row){\r\n\t\twhile(this.headersElement.firstChild) this.headersElement.removeChild(this.headersElement.firstChild);\r\n\t\t\r\n\t\tthis.columns = [];\r\n\t\tthis.columnsByIndex = [];\r\n\t\tthis.columnsByField = {};\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loading\");\r\n\t\t\r\n\t\tcols.forEach((def, i) => {\r\n\t\t\tthis._addColumn(def);\r\n\t\t});\r\n\t\t\r\n\t\tthis._reIndexColumns();\r\n\t\t\r\n\t\tthis.dispatch(\"columns-loaded\");\r\n\t\t\r\n\t\tthis.rerenderColumns(false, true);\r\n\t\t\r\n\t\tthis.redraw(true);\r\n\t}\r\n\t\r\n\t_addColumn(definition, before, nextToColumn){\r\n\t\tvar column = new Column(definition, this),\r\n\t\tcolEl = column.getElement(),\r\n\t\tindex = nextToColumn ? this.findColumnIndex(nextToColumn) : nextToColumn;\r\n\t\t\r\n\t\tif(nextToColumn && index > -1){\r\n\t\t\tvar topColumn = nextToColumn.getTopColumn();\r\n\t\t\tvar parentIndex = this.columns.indexOf(topColumn);\r\n\t\t\tvar nextEl = topColumn.getElement();\r\n\t\t\t\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.splice(parentIndex, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.splice(parentIndex + 1, 0, column);\r\n\t\t\t\tnextEl.parentNode.insertBefore(colEl, nextEl.nextSibling);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(before){\r\n\t\t\t\tthis.columns.unshift(column);\r\n\t\t\t\tthis.headersElement.insertBefore(column.getElement(), this.headersElement.firstChild);\r\n\t\t\t}else{\r\n\t\t\t\tthis.columns.push(column);\r\n\t\t\t\tthis.headersElement.appendChild(column.getElement());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcolumn.columnRendered();\r\n\t\t\r\n\t\treturn column;\r\n\t}\r\n\t\r\n\tregisterColumnField(col){\r\n\t\tif(col.definition.field){\r\n\t\t\tthis.columnsByField[col.definition.field] = col;\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterColumnPosition(col){\r\n\t\tthis.columnsByIndex.push(col);\r\n\t}\r\n\t\r\n\t_reIndexColumns(){\r\n\t\tthis.columnsByIndex = [];\r\n\t\t\r\n\t\tthis.columns.forEach(function(column){\r\n\t\t\tcolumn.reRegisterPosition();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//ensure column headers take up the correct amount of space in column groups\r\n\tverticalAlignHeaders(){\r\n\t\tvar minHeight = 0;\r\n\t\t\r\n\t\tif(!this.redrawBlock){\r\n\r\n\t\t\tthis.headersElement.style.height=\"\";\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.clearVerticalAlign();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tvar height = column.getHeight();\r\n\t\t\t\t\r\n\t\t\t\tif(height > minHeight){\r\n\t\t\t\t\tminHeight = height;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.headersElement.style.height = minHeight + \"px\";\r\n\r\n\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\tcolumn.verticalAlign(this.table.options.columnHeaderVertAlign, minHeight);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.adjustTableSize();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//////////////// Column Details /////////////////\r\n\tfindColumn(subject){\r\n\t\tvar columns;\r\n\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\t\r\n\t\t\tif(subject instanceof Column){\r\n\t\t\t\t//subject is column element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof ColumnComponent){\r\n\t\t\t\t//subject is public column component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\r\n\t\t\t\tcolumns = [];\r\n\r\n\t\t\t\tthis.columns.forEach((column) => {\r\n\t\t\t\t\tcolumns.push(column);\r\n\t\t\t\t\tcolumns = columns.concat(column.getColumns(true));\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//subject is a HTML element of the column header\r\n\t\t\t\tlet match = columns.find((column) => {\r\n\t\t\t\t\treturn column.element === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the field name of the column\r\n\t\t\treturn this.columnsByField[subject] || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetColumnByField(field){\r\n\t\treturn this.columnsByField[field];\r\n\t}\r\n\t\r\n\tgetColumnsByFieldRoot(root){\r\n\t\tvar matches = [];\r\n\t\t\r\n\t\tObject.keys(this.columnsByField).forEach((field) => {\r\n\t\t\tvar fieldRoot = field.split(\".\")[0];\r\n\t\t\tif(fieldRoot === root){\r\n\t\t\t\tmatches.push(this.columnsByField[field]);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\tgetColumnByIndex(index){\r\n\t\treturn this.columnsByIndex[index];\r\n\t}\r\n\t\r\n\tgetFirstVisibleColumn(){\r\n\t\tvar index = this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn col.visible;\r\n\t\t});\r\n\t\t\r\n\t\treturn index > -1 ? this.columnsByIndex[index] : false;\r\n\t}\r\n\t\r\n\tgetColumns(){\r\n\t\treturn this.columns;\r\n\t}\r\n\t\r\n\tfindColumnIndex(column){\r\n\t\treturn this.columnsByIndex.findIndex((col) => {\r\n\t\t\treturn column === col;\r\n\t\t});\r\n\t}\r\n\t\r\n\t//return all columns that are not groups\r\n\tgetRealColumns(){\r\n\t\treturn this.columnsByIndex;\r\n\t}\r\n\t\r\n\t//traverse across columns and call action\r\n\ttraverse(callback){\r\n\t\tthis.columnsByIndex.forEach((column,i) =>{\r\n\t\t\tcallback(column, i);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get definitions of actual columns\r\n\tgetDefinitions(active){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(!active || (active && column.visible)){\r\n\t\t\t\toutput.push(column.getDefinition());\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\t//get full nested definition tree\r\n\tgetDefinitionTree(){\r\n\t\tvar output = [];\r\n\t\t\r\n\t\tthis.columns.forEach((column) => {\r\n\t\t\toutput.push(column.getDefinition(true));\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(structured){\r\n\t\tvar output = [],\r\n\t\tcolumns = structured ? this.columns : this.columnsByIndex;\r\n\t\t\r\n\t\tcolumns.forEach((column) => {\r\n\t\t\toutput.push(column.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetWidth(){\r\n\t\tvar width = 0;\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tif(column.visible){\r\n\t\t\t\twidth += column.getWidth();\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn width;\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tto.element.parentNode.insertBefore(from.element, to.element);\r\n\t\t\r\n\t\tif(after){\r\n\t\t\tto.element.parentNode.insertBefore(to.element, from.element);\r\n\t\t}\r\n\t\t\r\n\t\tthis.moveColumnActual(from, to, after);\r\n\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.table.rowManager.reinitialize();\r\n\t}\r\n\t\r\n\tmoveColumnActual(from, to, after){\r\n\t\tif(from.parent.isGroup){\r\n\t\t\tthis._moveColumnInArray(from.parent.columns, from, to, after);\r\n\t\t}else{\r\n\t\t\tthis._moveColumnInArray(this.columns, from, to, after);\r\n\t\t}\r\n\t\t\r\n\t\tthis._moveColumnInArray(this.columnsByIndex, from, to, after, true);\r\n\t\t\r\n\t\tthis.rerenderColumns(true);\r\n\t\t\r\n\t\tthis.dispatch(\"column-moved\", from, to, after);\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"columnMoved\")){\r\n\t\t\tthis.dispatchExternal(\"columnMoved\", from.getComponent(), this.table.columnManager.getComponents());\r\n\t\t}\r\n\t}\r\n\t\r\n\t_moveColumnInArray(columns, from, to, after, updateRows){\r\n\t\tvar\tfromIndex = columns.indexOf(from),\r\n\t\ttoIndex, rows = [];\r\n\t\t\r\n\t\tif (fromIndex > -1) {\r\n\t\t\t\r\n\t\t\tcolumns.splice(fromIndex, 1);\r\n\t\t\t\r\n\t\t\ttoIndex = columns.indexOf(to);\r\n\t\t\t\r\n\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\tif(after){\r\n\t\t\t\t\ttoIndex = toIndex+1;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\ttoIndex = fromIndex;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcolumns.splice(toIndex, 0, from);\r\n\t\t\t\r\n\t\t\tif(updateRows){\r\n\t\t\t\t\r\n\t\t\t\trows = this.chain(\"column-moving-rows\", [from, to, after], null, []) || [];\r\n\t\t\t\t\r\n\t\t\t\trows = rows.concat(this.table.rowManager.rows);\r\n\t\t\t\t\r\n\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\tif(row.cells.length){\r\n\t\t\t\t\t\tvar cell = row.cells.splice(fromIndex, 1)[0];\r\n\t\t\t\t\t\trow.cells.splice(toIndex, 0, cell);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tscrollToColumn(column, position, ifVisible){\r\n\t\tvar left = 0,\r\n\t\toffset = 0,\r\n\t\tadjust = 0,\r\n\t\tcolEl = column.getElement();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\r\n\t\t\tif(typeof position === \"undefined\"){\r\n\t\t\t\tposition = this.table.options.scrollToColumnPosition;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(typeof ifVisible === \"undefined\"){\r\n\t\t\t\tifVisible = this.table.options.scrollToColumnIfVisible;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\t//align to correct position\r\n\t\t\t\tswitch(position){\r\n\t\t\t\t\tcase \"middle\":\r\n\t\t\t\t\tcase \"center\":\r\n\t\t\t\t\t\tadjust = -this.element.clientWidth / 2;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"right\":\r\n\t\t\t\t\t\tadjust = colEl.clientWidth - this.headersElement.clientWidth;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//check column visibility\r\n\t\t\t\tif(!ifVisible){\r\n\t\t\t\t\t\r\n\t\t\t\t\toffset = colEl.offsetLeft;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(offset > 0 && offset + colEl.offsetWidth < this.element.clientWidth){\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//calculate scroll position\r\n\t\t\t\tleft = colEl.offsetLeft + adjust;\r\n\t\t\t\t\r\n\t\t\t\tleft = Math.max(Math.min(left, this.table.rowManager.element.scrollWidth - this.table.rowManager.element.clientWidth),0);\r\n\t\t\t\t\r\n\t\t\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t\t\t\tthis.scrollHorizontal(left);\r\n\t\t\t\t\r\n\t\t\t\tresolve();\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - Column not visible\");\r\n\t\t\t\treject(\"Scroll Error - Column not visible\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////////// Cell Management /////////////////\r\n\tgenerateCells(row){\r\n\t\tvar cells = [];\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach((column) => {\r\n\t\t\tcells.push(column.generateCell(row));\r\n\t\t});\r\n\t\t\r\n\t\treturn cells;\r\n\t}\r\n\t\r\n\t//////////////// Column Management /////////////////\r\n\tgetFlexBaseWidth(){\r\n\t\tvar totalWidth = this.table.element.clientWidth, //table element width\r\n\t\tfixedWidth = 0;\r\n\t\t\r\n\t\t//adjust for vertical scrollbar if present\r\n\t\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.columnsByIndex.forEach(function(column){\r\n\t\t\tvar width, minWidth, colWidth;\r\n\t\t\t\r\n\t\t\tif(column.visible){\r\n\t\t\t\t\r\n\t\t\t\twidth = column.definition.width || 0;\r\n\t\t\t\t\r\n\t\t\t\tminWidth = parseInt(column.minWidth);\r\n\t\t\t\t\r\n\t\t\t\tif(typeof(width) == \"string\"){\r\n\t\t\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width) ;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcolWidth = width;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn fixedWidth;\r\n\t}\r\n\t\r\n\taddColumn(definition, before, nextToColumn){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this._addColumn(definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tthis._reIndexColumns();\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"column-add\", definition, before, nextToColumn);\r\n\t\t\t\r\n\t\t\tif(this.layoutMode() != \"fitColumns\"){\r\n\t\t\t\tcolumn.reinitializeWidth();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.redraw(true);\r\n\t\t\t\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t\t\r\n\t\t\tthis.rerenderColumns();\r\n\t\t\t\r\n\t\t\tresolve(column);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//remove column from system\r\n\tderegisterColumn(column){\r\n\t\tvar field = column.getField(),\r\n\t\tindex;\r\n\t\t\r\n\t\t//remove from field list\r\n\t\tif(field){\r\n\t\t\tdelete this.columnsByField[field];\r\n\t\t}\r\n\t\t\r\n\t\t//remove from index list\r\n\t\tindex = this.columnsByIndex.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columnsByIndex.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\t//remove from column list\r\n\t\tindex = this.columns.indexOf(column);\r\n\t\t\r\n\t\tif(index > -1){\r\n\t\t\tthis.columns.splice(index, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.verticalAlignHeaders();\r\n\t\t\r\n\t\tthis.redraw();\r\n\t}\r\n\t\r\n\trerenderColumns(update, silent){\r\n\t\tif(!this.redrawBlock){\r\n\t\t\tthis.renderer.rerenderColumns(update, silent);\r\n\t\t}else{\r\n\t\t\tif(update === false || (update === true && this.redrawBlockUpdate === null)){\r\n\t\t\t\tthis.redrawBlockUpdate = update;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tblockRedraw(){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockUpdate = null;\r\n\t}\r\n\t\r\n\trestoreRedraw(){\r\n\t\tthis.redrawBlock = false;\r\n\t\tthis.verticalAlignHeaders();\r\n\t\tthis.renderer.rerenderColumns(this.redrawBlockUpdate);\r\n\t\t\r\n\t}\r\n\t\r\n\t//redraw columns\r\n\tredraw(force){\r\n\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\tthis.verticalAlignHeaders();\r\n\t\t}\r\n\t\t\r\n\t\tif(force){\r\n\t\t\tthis.table.rowManager.resetScroll();\r\n\t\t\tthis.table.rowManager.reinitialize();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.confirm(\"table-redrawing\", force)){\r\n\t\t\tthis.layoutRefresh(force);\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-redraw\", force);\r\n\t\t\r\n\t\tthis.table.footerManager.redraw();\r\n\t}\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class BasicVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t}\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.scrollTop = 0;\r\n\t\telement.scrollLeft = 0;\r\n\r\n\t\telement.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tvar element = this.tableElement,\r\n\t\tonlyGroupHeaders = true;\r\n\r\n\t\tthis.rows().forEach((row, index) => {\r\n\t\t\tthis.styleRow(row, index);\r\n\t\t\telement.appendChild(row.getElement());\r\n\t\t\trow.initialize(true);\r\n\r\n\t\t\tif(row.type !== \"group\"){\r\n\t\t\t\tonlyGroupHeaders = false;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(onlyGroupHeaders){\r\n\t\t\telement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t}else{\r\n\t\t\telement.style.minWidth = \"\";\r\n\t\t}\r\n\t}\r\n\r\n\r\n\trerenderRows(callback){\r\n\t\tthis.clearRows();\r\n\t\tthis.renderRows();\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowTop = Helpers.elOffset(row.getElement()).top;\r\n\r\n\t\treturn !(Math.abs(this.elementVertical.scrollTop - rowTop) > Math.abs(this.elementVertical.scrollTop + this.elementVertical.clientHeight - rowTop));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar rowEl = row.getElement();\r\n\r\n\t\tthis.elementVertical.scrollTop = Helpers.elOffset(rowEl).top - Helpers.elOffset(this.elementVertical).top + this.elementVertical.scrollTop;\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\treturn this.rows();\r\n\t}\r\n\r\n}","import Renderer from '../Renderer.js';\r\nimport Helpers from '../../tools/Helpers.js';\r\n\r\nexport default class VirtualDomVertical extends Renderer{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.verticalFillMode = \"fill\";\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomRowHeight = 20; //approximation of row heights for padding\r\n\r\n\t\tthis.vDomTop = 0; //hold position for first rendered row in the virtual DOM\r\n\t\tthis.vDomBottom = 0; //hold position for last rendered row in the virtual DOM\r\n\r\n\t\tthis.vDomScrollPosTop = 0; //last scroll position of the vDom top;\r\n\t\tthis.vDomScrollPosBottom = 0; //last scroll position of the vDom bottom;\r\n\r\n\t\tthis.vDomTopPad = 0; //hold value of padding for top of virtual DOM\r\n\t\tthis.vDomBottomPad = 0; //hold value of padding for bottom of virtual DOM\r\n\r\n\t\tthis.vDomMaxRenderChain = 90; //the maximum number of dom elements that can be rendered in 1 go\r\n\r\n\t\tthis.vDomWindowBuffer = 0; //window row buffer before removing elements, to smooth scrolling\r\n\r\n\t\tthis.vDomWindowMinTotalRows = 20; //minimum number of rows to be generated in virtual dom (prevent buffering issues on tables with tall rows)\r\n\t\tthis.vDomWindowMinMarginRows = 5; //minimum number of rows to be generated in virtual dom margin\r\n\r\n\t\tthis.vDomTopNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t\tthis.vDomBottomNewRows = []; //rows to normalize after appending to optimize render speed\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t///////// Public Functions ///////////\r\n\t//////////////////////////////////////\r\n\r\n\tclearRows(){\r\n\t\tvar element = this.tableElement;\r\n\r\n\t\t// element.children.detach();\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\telement.style.paddingTop = \"\";\r\n\t\telement.style.paddingBottom = \"\";\r\n\t\t// element.style.minWidth = \"\";\r\n\t\telement.style.minHeight = \"\";\r\n\t\telement.style.display = \"\";\r\n\t\telement.style.visibility = \"\";\r\n\r\n\t\tthis.elementVertical.scrollTop = 0;\r\n\t\tthis.elementVertical.scrollLeft = 0;\r\n\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\r\n\t\tthis.vDomTop = 0;\r\n\t\tthis.vDomBottom = 0;\r\n\t\tthis.vDomTopPad = 0;\r\n\t\tthis.vDomBottomPad = 0;\r\n\t\tthis.vDomScrollPosTop = 0;\r\n\t\tthis.vDomScrollPosBottom = 0;\r\n\t}\r\n\r\n\trenderRows(){\r\n\t\tthis._virtualRenderFill();\r\n\t}\r\n\r\n\trerenderRows(callback){\r\n\t\tvar scrollTop = this.elementVertical.scrollTop;\r\n\t\tvar topRow = false;\r\n\t\tvar topOffset = false;\r\n\r\n\t\tvar left = this.table.rowManager.scrollLeft;\r\n\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\r\n\t\t\tif(rows[i]){\r\n\t\t\t\tvar diff = scrollTop - rows[i].getElement().offsetTop;\r\n\r\n\t\t\t\tif(topOffset === false || Math.abs(diff) < topOffset){\r\n\t\t\t\t\ttopOffset = diff;\r\n\t\t\t\t\ttopRow = i;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\trows.forEach((row) => {\r\n\t\t\trow.deinitializeHeight();\r\n\t\t});\r\n\r\n\t\tif(callback){\r\n\t\t\tcallback();\r\n\t\t}\r\n\r\n\t\tif(this.rows().length){\r\n\t\t\tthis._virtualRenderFill((topRow === false ? this.rows.length - 1 : topRow), true, topOffset || 0);\r\n\t\t}else{\r\n\t\t\tthis.clear();\r\n\t\t\tthis.table.rowManager._showPlaceholder();\r\n\t\t}\r\n\r\n\t\tthis.scrollColumns(left);\r\n\t}\r\n\r\n\tscrollColumns(left){\r\n\t\tthis.table.rowManager.scrollHorizontal(left);\r\n\t}\r\n\r\n\tscrollRows(top, dir){\r\n\t\tvar topDiff = top - this.vDomScrollPosTop;\r\n\t\tvar bottomDiff = top - this.vDomScrollPosBottom;\r\n\t\tvar margin = this.vDomWindowBuffer * 2;\r\n\t\tvar rows = this.rows();\r\n\r\n\t\tthis.scrollTop = top;\r\n\r\n\t\tif(-topDiff > margin || bottomDiff > margin){\r\n\t\t\t//if big scroll redraw table;\r\n\t\t\tvar left = this.table.rowManager.scrollLeft;\r\n\t\t\tthis._virtualRenderFill(Math.floor((this.elementVertical.scrollTop / this.elementVertical.scrollHeight) * rows.length));\r\n\t\t\tthis.scrollColumns(left);\r\n\t\t}else{\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\t//scrolling up\r\n\t\t\t\tif(topDiff < 0){\r\n\t\t\t\t\tthis._addTopRow(rows, -topDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(bottomDiff < 0){\r\n\t\t\t\t\t//hide bottom row if needed\r\n\t\t\t\t\tif(this.vDomScrollHeight - this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeBottomRow(rows, -bottomDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\r\n\t\t\t\tif(bottomDiff >= 0){\r\n\t\t\t\t\tthis._addBottomRow(rows, bottomDiff);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//scrolling down\r\n\t\t\t\tif(topDiff >= 0){\r\n\t\t\t\t\t//hide top row if needed\r\n\t\t\t\t\tif(this.scrollTop > this.vDomWindowBuffer){\r\n\t\t\t\t\t\tthis._removeTopRow(rows, topDiff);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tresize(){\r\n\t\tthis.vDomWindowBuffer = this.table.options.renderVerticalBuffer || this.elementVertical.clientHeight;\r\n\t}\r\n\r\n\tscrollToRowNearestTop(row){\r\n\t\tvar rowIndex = this.rows().indexOf(row);\r\n\r\n\t\treturn !(Math.abs(this.vDomTop - rowIndex) > Math.abs(this.vDomBottom - rowIndex));\r\n\t}\r\n\r\n\tscrollToRow(row){\r\n\t\tvar index = this.rows().indexOf(row);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tthis._virtualRenderFill(index, true);\r\n\t\t}\r\n\t}\r\n\r\n\tvisibleRows(includingBuffer){\r\n\t\tvar topEdge = this.elementVertical.scrollTop,\r\n\t\tbottomEdge = this.elementVertical.clientHeight + topEdge,\r\n\t\ttopFound = false,\r\n\t\ttopRow = 0,\r\n\t\tbottomRow = 0,\r\n\t\trows = this.rows();\r\n\r\n\t\tif(includingBuffer){\r\n\t\t\ttopRow = this.vDomTop;\r\n\t\t\tbottomRow = this.vDomBottom;\r\n\t\t}else{\r\n\t\t\tfor(var i = this.vDomTop; i <= this.vDomBottom; i++){\r\n\t\t\t\tif(rows[i]){\r\n\t\t\t\t\tif(!topFound){\r\n\t\t\t\t\t\tif((topEdge - rows[i].getElement().offsetTop) >= 0){\r\n\t\t\t\t\t\t\ttopRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\ttopFound = true;\r\n\r\n\t\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(bottomEdge - rows[i].getElement().offsetTop >= 0){\r\n\t\t\t\t\t\t\tbottomRow = i;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rows.slice(topRow, bottomRow + 1);\r\n\t}\r\n\r\n\t//////////////////////////////////////\r\n\t//////// Internal Rendering //////////\r\n\t//////////////////////////////////////\r\n\r\n\t//full virtual render\r\n\t_virtualRenderFill(position, forceMove, offset){\r\n\t\tvar\telement = this.tableElement,\r\n\t\tholder = this.elementVertical,\r\n\t\ttopPad = 0,\r\n\t\trowsHeight = 0,\r\n\t\theightOccupied = 0,\r\n\t\ttopPadHeight = 0,\r\n\t\ti = 0,\r\n\t\trows = this.rows(),\r\n\t\trowsCount = rows.length,\r\n\t\tcontainerHeight = this.elementVertical.clientHeight;\r\n\r\n\t\tposition = position || 0;\r\n\r\n\t\toffset = offset || 0;\r\n\r\n\t\tif(!position){\r\n\t\t\tthis.clear();\r\n\t\t}else{\r\n\t\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\r\n\t\t\t//check if position is too close to bottom of table\r\n\t\t\theightOccupied = (rowsCount - position + 1) * this.vDomRowHeight;\r\n\r\n\t\t\tif(heightOccupied < containerHeight){\r\n\t\t\t\tposition -= Math.ceil((containerHeight - heightOccupied) / this.vDomRowHeight);\r\n\t\t\t\tif(position < 0){\r\n\t\t\t\t\tposition = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//calculate initial pad\r\n\t\t\ttopPad = Math.min(Math.max(Math.floor(this.vDomWindowBuffer / this.vDomRowHeight), this.vDomWindowMinMarginRows), position);\r\n\t\t\tposition -= topPad;\r\n\t\t}\r\n\r\n\t\tif(rowsCount && Helpers.elVisible(this.elementVertical)){\r\n\t\t\tthis.vDomTop = position;\r\n\r\n\t\t\tthis.vDomBottom = position -1;\r\n\r\n\t\t\twhile ((rowsHeight <= containerHeight + this.vDomWindowBuffer || i < this.vDomWindowMinTotalRows) && this.vDomBottom < rowsCount -1){\r\n\t\t\t\tvar index = this.vDomBottom + 1,\r\n\t\t\t\trow = rows[index],\r\n\t\t\t\trowHeight = 0;\r\n\r\n\t\t\t\tthis.styleRow(row, index);\r\n\r\n\t\t\t\telement.appendChild(row.getElement());\r\n\r\n\t\t\t\trow.initialize();\r\n\r\n\t\t\t\tif(!row.heightInitialized){\r\n\t\t\t\t\trow.normalizeHeight(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\trowHeight = row.getHeight();\r\n\r\n\t\t\t\tif(i < topPad){\r\n\t\t\t\t\ttopPadHeight += rowHeight;\r\n\t\t\t\t}else{\r\n\t\t\t\t\trowsHeight += rowHeight;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.vDomBottom ++;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\r\n\t\t\tif(!position){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t\t//adjust row height to match average of rendered elements\r\n\t\t\t\tthis.vDomRowHeight = Math.floor((rowsHeight + topPadHeight) / i);\r\n\t\t\t\tthis.vDomBottomPad = this.vDomRowHeight * (rowsCount - this.vDomBottom -1);\r\n\r\n\t\t\t\tthis.vDomScrollHeight = topPadHeight + rowsHeight + this.vDomBottomPad - containerHeight;\r\n\t\t\t}else{\r\n\t\t\t\tthis.vDomTopPad = !forceMove ? this.scrollTop - topPadHeight : (this.vDomRowHeight * this.vDomTop) + offset;\r\n\t\t\t\tthis.vDomBottomPad = this.vDomBottom == rowsCount-1 ? 0 : Math.max(this.vDomScrollHeight - this.vDomTopPad - rowsHeight - topPadHeight, 0);\r\n\t\t\t}\r\n\r\n\t\t\telement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\telement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\r\n\t\t\tif(forceMove){\r\n\t\t\t\tthis.scrollTop = this.vDomTopPad + (topPadHeight) + offset - (this.elementVertical.scrollWidth > this.elementVertical.clientWidth ? this.elementVertical.offsetHeight - containerHeight : 0);\r\n\t\t\t}\r\n\r\n\t\t\tthis.scrollTop = Math.min(this.scrollTop, this.elementVertical.scrollHeight - containerHeight);\r\n\r\n\t\t\t//adjust for horizontal scrollbar if present (and not at top of table)\r\n\t\t\tif(this.elementVertical.scrollWidth > this.elementVertical.offsetWidth && forceMove){\r\n\t\t\t\tthis.scrollTop += this.elementVertical.offsetHeight - containerHeight;\r\n\t\t\t}\r\n\r\n\t\t\tthis.vDomScrollPosTop = this.scrollTop;\r\n\t\t\tthis.vDomScrollPosBottom = this.scrollTop;\r\n\r\n\t\t\tholder.scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.dispatch(\"render-virtual-fill\");\r\n\t\t}\r\n\t}\r\n\r\n\t_addTopRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomTop -1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tif(this.vDomTop){\r\n\t\t\t\tlet row = rows[index],\r\n\t\t\t\trowHeight, initialized;\r\n\r\n\t\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\t\ttable.insertBefore(row.getElement(), table.firstChild);\r\n\r\n\t\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\t\tthis.vDomTop--;\r\n\t\t\t\t\t\tindex--;\r\n\t\t\t\t\t\ti++;\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tworking = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomTopPad < 0){\r\n\t\t\t\tthis.vDomTopPad = index * this.vDomRowHeight;\r\n\t\t\t}\r\n\r\n\t\t\tif(index < 1){\r\n\t\t\t\tthis.vDomTopPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeTopRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomTop],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomTop++;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomTopPad += paddingAdjust;\r\n\t\t\tthis.tableElement.style.paddingTop = this.vDomTopPad + \"px\";\r\n\t\t\tthis.vDomScrollPosTop += this.vDomTop ? paddingAdjust : paddingAdjust + this.vDomWindowBuffer;\r\n\t\t}\r\n\t}\r\n\r\n\t_addBottomRow(rows, fillableSpace){\r\n\t\tvar table = this.tableElement,\r\n\t\taddedRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\tindex = this.vDomBottom + 1,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[index],\r\n\t\t\trowHeight, initialized;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\t\t\t\tinitialized = row.initialized;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\r\n\t\t\t\t\tthis.styleRow(row, index);\r\n\t\t\t\t\ttable.appendChild(row.getElement());\r\n\r\n\t\t\t\t\tif(!row.initialized || !row.heightInitialized){\r\n\t\t\t\t\t\taddedRows.push(row);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trow.initialize();\r\n\r\n\t\t\t\t\tif(!initialized){\r\n\t\t\t\t\t\trowHeight = row.getElement().offsetHeight;\r\n\r\n\t\t\t\t\t\tif(rowHeight > this.vDomWindowBuffer){\r\n\t\t\t\t\t\t\tthis.vDomWindowBuffer = rowHeight * 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tthis.vDomBottom++;\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of addedRows){\r\n\t\t\trow.clearCellHeight();\r\n\t\t}\r\n\r\n\t\tthis._quickNormalizeRowHeight(addedRows);\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad -= paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0 || index == rows.length -1){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\ttable.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom += paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_removeBottomRow(rows, fillableSpace){\r\n\t\tvar removableRows = [],\r\n\t\tpaddingAdjust = 0,\r\n\t\ti = 0,\r\n\t\tworking = true;\r\n\r\n\t\twhile(working){\r\n\t\t\tlet row = rows[this.vDomBottom],\r\n\t\t\trowHeight;\r\n\r\n\t\t\tif(row && i < this.vDomMaxRenderChain){\r\n\t\t\t\trowHeight = row.getHeight() || this.vDomRowHeight;\r\n\r\n\t\t\t\tif(fillableSpace >= rowHeight){\r\n\t\t\t\t\tthis.vDomBottom --;\r\n\r\n\t\t\t\t\tfillableSpace -= rowHeight;\r\n\t\t\t\t\tpaddingAdjust += rowHeight;\r\n\r\n\t\t\t\t\tremovableRows.push(row);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tworking = false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tworking = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (let row of removableRows){\r\n\t\t\tlet rowEl = row.getElement();\r\n\r\n\t\t\tif(rowEl.parentNode){\r\n\t\t\t\trowEl.parentNode.removeChild(rowEl);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(paddingAdjust){\r\n\t\t\tthis.vDomBottomPad += paddingAdjust;\r\n\r\n\t\t\tif(this.vDomBottomPad < 0){\r\n\t\t\t\tthis.vDomBottomPad = 0;\r\n\t\t\t}\r\n\r\n\t\t\tthis.tableElement.style.paddingBottom = this.vDomBottomPad + \"px\";\r\n\t\t\tthis.vDomScrollPosBottom -= paddingAdjust;\r\n\t\t}\r\n\t}\r\n\r\n\t_quickNormalizeRowHeight(rows){\r\n\t\tfor(let row of rows){\r\n\t\t\trow.calcHeight();\r\n\t\t}\r\n\r\n\t\tfor(let row of rows){\r\n\t\t\trow.setCellHeight();\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\nimport Row from './row/Row.js';\r\nimport RowComponent from './row/RowComponent.js';\r\nimport Helpers from './tools/Helpers.js';\r\n\r\nimport RendererBasicVertical from './rendering/renderers/BasicVertical.js';\r\nimport RendererVirtualDomVertical from './rendering/renderers/VirtualDomVertical.js';\r\n\r\nexport default class RowManager extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.element = this.createHolderElement(); //containing element\r\n\t\tthis.tableElement = this.createTableElement(); //table element\r\n\t\tthis.heightFixer = this.createTableElement(); //table element\r\n\t\tthis.placeholder = null; //placeholder element\r\n\t\tthis.placeholderContents = null; //placeholder element\r\n\t\t\r\n\t\tthis.firstRender = false; //handle first render\r\n\t\tthis.renderMode = \"virtual\"; //current rendering mode\r\n\t\tthis.fixedHeight = false; //current rendering mode\r\n\t\t\r\n\t\tthis.rows = []; //hold row data objects\r\n\t\tthis.activeRowsPipeline = []; //hold calculation of active rows\r\n\t\tthis.activeRows = []; //rows currently available to on display in the table\r\n\t\tthis.activeRowsCount = 0; //count of active rows\r\n\t\t\r\n\t\tthis.displayRows = []; //rows currently on display in the table\r\n\t\tthis.displayRowsCount = 0; //count of display rows\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.redrawBlock = false; //prevent redraws to allow multiple data manipulations before continuing\r\n\t\tthis.redrawBlockRestoreConfig = false; //store latest redraw function calls for when redraw is needed\r\n\t\tthis.redrawBlockRenderInPosition = false; //store latest redraw function calls for when redraw is needed\r\n\t\t\r\n\t\tthis.dataPipeline = []; //hold data pipeline tasks\r\n\t\tthis.displayPipeline = []; //hold data display pipeline tasks\r\n\t\t\r\n\t\tthis.renderer = null;\r\n\t}\r\n\t\r\n\t//////////////// Setup Functions /////////////////\r\n\t\r\n\tcreateHolderElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-tableholder\");\r\n\t\tel.setAttribute(\"tabindex\", 0);\r\n\t\t// el.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tcreateTableElement (){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\t\r\n\t\tel.classList.add(\"tabulator-table\");\r\n\t\tel.setAttribute(\"role\", \"rowgroup\");\r\n\t\t\r\n\t\treturn el;\r\n\t}\r\n\t\r\n\tinitializePlaceholder(){\r\n\t\t//configure placeholder element\r\n\t\tif(typeof this.table.options.placeholder == \"string\"){\r\n\t\t\tlet el = document.createElement(\"div\");\r\n\t\t\tel.classList.add(\"tabulator-placeholder\");\r\n\t\t\t\r\n\t\t\tlet contents = document.createElement(\"div\");\r\n\t\t\tcontents.classList.add(\"tabulator-placeholder-contents\");\r\n\t\t\tcontents.innerHTML = this.table.options.placeholder;\r\n\t\t\t\r\n\t\t\tel.appendChild(contents);\r\n\t\t\t\r\n\t\t\tthis.placeholderContents = contents;\r\n\t\t\tthis.placeholder = el;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//return containing element\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\t\r\n\t//return table element\r\n\tgetTableElement(){\r\n\t\treturn this.tableElement;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.initializePlaceholder();\r\n\t\tthis.initializeRenderer();\r\n\t\t\r\n\t\t//initialize manager\r\n\t\tthis.element.appendChild(this.tableElement);\r\n\t\t\r\n\t\tthis.firstRender = true;\r\n\t\t\r\n\t\t//scroll header along with table body\r\n\t\tthis.element.addEventListener(\"scroll\", () => {\r\n\t\t\tvar left = this.element.scrollLeft,\r\n\t\t\tleftDir = this.scrollLeft > left,\r\n\t\t\ttop = this.element.scrollTop,\r\n\t\t\ttopDir = this.scrollTop > top;\r\n\t\t\t\r\n\t\t\t//handle horizontal scrolling\r\n\t\t\tif(this.scrollLeft != left){\r\n\t\t\t\tthis.scrollLeft = left;\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-horizontal\", left, leftDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollHorizontal\", left, leftDir);\r\n\t\t\t\t\r\n\t\t\t\tthis._positionPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//handle vertical scrolling\r\n\t\t\tif(this.scrollTop != top){\r\n\t\t\t\tthis.scrollTop = top;\r\n\t\t\t\t\r\n\t\t\t\tthis.renderer.scrollRows(top, topDir);\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"scroll-vertical\", top, topDir);\r\n\t\t\t\tthis.dispatchExternal(\"scrollVertical\", top, topDir);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t////////////////// Row Manipulation //////////////////\r\n\tfindRow(subject){\r\n\t\tif(typeof subject == \"object\"){\r\n\t\t\tif(subject instanceof Row){\r\n\t\t\t\t//subject is row element\r\n\t\t\t\treturn subject;\r\n\t\t\t}else if(subject instanceof RowComponent){\r\n\t\t\t\t//subject is public row component\r\n\t\t\t\treturn subject._getSelf() || false;\r\n\t\t\t}else if(typeof HTMLElement !== \"undefined\" && subject instanceof HTMLElement){\r\n\t\t\t\t//subject is a HTML element of the row\r\n\t\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\t\treturn row.getElement() === subject;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\treturn match || false;\r\n\t\t\t}else if(subject === null){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else if(typeof subject == \"undefined\"){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\t//subject should be treated as the index of the row\r\n\t\t\tlet match = this.rows.find((row) => {\r\n\t\t\t\treturn row.data[this.table.options.index] == subject;\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\treturn match || false;\r\n\t\t}\r\n\t\t\r\n\t\t//catch all for any other type of input\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetRowFromDataObject(data){\r\n\t\tvar match = this.rows.find((row) => {\r\n\t\t\treturn row.data === data;\r\n\t\t});\r\n\t\t\r\n\t\treturn match || false;\r\n\t}\r\n\t\r\n\tgetRowFromPosition(position){\r\n\t\treturn this.getDisplayRows().find((row) => {\r\n\t\t\treturn row.getPosition() === position && row.isDisplayed();\r\n\t\t});\r\n\t}\r\n\t\r\n\tscrollToRow(row, position, ifVisible){\r\n\t\treturn this.renderer.scrollToRowPosition(row, position, ifVisible);\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\tsetData(data, renderInPosition, columnsChanged){\r\n\t\treturn new Promise((resolve, reject)=>{\r\n\t\t\tif(renderInPosition && this.getDisplayRows().length){\r\n\t\t\t\tif(this.table.options.pagination){\r\n\t\t\t\t\tthis._setDataActual(data, true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.reRenderInPosition(() => {\r\n\t\t\t\t\t\tthis._setDataActual(data);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(this.table.options.autoColumns && columnsChanged && this.table.initialized){\r\n\t\t\t\t\tthis.table.columnManager.generateColumnsFromRowData(data);\r\n\t\t\t\t}\r\n\t\t\t\tthis.resetScroll();\r\n\t\t\t\t\r\n\t\t\t\tthis._setDataActual(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve();\r\n\t\t});\r\n\t}\r\n\t\r\n\t_setDataActual(data, renderInPosition){\r\n\t\tthis.dispatchExternal(\"dataProcessing\", data);\r\n\t\t\r\n\t\tthis._wipeElements();\r\n\t\t\r\n\t\tif(Array.isArray(data)){\r\n\t\t\tthis.dispatch(\"data-processing\", data);\r\n\t\t\t\r\n\t\t\tdata.forEach((def, i) => {\r\n\t\t\t\tif(def && typeof def === \"object\"){\r\n\t\t\t\t\tvar row = new Row(def, this);\r\n\t\t\t\t\tthis.rows.push(row);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Loading Warning - Invalid row data detected and ignored, expecting object but received:\", def);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.dispatch(\"data-processed\", data);\r\n\t\t\tthis.dispatchExternal(\"dataProcessed\", data);\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data Loading Error - Unable to process data due to invalid data type \\nExpecting: array \\nReceived: \", typeof data, \"\\nData: \", data);\r\n\t\t}\r\n\t}\r\n\t\r\n\t_wipeElements(){\r\n\t\tthis.dispatch(\"rows-wipe\");\r\n\t\t\r\n\t\tthis.rows.forEach((row) => {\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rows = [];\r\n\t\tthis.activeRows = [];\r\n\t\tthis.activeRowsPipeline = [];\r\n\t\tthis.activeRowsCount = 0;\r\n\t\tthis.displayRows = [];\r\n\t\tthis.displayRowsCount = 0;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t}\r\n\t\r\n\tdeleteRow(row, blockRedraw){\r\n\t\tvar allIndex = this.rows.indexOf(row),\r\n\t\tactiveIndex = this.activeRows.indexOf(row);\r\n\t\t\r\n\t\tif(activeIndex > -1){\r\n\t\t\tthis.activeRows.splice(activeIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tif(allIndex > -1){\r\n\t\t\tthis.rows.splice(allIndex, 1);\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tvar displayIndex = rows.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(displayIndex > -1){\r\n\t\t\t\trows.splice(displayIndex, 1);\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowDeleted\", row.getComponent());\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.getData());\r\n\t\t}\r\n\t}\r\n\t\r\n\taddRow(data, pos, index, blockRedraw){\r\n\t\tvar row = this.addRowActual(data, pos, index, blockRedraw);\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\t//add multiple rows\r\n\taddRows(data, pos, index){\r\n\t\tvar rows = [];\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tpos = this.findAddRowPos(pos);\r\n\t\t\t\r\n\t\t\tif(!Array.isArray(data)){\r\n\t\t\t\tdata = [data];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif((typeof index == \"undefined\" && pos) || (typeof index !== \"undefined\" && !pos)){\r\n\t\t\t\tdata.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdata.forEach((item, i) => {\r\n\t\t\t\tvar row = this.addRow(item, pos, index, true);\r\n\t\t\t\trows.push(row);\r\n\t\t\t\tthis.dispatch(\"row-added\", row, data, pos, index);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tthis.refreshActiveData(false, false, true);\r\n\t\t\t\r\n\t\t\tthis.regenerateRowPositions();\r\n\t\t\t\r\n\t\t\tif(rows.length){\r\n\t\t\t\tthis._clearPlaceholder();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tresolve(rows);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfindAddRowPos(pos){\r\n\t\tif(typeof pos === \"undefined\"){\r\n\t\t\tpos = this.table.options.addRowPos;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"pos\"){\r\n\t\t\tpos = true;\r\n\t\t}\r\n\t\t\r\n\t\tif(pos === \"bottom\"){\r\n\t\t\tpos = false;\r\n\t\t}\r\n\t\t\r\n\t\treturn pos;\r\n\t}\r\n\t\r\n\taddRowActual(data, pos, index, blockRedraw){\r\n\t\tvar row = data instanceof Row ? data : new Row(data || {}, this),\r\n\t\ttop = this.findAddRowPos(pos),\r\n\t\tallIndex = -1,\r\n\t\tactiveIndex, chainResult;\r\n\t\t\r\n\t\tif(!index){\r\n\t\t\tchainResult = this.chain(\"row-adding-position\", [row, top], null, {index, top});\r\n\t\t\t\r\n\t\t\tindex = chainResult.index;\r\n\t\t\ttop = chainResult.top;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof index !== \"undefined\"){\r\n\t\t\tindex = this.findRow(index);\r\n\t\t}\r\n\t\t\r\n\t\tindex = this.chain(\"row-adding-index\", [row, index, top], null, index);\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tallIndex = this.rows.indexOf(index);\r\n\t\t}\r\n\t\t\r\n\t\tif(index && allIndex > -1){\r\n\t\t\tactiveIndex = this.activeRows.indexOf(index);\r\n\t\t\t\r\n\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\tvar displayIndex = rows.indexOf(index);\r\n\t\t\t\t\r\n\t\t\t\tif(displayIndex > -1){\r\n\t\t\t\t\trows.splice((top ? displayIndex : displayIndex + 1), 0, row);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(activeIndex > -1){\r\n\t\t\t\tthis.activeRows.splice((top ? activeIndex : activeIndex + 1), 0, row);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.rows.splice((top ? allIndex : allIndex + 1), 0, row);\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tif(top){\r\n\t\t\t\t\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.unshift(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.unshift(row);\r\n\t\t\t\tthis.rows.unshift(row);\r\n\t\t\t}else{\r\n\t\t\t\tthis.displayRowIterator(function(rows){\r\n\t\t\t\t\trows.push(row);\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tthis.activeRows.push(row);\r\n\t\t\t\tthis.rows.push(row);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.setActiveRows(this.activeRows);\r\n\t\t\r\n\t\tthis.dispatchExternal(\"rowAdded\", row.getComponent());\r\n\t\t\r\n\t\tif(this.subscribedExternal(\"dataChanged\")){\r\n\t\t\tthis.dispatchExternal(\"dataChanged\", this.table.rowManager.getData());\r\n\t\t}\r\n\t\t\r\n\t\tif(!blockRedraw){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t}\r\n\t\t\r\n\t\treturn row;\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tthis.dispatch(\"row-move\", from, to, after);\r\n\t\t\r\n\t\tthis.moveRowActual(from, to, after);\r\n\t\t\r\n\t\tthis.regenerateRowPositions();\r\n\t\t\r\n\t\tthis.dispatch(\"row-moved\", from, to, after);\r\n\t\tthis.dispatchExternal(\"rowMoved\", from.getComponent());\r\n\t}\r\n\t\r\n\tmoveRowActual(from, to, after){\r\n\t\tthis.moveRowInArray(this.rows, from, to, after);\r\n\t\tthis.moveRowInArray(this.activeRows, from, to, after);\r\n\t\t\r\n\t\tthis.displayRowIterator((rows) => {\r\n\t\t\tthis.moveRowInArray(rows, from, to, after);\r\n\t\t});\r\n\t\t\r\n\t\tthis.dispatch(\"row-moving\", from, to, after);\r\n\t}\r\n\t\r\n\tmoveRowInArray(rows, from, to, after){\r\n\t\tvar\tfromIndex, toIndex, start, end;\r\n\t\t\r\n\t\tif(from !== to){\r\n\t\t\t\r\n\t\t\tfromIndex = rows.indexOf(from);\r\n\t\t\t\r\n\t\t\tif (fromIndex > -1) {\r\n\t\t\t\t\r\n\t\t\t\trows.splice(fromIndex, 1);\r\n\t\t\t\t\r\n\t\t\t\ttoIndex = rows.indexOf(to);\r\n\t\t\t\t\r\n\t\t\t\tif (toIndex > -1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(after){\r\n\t\t\t\t\t\trows.splice(toIndex+1, 0, from);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trows.splice(toIndex, 0, from);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\trows.splice(fromIndex, 0, from);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//restyle rows\r\n\t\t\tif(rows === this.getDisplayRows()){\r\n\t\t\t\t\r\n\t\t\t\tstart = fromIndex < toIndex ? fromIndex : toIndex;\r\n\t\t\t\tend = toIndex > fromIndex ? toIndex : fromIndex +1;\r\n\t\t\t\t\r\n\t\t\t\tfor(let i = start; i <= end; i++){\r\n\t\t\t\t\tif(rows[i]){\r\n\t\t\t\t\t\tthis.styleRow(rows[i], i);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearData(){\r\n\t\tthis.setData([]);\r\n\t}\r\n\t\r\n\tgetRowIndex(row){\r\n\t\treturn this.findRowIndex(row, this.rows);\r\n\t}\r\n\t\r\n\tgetDisplayRowIndex(row){\r\n\t\tvar index = this.getDisplayRows().indexOf(row);\r\n\t\treturn index > -1 ? index : false;\r\n\t}\r\n\t\r\n\tnextDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tnextRow = false;\r\n\t\t\r\n\t\t\r\n\t\tif(index !== false && index < this.displayRowsCount -1){\r\n\t\t\tnextRow = this.getDisplayRows()[index+1];\r\n\t\t}\r\n\t\t\r\n\t\tif(nextRow && (!(nextRow instanceof Row) || nextRow.type != \"row\")){\r\n\t\t\treturn this.nextDisplayRow(nextRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn nextRow;\r\n\t}\r\n\t\r\n\tprevDisplayRow(row, rowOnly){\r\n\t\tvar index = this.getDisplayRowIndex(row),\r\n\t\tprevRow = false;\r\n\t\t\r\n\t\tif(index){\r\n\t\t\tprevRow = this.getDisplayRows()[index-1];\r\n\t\t}\r\n\t\t\r\n\t\tif(rowOnly && prevRow && (!(prevRow instanceof Row) || prevRow.type != \"row\")){\r\n\t\t\treturn this.prevDisplayRow(prevRow, rowOnly);\r\n\t\t}\r\n\t\t\r\n\t\treturn prevRow;\r\n\t}\r\n\t\r\n\tfindRowIndex(row, list){\r\n\t\tvar rowIndex;\r\n\t\t\r\n\t\trow = this.findRow(row);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\trowIndex = list.indexOf(row);\r\n\t\t\t\r\n\t\t\tif(rowIndex > -1){\r\n\t\t\t\treturn rowIndex;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tgetData(active, transform){\r\n\t\tvar output = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\tif(row.type == \"row\"){\r\n\t\t\t\toutput.push(row.getData(transform || \"data\"));\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetComponents(active){\r\n\t\tvar\toutput = [],\r\n\t\trows = this.getRows(active);\r\n\t\t\r\n\t\trows.forEach(function(row){\r\n\t\t\toutput.push(row.getComponent());\r\n\t\t});\r\n\t\t\r\n\t\treturn output;\r\n\t}\r\n\t\r\n\tgetDataCount(active){\r\n\t\tvar rows = this.getRows(active);\r\n\t\t\r\n\t\treturn rows.length;\r\n\t}\r\n\t\r\n\tscrollHorizontal(left){\r\n\t\tthis.scrollLeft = left;\r\n\t\tthis.element.scrollLeft = left;\r\n\t\t\r\n\t\tthis.dispatch(\"scroll-horizontal\", left);\r\n\t}\r\n\t\r\n\tregisterDataPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.dataPipeline.push({handler, priority});\r\n\t\t\tthis.dataPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Data pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tregisterDisplayPipelineHandler(handler, priority){\r\n\t\tif(typeof priority !== \"undefined\"){\r\n\t\t\tthis.displayPipeline.push({handler, priority});\r\n\t\t\tthis.displayPipeline.sort((a, b) => {\r\n\t\t\t\treturn a.priority - b.priority;\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Display pipeline handlers must have a priority in order to be registered\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//set active data set\r\n\trefreshActiveData(handler, skipStage, renderInPosition){\r\n\t\tvar table = this.table,\r\n\t\tstage = \"\",\r\n\t\tindex = 0,\r\n\t\tcascadeOrder = [\"all\", \"dataPipeline\", \"display\", \"displayPipeline\", \"end\"];\r\n\t\t\r\n\t\tif(!this.table.destroyed){\r\n\t\t\tif(typeof handler === \"function\"){\r\n\t\t\t\tindex = this.dataPipeline.findIndex((item) => {\r\n\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tstage = \"dataPipeline\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\tif(index == this.dataPipeline.length - 1){\r\n\t\t\t\t\t\t\tstage = \"display\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tindex = this.displayPipeline.findIndex((item) => {\r\n\t\t\t\t\t\treturn item.handler === handler;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(index > -1){\r\n\t\t\t\t\t\tstage = \"displayPipeline\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(skipStage){\r\n\t\t\t\t\t\t\tif(index == this.displayPipeline.length - 1){\r\n\t\t\t\t\t\t\t\tstage = \"end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.error(\"Unable to refresh data, invalid handler provided\", handler);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tstage = handler || \"all\";\r\n\t\t\t\tindex = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.redrawBlock){\r\n\t\t\t\tif(!this.redrawBlockRestoreConfig || (this.redrawBlockRestoreConfig && ((this.redrawBlockRestoreConfig.stage === stage && index < this.redrawBlockRestoreConfig.index) || (cascadeOrder.indexOf(stage) < cascadeOrder.indexOf(this.redrawBlockRestoreConfig.stage))))){\r\n\t\t\t\t\tthis.redrawBlockRestoreConfig = {\r\n\t\t\t\t\t\thandler: handler,\r\n\t\t\t\t\t\tskipStage: skipStage,\r\n\t\t\t\t\t\trenderInPosition: renderInPosition,\r\n\t\t\t\t\t\tstage:stage,\r\n\t\t\t\t\t\tindex:index,\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\tif(Helpers.elVisible(this.element)){\r\n\t\t\t\t\tif(renderInPosition){\r\n\t\t\t\t\t\tthis.reRenderInPosition(this.refreshPipelines.bind(this, handler, stage, index, renderInPosition));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!handler){\r\n\t\t\t\t\t\t\tthis.table.columnManager.renderer.renderColumns();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.renderTable();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(table.options.layoutColumnsOnNewData){\r\n\t\t\t\t\t\t\tthis.table.columnManager.redraw(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.refreshPipelines(handler, stage, index, renderInPosition);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.dispatch(\"data-refreshed\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\trefreshPipelines(handler, stage, index, renderInPosition){\r\n\t\tthis.dispatch(\"data-refreshing\");\r\n\t\t\r\n\t\tif(!handler){\r\n\t\t\tthis.activeRowsPipeline[0] = this.rows.slice(0);\r\n\t\t}\r\n\t\t\r\n\t\t//cascade through data refresh stages\r\n\t\tswitch(stage){\r\n\t\t\tcase \"all\":\r\n\t\t\t//handle case where all data needs refreshing\r\n\t\t\t\r\n\t\t\tcase \"dataPipeline\":\r\n\t\t\t\r\n\t\t\t\tfor(let i = index; i < this.dataPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.dataPipeline[i].handler(this.activeRowsPipeline[i].slice(0));\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.activeRowsPipeline[i + 1] = result || this.activeRowsPipeline[i].slice(0);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tthis.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);\r\n\t\t\t\t\r\n\t\t\tcase \"display\":\r\n\t\t\t\tindex = 0;\r\n\t\t\t\tthis.resetDisplayRows();\r\n\t\t\t\t\r\n\t\t\tcase \"displayPipeline\":\r\n\t\t\t\tfor(let i = index; i < this.displayPipeline.length; i++){\r\n\t\t\t\t\tlet result = this.displayPipeline[i].handler((i ? this.getDisplayRows(i - 1) : this.activeRows).slice(0), renderInPosition);\r\n\r\n\t\t\t\t\tthis.setDisplayRows(result || this.getDisplayRows(i - 1).slice(0), i);\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"end\":\r\n\t\t\t\t//case to handle scenario when trying to skip past end stage\r\n\t\t\t\tthis.regenerateRowPositions();\r\n\t\t}\r\n\t}\r\n\t\r\n\t//regenerate row positions\r\n\tregenerateRowPositions(){\r\n\t\tvar rows = this.getDisplayRows();\r\n\t\tvar index = 1;\r\n\t\t\r\n\t\trows.forEach((row) => {\r\n\t\t\tif (row.type === \"row\"){\r\n\t\t\t\trow.setPosition(index);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\tsetActiveRows(activeRows){\r\n\t\tthis.activeRows = activeRows;\r\n\t\tthis.activeRowsCount = this.activeRows.length;\r\n\t}\r\n\t\r\n\t//reset display rows array\r\n\tresetDisplayRows(){\r\n\t\tthis.displayRows = [];\r\n\t\t\r\n\t\tthis.displayRows.push(this.activeRows.slice(0));\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[0].length;\r\n\t}\r\n\t\r\n\t//set display row pipeline data\r\n\tsetDisplayRows(displayRows, index){\r\n\t\tthis.displayRows[index] = displayRows;\r\n\r\n\t\tif(index == this.displayRows.length -1){\r\n\t\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetDisplayRows(index){\r\n\t\tif(typeof index == \"undefined\"){\r\n\t\t\treturn this.displayRows.length ? this.displayRows[this.displayRows.length -1] : [];\r\n\t\t}else{\r\n\t\t\treturn this.displayRows[index] || [];\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetVisibleRows(chain, viewable){\r\n\t\tvar rows = Object.assign([], this.renderer.visibleRows(!viewable));\r\n\t\t\r\n\t\tif(chain){\r\n\t\t\trows = this.chain(\"rows-visible\", [viewable], rows, rows);\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t//repeat action across display rows\r\n\tdisplayRowIterator(callback){\r\n\t\tthis.activeRowsPipeline.forEach(callback);\r\n\t\tthis.displayRows.forEach(callback);\r\n\t\t\r\n\t\tthis.displayRowsCount = this.displayRows[this.displayRows.length -1].length;\r\n\t}\r\n\t\r\n\t//return only actual rows (not group headers etc)\r\n\tgetRows(type){\r\n\t\tvar rows = [];\r\n\r\n\t\tif(!type || type === true){\r\n\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\r\n\t\t}else{\r\n\t\t\tswitch(type){\r\n\t\t\t\tcase \"active\":\r\n\t\t\t\t\trows = this.activeRows;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"display\":\r\n\t\t\t\t\trows = this.table.rowManager.getDisplayRows();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"visible\":\r\n\t\t\t\t\trows = this.getVisibleRows(false, true);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn rows;\r\n\t}\r\n\t\r\n\t///////////////// Table Rendering /////////////////\r\n\t//trigger rerender of table in current position\r\n\treRenderInPosition(callback){\r\n\t\tif(this.redrawBlock){\r\n\t\t\tif(callback){\r\n\t\t\t\tcallback();\r\n\t\t\t}else{\r\n\t\t\t\tthis.redrawBlockRenderInPosition = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\t\r\n\t\t\tthis.renderer.rerenderRows(callback);\r\n\r\n\t\t\tif(!this.fixedHeight){\r\n\t\t\t\tthis.adjustTableSize();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeRenderer(){\r\n\t\tvar renderClass;\r\n\t\t\r\n\t\tvar renderers = {\r\n\t\t\t\"virtual\": RendererVirtualDomVertical,\r\n\t\t\t\"basic\": RendererBasicVertical,\r\n\t\t};\r\n\t\t\r\n\t\tif(typeof this.table.options.renderVertical === \"string\"){\r\n\t\t\trenderClass = renderers[this.table.options.renderVertical];\r\n\t\t}else{\r\n\t\t\trenderClass = this.table.options.renderVertical;\r\n\t\t}\r\n\t\t\r\n\t\tif(renderClass){\r\n\t\t\tthis.renderMode = this.table.options.renderVertical;\r\n\t\t\t\r\n\t\t\tthis.renderer = new renderClass(this.table, this.element, this.tableElement);\r\n\t\t\tthis.renderer.initialize();\r\n\t\t\t\r\n\t\t\tif((this.table.element.clientHeight || this.table.options.height)){\r\n\t\t\t\tthis.fixedHeight = true;\r\n\t\t\t}else{\r\n\t\t\t\tthis.fixedHeight = false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Unable to find matching renderer:\", this.table.options.renderVertical);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRenderMode(){\r\n\t\treturn this.renderMode;\r\n\t}\r\n\t\r\n\trenderTable(){\r\n\t\tthis.dispatchExternal(\"renderStarted\");\r\n\t\t\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tthis._clearTable();\r\n\t\t\r\n\t\tif(this.displayRowsCount){\r\n\t\t\tthis.renderer.renderRows();\r\n\t\t\t\r\n\t\t\tif(this.firstRender){\r\n\t\t\t\tthis.firstRender = false;\r\n\t\t\t\tthis.layoutRefresh(true);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tthis.renderEmptyScroll();\r\n\t\t}\r\n\t\t\r\n\t\tif(!this.fixedHeight){\r\n\t\t\tthis.adjustTableSize();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatch(\"table-layout\");\r\n\t\t\r\n\t\tif(!this.displayRowsCount){\r\n\t\t\tthis._showPlaceholder();\r\n\t\t}\r\n\t\t\r\n\t\tthis.dispatchExternal(\"renderComplete\");\r\n\t}\r\n\t\r\n\t//show scrollbars on empty table div\r\n\trenderEmptyScroll(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.tableElement.style.display = \"none\";\r\n\t\t}else{\r\n\t\t\tthis.tableElement.style.minWidth = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\t// this.tableElement.style.minHeight = \"1px\";\r\n\t\t\t// this.tableElement.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearTable(){\t\r\n\t\tthis._clearPlaceholder();\r\n\t\t\r\n\t\tthis.scrollTop = 0;\r\n\t\tthis.scrollLeft = 0;\r\n\t\t\r\n\t\tthis.renderer.clearRows();\r\n\t}\r\n\t\r\n\t_showPlaceholder(){\r\n\t\tif(this.placeholder){\r\n\t\t\tthis.placeholder.setAttribute(\"tabulator-render-mode\", this.renderMode);\r\n\t\t\t\r\n\t\t\tthis.getElement().appendChild(this.placeholder);\r\n\t\t\tthis._positionPlaceholder();\r\n\t\t}\r\n\t}\r\n\t\r\n\t_clearPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.parentNode.removeChild(this.placeholder);\r\n\t\t}\r\n\r\n\t\t// clear empty table placeholder min\r\n\t\tthis.tableElement.style.minWidth = \"\";\r\n\t}\r\n\t\r\n\t_positionPlaceholder(){\r\n\t\tif(this.placeholder && this.placeholder.parentNode){\r\n\t\t\tthis.placeholder.style.width = this.table.columnManager.getWidth() + \"px\";\r\n\t\t\tthis.placeholderContents.style.width = this.table.rowManager.element.clientWidth + \"px\";\r\n\t\t\tthis.placeholderContents.style.marginLeft = this.scrollLeft + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tstyleRow(row, index){\r\n\t\tvar rowEl = row.getElement();\r\n\t\t\r\n\t\tif(index % 2){\r\n\t\t\trowEl.classList.add(\"tabulator-row-even\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-odd\");\r\n\t\t}else{\r\n\t\t\trowEl.classList.add(\"tabulator-row-odd\");\r\n\t\t\trowEl.classList.remove(\"tabulator-row-even\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//normalize height of active rows\r\n\tnormalizeHeight(){\r\n\t\tthis.activeRows.forEach(function(row){\r\n\t\t\trow.normalizeHeight();\r\n\t\t});\r\n\t}\r\n\t\r\n\t//adjust the height of the table holder to fit in the Tabulator element\r\n\tadjustTableSize(){\r\n\t\tvar initialHeight = this.element.clientHeight, minHeight;\r\n\t\t\r\n\t\tif(this.renderer.verticalFillMode === \"fill\"){\r\n\t\t\tlet otherHeight = Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height + (this.table.footerManager && this.table.footerManager.active && !this.table.footerManager.external ? this.table.footerManager.getElement().getBoundingClientRect().height : 0));\r\n\t\t\t\r\n\t\t\tif(this.fixedHeight){\r\n\t\t\t\tminHeight = isNaN(this.table.options.minHeight) ? this.table.options.minHeight : this.table.options.minHeight + \"px\";\r\n\t\t\t\t\r\n\t\t\t\tthis.element.style.minHeight = minHeight || \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.height = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t\tthis.element.style.maxHeight = \"calc(100% - \" + otherHeight + \"px)\";\r\n\t\t\t}else{\r\n\t\t\t\tthis.element.style.height = \"\";\r\n\t\t\t\tthis.element.style.height = (this.table.element.clientHeight - otherHeight) + \"px\";\r\n\t\t\t\tthis.element.scrollTop = this.scrollTop;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.renderer.resize();\r\n\t\t\t\r\n\t\t\t//check if the table has changed size when dealing with variable height tables\r\n\t\t\tif(!this.fixedHeight && initialHeight != this.element.clientHeight){\r\n\t\t\t\tif(this.subscribed(\"table-resize\")){\r\n\t\t\t\t\tthis.dispatch(\"table-resize\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.redraw();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis._positionPlaceholder();\r\n\t}\r\n\t\r\n\t//reinitialize all rows\r\n\treinitialize(){\r\n\t\tthis.rows.forEach(function(row){\r\n\t\t\trow.reinitialize(true);\r\n\t\t});\r\n\t}\r\n\t\r\n\t//prevent table from being redrawn\r\n\tblockRedraw (){\r\n\t\tthis.redrawBlock = true;\r\n\t\tthis.redrawBlockRestoreConfig = false;\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw (){\r\n\t\tthis.redrawBlock = false;\r\n\t\t\r\n\t\tif(this.redrawBlockRestoreConfig){\r\n\t\t\tthis.refreshActiveData(this.redrawBlockRestoreConfig.handler, this.redrawBlockRestoreConfig.skipStage, this.redrawBlockRestoreConfig.renderInPosition);\r\n\t\t\t\r\n\t\t\tthis.redrawBlockRestoreConfig = false;\r\n\t\t}else{\r\n\t\t\tif(this.redrawBlockRenderInPosition){\r\n\t\t\t\tthis.reRenderInPosition();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.redrawBlockRenderInPosition = false;\r\n\t}\r\n\t\r\n\t//redraw table\r\n\tredraw (force){\r\n\t\tvar left = this.scrollLeft;\r\n\t\t\r\n\t\tthis.adjustTableSize();\r\n\t\t\r\n\t\tthis.table.tableWidth = this.table.element.clientWidth;\r\n\t\t\r\n\t\tif(!force){\r\n\t\t\tthis.reRenderInPosition();\r\n\t\t\tthis.scrollHorizontal(left);\r\n\t\t}else{\r\n\t\t\tthis.renderTable();\r\n\t\t}\r\n\t}\r\n\t\r\n\tresetScroll(){\r\n\t\tthis.element.scrollLeft = 0;\r\n\t\tthis.element.scrollTop = 0;\r\n\t\t\r\n\t\tif(this.table.browser === \"ie\"){\r\n\t\t\tvar event = document.createEvent(\"Event\");\r\n\t\t\tevent.initEvent(\"scroll\", false, true);\r\n\t\t\tthis.element.dispatchEvent(event);\r\n\t\t}else{\r\n\t\t\tthis.element.dispatchEvent(new Event('scroll'));\r\n\t\t}\r\n\t}\r\n}","import CoreFeature from './CoreFeature.js';\r\n\r\nexport default class FooterManager extends CoreFeature{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.active = false;\r\n\t\tthis.element = this.createElement(); //containing element\r\n\t\tthis.containerElement = this.createContainerElement(); //containing element\r\n\t\tthis.external = false;\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.initializeElement();\r\n\t}\r\n\r\n\tcreateElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer\");\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\t\r\n\tcreateContainerElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\r\n\t\tel.classList.add(\"tabulator-footer-contents\");\r\n\r\n\t\tthis.element.appendChild(el);\r\n\r\n\t\treturn el;\r\n\t}\r\n\r\n\tinitializeElement(){\r\n\t\tif(this.table.options.footerElement){\r\n\r\n\t\t\tswitch(typeof this.table.options.footerElement){\r\n\t\t\t\tcase \"string\":\r\n\t\t\t\t\tif(this.table.options.footerElement[0] === \"<\"){\r\n\t\t\t\t\t\tthis.containerElement.innerHTML = this.table.options.footerElement;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.external = true;\r\n\t\t\t\t\t\tthis.containerElement = document.querySelector(this.table.options.footerElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthis.element = this.table.options.footerElement;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tappend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.containerElement.appendChild(element);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tprepend(element){\r\n\t\tthis.activate();\r\n\r\n\t\tthis.element.insertBefore(element, this.element.firstChild);\r\n\t\tthis.table.rowManager.adjustTableSize();\r\n\t}\r\n\r\n\tremove(element){\r\n\t\telement.parentNode.removeChild(element);\r\n\t\tthis.deactivate();\r\n\t}\r\n\r\n\tdeactivate(force){\r\n\t\tif(!this.element.firstChild || force){\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t\t}\r\n\t\t\tthis.active = false;\r\n\t\t}\r\n\t}\r\n\r\n\tactivate(){\r\n\t\tif(!this.active){\r\n\t\t\tthis.active = true;\r\n\t\t\tif(!this.external){\r\n\t\t\t\tthis.table.element.appendChild(this.getElement());\r\n\t\t\t\tthis.table.element.style.display = '';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tredraw(){\r\n\t\tthis.dispatch(\"footer-redraw\");\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\nimport Row from '../row/Row.js';\r\n\r\nexport default class InteractionManager extends CoreFeature {\r\n\t\r\n\tconstructor (table){\r\n\t\tsuper(table);\r\n\t\t\r\n\t\tthis.el = null;\r\n\t\t\r\n\t\tthis.abortClasses = [\"tabulator-headers\", \"tabulator-table\"];\r\n\t\t\r\n\t\tthis.previousTargets = {};\r\n\t\t\r\n\t\tthis.listeners = [\r\n\t\t\t\"click\",\r\n\t\t\t\"dblclick\",\r\n\t\t\t\"contextmenu\",\r\n\t\t\t\"mouseenter\",\r\n\t\t\t\"mouseleave\",\r\n\t\t\t\"mouseover\",\r\n\t\t\t\"mouseout\",\r\n\t\t\t\"mousemove\",\r\n\t\t\t\"touchstart\",\r\n\t\t\t\"touchend\",\r\n\t\t];\r\n\t\t\r\n\t\tthis.componentMap = {\r\n\t\t\t\"tabulator-cell\":\"cell\",\r\n\t\t\t\"tabulator-row\":\"row\",\r\n\t\t\t\"tabulator-group\":\"group\",\r\n\t\t\t\"tabulator-col\":\"column\",\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTrackers = {\r\n\t\t\t\"row\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"cell\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"group\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t\t\"column\":{\r\n\t\t\t\tsubscriber:null,\r\n\t\t\t\ttarget:null,\r\n\t\t\t},\r\n\t\t};\r\n\t\t\r\n\t\tthis.pseudoTracking = false;\r\n\t}\r\n\t\r\n\tinitialize(){\r\n\t\tthis.el = this.table.element;\r\n\t\t\r\n\t\tthis.buildListenerMap();\r\n\t\tthis.bindSubscriptionWatchers();\r\n\t}\r\n\t\r\n\tbuildListenerMap(){\r\n\t\tvar listenerMap = {};\r\n\t\t\r\n\t\tthis.listeners.forEach((listener) => {\r\n\t\t\tlistenerMap[listener] = {\r\n\t\t\t\thandler:null,\r\n\t\t\t\tcomponents:[],\r\n\t\t\t};\r\n\t\t});\r\n\t\t\r\n\t\tthis.listeners = listenerMap;\r\n\t}\r\n\t\r\n\tbindPseudoEvents(){\r\n\t\tObject.keys(this.pseudoTrackers).forEach((key) => {\r\n\t\t\tthis.pseudoTrackers[key].subscriber = this.pseudoMouseEnter.bind(this, key);\r\n\t\t\tthis.subscribe(key + \"-mouseover\", this.pseudoTrackers[key].subscriber);\r\n\t\t});\r\n\t\t\r\n\t\tthis.pseudoTracking = true;\r\n\t}\r\n\t\r\n\tpseudoMouseEnter(key, e, target){\r\n\t\tif(this.pseudoTrackers[key].target !== target){\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, this.pseudoTrackers[key].target);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis.pseudoMouseLeave(key, e);\r\n\t\t\t\r\n\t\t\tthis.pseudoTrackers[key].target = target;\r\n\t\t\t\r\n\t\t\tthis.dispatch(key + \"-mouseenter\", e, target);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpseudoMouseLeave(key, e){\r\n\t\tvar leaveList = Object.keys(this.pseudoTrackers),\r\n\t\tlinkedKeys = {\r\n\t\t\t\"row\":[\"cell\"],\r\n\t\t\t\"cell\":[\"row\"],\r\n\t\t};\r\n\t\t\r\n\t\tleaveList = leaveList.filter((item) => {\r\n\t\t\tvar links = linkedKeys[key];\r\n\t\t\treturn item !== key && (!links || (links && !links.includes(item)));\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\tleaveList.forEach((key) => {\r\n\t\t\tvar target = this.pseudoTrackers[key].target;\r\n\t\t\t\r\n\t\t\tif(this.pseudoTrackers[key].target){\r\n\t\t\t\tthis.dispatch(key + \"-mouseleave\", e, target);\r\n\t\t\t\t\r\n\t\t\t\tthis.pseudoTrackers[key].target = null;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t\r\n\tbindSubscriptionWatchers(){\r\n\t\tvar listeners = Object.keys(this.listeners),\r\n\t\tcomponents = Object.values(this.componentMap);\r\n\t\t\r\n\t\tfor(let comp of components){\r\n\t\t\tfor(let listener of listeners){\r\n\t\t\t\tlet key = comp + \"-\" + listener;\r\n\t\t\t\t\r\n\t\t\t\tthis.subscriptionChange(key, this.subscriptionChanged.bind(this, comp, listener));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.subscribe(\"table-destroy\", this.clearWatchers.bind(this));\r\n\t}\r\n\t\r\n\tsubscriptionChanged(component, key, added){\r\n\t\tvar listener = this.listeners[key].components,\r\n\t\tindex = listener.indexOf(component),\r\n\t\tchanged = false;\r\n\t\t\r\n\t\tif(added){\r\n\t\t\tif(index === -1){\r\n\t\t\t\tlistener.push(component);\r\n\t\t\t\tchanged = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!this.subscribed(component + \"-\" + key)){\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tlistener.splice(index, 1);\r\n\t\t\t\t\tchanged = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif((key === \"mouseenter\" || key === \"mouseleave\") && !this.pseudoTracking){\r\n\t\t\tthis.bindPseudoEvents();\r\n\t\t}\r\n\t\t\r\n\t\tif(changed){\r\n\t\t\tthis.updateEventListeners();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateEventListeners(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.components.length){\r\n\t\t\t\tif(!listener.handler){\r\n\t\t\t\t\tlistener.handler = this.track.bind(this, key);\r\n\t\t\t\t\tthis.el.addEventListener(key, listener.handler);\r\n\t\t\t\t\t// this.el.addEventListener(key, listener.handler, {passive: true})\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(listener.handler){\r\n\t\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\t\tlistener.handler = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\ttrack(type, e){\r\n\t\tvar path = (e.composedPath && e.composedPath()) || e.path;\r\n\t\t\r\n\t\tvar targets = this.findTargets(path);\r\n\t\ttargets = this.bindComponents(type, targets);\r\n\t\t\r\n\t\tthis.triggerEvents(type, e, targets);\r\n\t\t\r\n\t\tif(this.pseudoTracking && (type == \"mouseover\" || type == \"mouseleave\") && !Object.keys(targets).length){\r\n\t\t\tthis.pseudoMouseLeave(\"none\", e);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfindTargets(path){\r\n\t\tvar targets = {};\r\n\t\t\r\n\t\tlet componentMap = Object.keys(this.componentMap);\r\n\t\t\r\n\t\tfor (let el of path) {\r\n\t\t\tlet classList = el.classList ? [...el.classList] : [];\r\n\t\t\t\r\n\t\t\tlet abort = classList.filter((item) => {\r\n\t\t\t\treturn this.abortClasses.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tif(abort.length){\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlet elTargets = classList.filter((item) => {\r\n\t\t\t\treturn componentMap.includes(item);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfor (let target of elTargets) {\r\n\t\t\t\tif(!targets[this.componentMap[target]]){\r\n\t\t\t\t\ttargets[this.componentMap[target]] = el;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(targets.group && targets.group === targets.row){\r\n\t\t\tdelete targets.row;\r\n\t\t}\r\n\t\t\r\n\t\treturn targets;\r\n\t}\r\n\t\r\n\tbindComponents(type, targets){\r\n\t\t//ensure row component is looked up before cell\r\n\t\tvar keys = Object.keys(targets).reverse(),\r\n\t\tlistener = this.listeners[type],\r\n\t\tmatches = {},\r\n\t\ttargetMatches = {};\r\n\t\t\r\n\t\tfor(let key of keys){\r\n\t\t\tlet component,\r\n\t\t\ttarget = targets[key],\r\n\t\t\tpreviousTarget = this.previousTargets[key];\r\n\t\t\t\r\n\t\t\tif(previousTarget && previousTarget.target === target){\r\n\t\t\t\tcomponent = previousTarget.component;\r\n\t\t\t}else{\r\n\t\t\t\tswitch(key){\r\n\t\t\t\t\tcase \"row\":\r\n\t\t\t\t\tcase \"group\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"row\") || listener.components.includes(\"cell\") || listener.components.includes(\"group\")){\r\n\t\t\t\t\t\t\tlet rows = this.table.rowManager.getVisibleRows(true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcomponent = rows.find((row) => {\r\n\t\t\t\t\t\t\t\treturn row.getElement() === target;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(targets[\"row\"] && targets[\"row\"].parentNode && targets[\"row\"].parentNode.closest(\".tabulator-row\")){\r\n\t\t\t\t\t\t\t\ttargets[key] = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"column\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"column\")){\r\n\t\t\t\t\t\t\tcomponent = this.table.columnManager.findColumn(target);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"cell\":\r\n\t\t\t\t\t\tif(listener.components.includes(\"cell\")){\r\n\t\t\t\t\t\t\tif(matches[\"row\"] instanceof Row){\r\n\t\t\t\t\t\t\t\tcomponent = matches[\"row\"].findCell(target);\r\n\t\t\t\t\t\t\t}else{\t\r\n\t\t\t\t\t\t\t\tif(targets[\"row\"]){\r\n\t\t\t\t\t\t\t\t\tconsole.warn(\"Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?\");\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(component){\r\n\t\t\t\tmatches[key] = component;\r\n\t\t\t\ttargetMatches[key] = {\r\n\t\t\t\t\ttarget:target,\r\n\t\t\t\t\tcomponent:component,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.previousTargets = targetMatches;\r\n\t\t\r\n\t\treturn matches;\r\n\t}\r\n\t\r\n\ttriggerEvents(type, e, targets){\r\n\t\tvar listener = this.listeners[type];\r\n\r\n\t\tfor(let key in targets){\r\n\t\t\tif(targets[key] && listener.components.includes(key)){\r\n\t\t\t\tthis.dispatch(key + \"-\" + type, e, targets[key]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tclearWatchers(){\r\n\t\tfor(let key in this.listeners){\r\n\t\t\tlet listener = this.listeners[key];\r\n\t\t\t\r\n\t\t\tif(listener.handler){\r\n\t\t\t\tthis.el.removeEventListener(key, listener.handler);\r\n\t\t\t\tlistener.handler = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}","export default class ComponentFunctionBinder{\r\n\r\n\tconstructor(table){\r\n\t\tthis.table = table;\r\n\r\n\t\tthis.bindings = {};\r\n\t}\r\n\r\n\tbind(type, funcName, handler){\r\n\t\tif(!this.bindings[type]){\r\n\t\t\tthis.bindings[type] = {};\r\n\t\t}\r\n\r\n\t\tif(this.bindings[type][funcName]){\r\n\t\t\tconsole.warn(\"Unable to bind component handler, a matching function name is already bound\", type, funcName, handler);\r\n\t\t}else{\r\n\t\t\tthis.bindings[type][funcName] = handler;\r\n\t\t}\r\n\t}\r\n\r\n\thandle(type, component, name){\r\n\t\tif(this.bindings[type] && this.bindings[type][name] && typeof this.bindings[type][name].bind === 'function'){\r\n\t\t\treturn this.bindings[type][name].bind(null, component);\r\n\t\t}else{\r\n\t\t\tif(name !== \"then\" && typeof name === \"string\" && !name.startsWith(\"_\")){\r\n\t\t\t\tif(this.table.options.debugInvalidComponentFuncs){\r\n\t\t\t\t\tconsole.error(\"The \" + type + \" component does not have a \" + name + \" function, have you checked that you have the correct Tabulator module installed?\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DataLoader extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.requestOrder = 0; //prevent requests coming out of sequence if overridden by another load request\r\n\t\tthis.loading = false;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\tload(data, params, config, replace, silent, columnsChanged){\r\n\t\tvar requestNo = ++this.requestOrder;\r\n\r\n\t\tthis.dispatchExternal(\"dataLoading\", data);\r\n\r\n\t\t//parse json data to array\r\n\t\tif (data && (data.indexOf(\"{\") == 0 || data.indexOf(\"[\") == 0)){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\r\n\t\tif(this.confirm(\"data-loading\", [data, params, config, silent])){\r\n\t\t\tthis.loading = true;\r\n\r\n\t\t\tif(!silent){\r\n\t\t\t\tthis.alertLoader();\r\n\t\t\t}\r\n\r\n\t\t\t//get params for request\r\n\t\t\tparams = this.chain(\"data-params\", [data, config, silent], params || {}, params || {});\r\n\r\n\t\t\tparams = this.mapParams(params, this.table.options.dataSendParams);\r\n\r\n\t\t\tvar result = this.chain(\"data-load\", [data, params, config, silent], false, Promise.resolve([]));\r\n\t\t\t\r\n\t\t\treturn result.then((response) => {\r\n\t\t\t\tif(!Array.isArray(response) && typeof response == \"object\"){\r\n\t\t\t\t\tresponse = this.mapParams(response, this.objectInvert(this.table.options.dataReceiveParams));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar rowData = this.chain(\"data-loaded\", response, null, response);\r\n\r\n\t\t\t\tif(requestNo == this.requestOrder){\r\n\t\t\t\t\tthis.clearAlert();\r\n\r\n\t\t\t\t\tif(rowData !== false){\r\n\t\t\t\t\t\tthis.dispatchExternal(\"dataLoaded\", rowData);\r\n\t\t\t\t\t\tthis.table.rowManager.setData(rowData, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made\");\r\n\t\t\t\t}\r\n\t\t\t}).catch((error) => {\r\n\t\t\t\tconsole.error(\"Data Load Error: \", error);\r\n\t\t\t\tthis.dispatchExternal(\"dataLoadError\", error);\r\n\r\n\t\t\t\tif(!silent){\r\n\t\t\t\t\tthis.alertError();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.clearAlert();\r\n\t\t\t\t}, this.table.options.dataLoaderErrorTimeout);\r\n\t\t\t})\r\n\t\t\t\t.finally(() => {\r\n\t\t\t\t\tthis.loading = false;\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tthis.dispatchExternal(\"dataLoaded\", data);\r\n\r\n\t\t\tif(!data){\r\n\t\t\t\tdata = [];\r\n\t\t\t}\r\n\r\n\t\t\tthis.table.rowManager.setData(data, replace, typeof columnsChanged === \"undefined\" ? !replace : columnsChanged);\r\n\t\t\treturn Promise.resolve();\r\n\t\t}\r\n\t}\r\n\r\n\tmapParams(params, map){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in params){\r\n\t\t\toutput[map.hasOwnProperty(key) ? map[key] : key] = params[key];\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tobjectInvert(obj){\r\n\t\tvar output = {};\r\n\r\n\t\tfor(let key in obj){\r\n\t\t\toutput[obj[key]] = key;\r\n\t\t}\r\n\r\n\t\treturn output;\r\n\t}\r\n\r\n\tblockActiveLoad(){\r\n\t\tthis.requestOrder++;\r\n\t}\r\n\r\n\talertLoader(){\r\n\t\tvar shouldLoad = typeof this.table.options.dataLoader === \"function\" ? this.table.options.dataLoader() : this.table.options.dataLoader;\r\n\r\n\t\tif(shouldLoad){\r\n\t\t\tthis.table.alertManager.alert(this.table.options.dataLoaderLoading || this.langText(\"data|loading\"));\r\n\t\t}\r\n\t}\r\n\r\n\talertError(){\r\n\t\tthis.table.alertManager.alert(this.table.options.dataLoaderError || this.langText(\"data|error\"), \"error\");\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.table.alertManager.clear();\r\n\t}\r\n}","export default class ExternalEventBus {\r\n\r\n\tconstructor(table, optionsList, debug){\r\n\t\tthis.table = table;\r\n\t\tthis.events = {};\r\n\t\tthis.optionsList = optionsList || {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push(callback);\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tdelete this.events[key];\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift(),\r\n\t\tresult;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((callback, i) => {\r\n\t\t\t\tlet callResult = callback.apply(this.table, args);\r\n\r\n\t\t\t\tif(!i){\r\n\t\t\t\t\tresult = callResult;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"ExternalEvent:\" + args[0];\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n}","export default class InternalEventBus {\r\n\r\n\tconstructor(debug){\r\n\t\tthis.events = {};\r\n\t\tthis.subscriptionNotifiers = {};\r\n\r\n\t\tthis.dispatch = debug ? this._debugDispatch.bind(this) : this._dispatch.bind(this);\r\n\t\tthis.chain = debug ? this._debugChain.bind(this) : this._chain.bind(this);\r\n\t\tthis.confirm = debug ? this._debugConfirm.bind(this) : this._confirm.bind(this);\r\n\t\tthis.debug = debug;\r\n\t}\r\n\r\n\tsubscriptionChange(key, callback){\r\n\t\tif(!this.subscriptionNotifiers[key]){\r\n\t\t\tthis.subscriptionNotifiers[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.subscriptionNotifiers[key].push(callback);\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis._notifySubscriptionChange(key, true);\r\n\t\t}\r\n\t}\r\n\r\n\tsubscribe(key, callback, priority = 10000){\r\n\t\tif(!this.events[key]){\r\n\t\t\tthis.events[key] = [];\r\n\t\t}\r\n\r\n\t\tthis.events[key].push({callback, priority});\r\n\r\n\t\tthis.events[key].sort((a, b) => {\r\n\t\t\treturn a.priority - b.priority;\r\n\t\t});\r\n\r\n\t\tthis._notifySubscriptionChange(key, true);\r\n\t}\r\n\r\n\tunsubscribe(key, callback){\r\n\t\tvar index;\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tif(callback){\r\n\t\t\t\tindex = this.events[key].findIndex((item) => {\r\n\t\t\t\t\treturn item.callback === callback;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif(index > -1){\r\n\t\t\t\t\tthis.events[key].splice(index, 1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Cannot remove event, no matching event found:\", key, callback);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Cannot remove event, no events set on:\", key);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis._notifySubscriptionChange(key, false);\r\n\t}\r\n\r\n\tsubscribed(key){\r\n\t\treturn this.events[key] && this.events[key].length;\r\n\t}\r\n\r\n\t_chain(key, args, initialValue, fallback){\r\n\t\tvar value = initialValue;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tvalue = subscriber.callback.apply(this, args.concat([value]));\r\n\t\t\t});\r\n\r\n\t\t\treturn value;\r\n\t\t}else{\r\n\t\t\treturn typeof fallback === \"function\" ? fallback() : fallback;\r\n\t\t}\r\n\t}\r\n\r\n\t_confirm(key, args){\r\n\t\tvar confirmed = false;\r\n\r\n\t\tif(!Array.isArray(args)){\r\n\t\t\targs = [args];\r\n\t\t}\r\n\r\n\t\tif(this.subscribed(key)){\r\n\t\t\tthis.events[key].forEach((subscriber, i) => {\r\n\t\t\t\tif(subscriber.callback.apply(this, args)){\r\n\t\t\t\t\tconfirmed = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn confirmed;\r\n\t}\r\n\r\n\t_notifySubscriptionChange(key, subscribed){\r\n\t\tvar notifiers = this.subscriptionNotifiers[key];\r\n\r\n\t\tif(notifiers){\r\n\t\t\tnotifiers.forEach((callback)=>{\r\n\t\t\t\tcallback(subscribed);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_dispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args.shift();\r\n\r\n\t\tif(this.events[key]){\r\n\t\t\tthis.events[key].forEach((subscriber) => {\r\n\t\t\t\tsubscriber.callback.apply(this, args);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t_debugDispatch(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._dispatch(...arguments);\r\n\t}\r\n\r\n\t_debugChain(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._chain(...arguments);\r\n\t}\r\n\r\n\t_debugConfirm(){\r\n\t\tvar args = Array.from(arguments),\r\n\t\tkey = args[0];\r\n\r\n\t\targs[0] = \"InternalEvent:\" + key;\r\n\r\n\t\tif(this.debug === true || this.debug.includes(key)){\r\n\t\t\tconsole.log(...args);\r\n\t\t}\r\n\r\n\t\treturn this._confirm(...arguments);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class DeprecationAdvisor extends CoreFeature{\r\n\t\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\t\r\n\t_warnUser(){\r\n\t\tif(this.options(\"debugDeprecation\")){\r\n\t\t\tconsole.warn(...arguments);\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheck(oldOption, newOption){\r\n\t\tvar msg = \"\";\r\n\t\t\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tmsg = \"Deprecated Setup Option - Use of the %c\" + oldOption + \"%c option is now deprecated\";\r\n\t\t\t\r\n\t\t\tif(newOption){\r\n\t\t\t\tmsg = msg + \", Please use the %c\" + newOption + \"%c option instead\";\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}else{\r\n\t\t\t\tthis._warnUser(msg, 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tcheckMsg(oldOption, msg){\r\n\t\tif(typeof this.options(oldOption) !== \"undefined\"){\r\n\t\t\tthis._warnUser(\"%cDeprecated Setup Option - Use of the %c\" + oldOption + \" %c option is now deprecated, \" + msg, 'font-weight: normal;', 'font-weight: bold;', 'font-weight: normal;');\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmsg(msg){\r\n\t\tthis._warnUser(msg);\r\n\t}\r\n}","import Tabulator from '../Tabulator.js';\r\n\r\nclass TableRegistry {\r\n\r\n\tstatic register(table){\r\n\t\tTableRegistry.tables.push(table);\r\n\t}\r\n\r\n\tstatic deregister(table){\r\n\t\tvar index = TableRegistry.tables.indexOf(table);\r\n\r\n\t\tif(index > -1){\r\n\t\t\tTableRegistry.tables.splice(index, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tstatic lookupTable(query, silent){\r\n\t\tvar results = [],\r\n\t\tmatches, match;\r\n\r\n\t\tif(typeof query === \"string\"){\r\n\t\t\tmatches = document.querySelectorAll(query);\r\n\r\n\t\t\tif(matches.length){\r\n\t\t\t\tfor(var i = 0; i < matches.length; i++){\r\n\t\t\t\t\tmatch = TableRegistry.matchElement(matches[i]);\r\n\r\n\t\t\t\t\tif(match){\r\n\t\t\t\t\t\tresults.push(match);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else if((typeof HTMLElement !== \"undefined\" && query instanceof HTMLElement) || query instanceof Tabulator){\r\n\t\t\tmatch = TableRegistry.matchElement(query);\r\n\r\n\t\t\tif(match){\r\n\t\t\t\tresults.push(match);\r\n\t\t\t}\r\n\t\t}else if(Array.isArray(query)){\r\n\t\t\tquery.forEach(function(item){\r\n\t\t\t\tresults = results.concat(TableRegistry.lookupTable(item));\r\n\t\t\t});\r\n\t\t}else{\r\n\t\t\tif(!silent){\r\n\t\t\t\tconsole.warn(\"Table Connection Error - Invalid Selector\", query);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn results;\r\n\t}\r\n\r\n\tstatic matchElement(element){\r\n\t\treturn TableRegistry.tables.find(function(table){\r\n\t\t\treturn element instanceof Tabulator ? table === element : table.element === element;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nTableRegistry.tables = [];\r\n\r\nexport default TableRegistry;","//resize columns to fit data they contain and stretch row to fill table, also used for fitDataTable\r\nexport default function(columns, forced){\r\n\tcolumns.forEach(function(column){\r\n\t\tcolumn.reinitializeWidth();\r\n\t});\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","import fitData from './modes/fitData.js';\r\nimport fitDataGeneral from './modes/fitDataGeneral.js';\r\nimport fitDataStretch from './modes/fitDataStretch.js';\r\nimport fitColumns from './modes/fitColumns.js';\r\n\r\nexport default {\r\n\tfitData:fitData,\r\n\tfitDataFill:fitDataGeneral,\r\n\tfitDataTable:fitDataGeneral,\r\n\tfitDataStretch:fitDataStretch,\r\n\tfitColumns:fitColumns ,\r\n};","//resize columns to fit data they contain\r\nexport default function(columns, forced){\r\n\tif(forced){\r\n\t\tthis.table.columnManager.renderer.reinitializeColumnWidths(columns);\r\n\t}\r\n\t\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n}","//resize columns to fit data the contain and stretch last column to fill table\r\nexport default function(columns, forced){\r\n\tvar colsWidth = 0,\r\n\ttableWidth = this.table.rowManager.element.clientWidth,\r\n\tgap = 0,\r\n\tlastCol = false;\r\n\r\n\tcolumns.forEach((column, i) => {\r\n\t\tif(!column.widthFixed){\r\n\t\t\tcolumn.reinitializeWidth();\r\n\t\t}\r\n\r\n\t\tif(this.table.options.responsiveLayout ? column.modules.responsive.visible : column.visible){\r\n\t\t\tlastCol = column;\r\n\t\t}\r\n\r\n\t\tif(column.visible){\r\n\t\t\tcolsWidth += column.getWidth();\r\n\t\t}\r\n\t});\r\n\r\n\tif(lastCol){\r\n\t\tgap = tableWidth - colsWidth + lastCol.getWidth();\r\n\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tlastCol.setWidth(0);\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\r\n\t\tif(gap > 0){\r\n\t\t\tlastCol.setWidth(gap);\r\n\t\t}else{\r\n\t\t\tlastCol.reinitializeWidth();\r\n\t\t}\r\n\t}else{\r\n\t\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\t\tthis.table.modules.responsiveLayout.update();\r\n\t\t}\r\n\t}\r\n}","//resize columns to fit\r\nexport default function(columns, forced){\r\n\tvar totalWidth = this.table.rowManager.element.getBoundingClientRect().width; //table element width\r\n\tvar fixedWidth = 0; //total width of columns with a defined width\r\n\tvar flexWidth = 0; //total width available to flexible columns\r\n\tvar flexGrowUnits = 0; //total number of widthGrow blocks across all columns\r\n\tvar flexColWidth = 0; //desired width of flexible columns\r\n\tvar flexColumns = []; //array of flexible width columns\r\n\tvar fixedShrinkColumns = []; //array of fixed width columns that can shrink\r\n\tvar flexShrinkUnits = 0; //total number of widthShrink blocks across all columns\r\n\tvar overflowWidth = 0; //horizontal overflow width\r\n\tvar gapFill = 0; //number of pixels to be added to final column to close and half pixel gaps\r\n\r\n\tfunction calcWidth(width){\r\n\t\tvar colWidth;\r\n\r\n\t\tif(typeof(width) == \"string\"){\r\n\t\t\tif(width.indexOf(\"%\") > -1){\r\n\t\t\t\tcolWidth = (totalWidth / 100) * parseInt(width);\r\n\t\t\t}else{\r\n\t\t\t\tcolWidth = parseInt(width);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tcolWidth = width;\r\n\t\t}\r\n\r\n\t\treturn colWidth;\r\n\t}\r\n\r\n\t//ensure columns resize to take up the correct amount of space\r\n\tfunction scaleColumns(columns, freeSpace, colWidth, shrinkCols){\r\n\t\tvar oversizeCols = [],\r\n\t\toversizeSpace = 0,\r\n\t\tremainingSpace = 0,\r\n\t\tnextColWidth = 0,\r\n\t\tremainingFlexGrowUnits = flexGrowUnits,\r\n\t\tgap = 0,\r\n\t\tchangeUnits = 0,\r\n\t\tundersizeCols = [];\r\n\r\n\t\tfunction calcGrow(col){\r\n\t\t\treturn (colWidth * (col.column.definition.widthGrow || 1));\r\n\t\t}\r\n\r\n\t\tfunction calcShrink(col){\r\n\t\t\treturn (calcWidth(col.width) - (colWidth * (col.column.definition.widthShrink || 0)));\r\n\t\t}\r\n\r\n\t\tcolumns.forEach(function(col, i){\r\n\t\t\tvar width = shrinkCols ? calcShrink(col) : calcGrow(col);\r\n\t\t\tif(col.column.minWidth >= width){\r\n\t\t\t\toversizeCols.push(col);\r\n\t\t\t}else{\r\n\t\t\t\tif(col.column.maxWidth && col.column.maxWidth < width){\r\n\t\t\t\t\tcol.width = col.column.maxWidth;\r\n\t\t\t\t\tfreeSpace -= col.column.maxWidth;\r\n\r\n\t\t\t\t\tremainingFlexGrowUnits -= shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\r\n\t\t\t\t\tif(remainingFlexGrowUnits){\r\n\t\t\t\t\t\tcolWidth = Math.floor(freeSpace/remainingFlexGrowUnits);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tundersizeCols.push(col);\r\n\t\t\t\t\tchangeUnits += shrinkCols ? (col.column.definition.widthShrink || 1) : (col.column.definition.widthGrow || 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(oversizeCols.length){\r\n\t\t\toversizeCols.forEach(function(col){\r\n\t\t\t\toversizeSpace += shrinkCols ? col.width - col.column.minWidth : col.column.minWidth;\r\n\t\t\t\tcol.width = col.column.minWidth;\r\n\t\t\t});\r\n\r\n\t\t\tremainingSpace = freeSpace - oversizeSpace;\r\n\r\n\t\t\tnextColWidth = changeUnits ? Math.floor(remainingSpace/changeUnits) : remainingSpace;\r\n\r\n\t\t\tgap = scaleColumns(undersizeCols, remainingSpace, nextColWidth, shrinkCols);\r\n\t\t}else{\r\n\t\t\tgap = changeUnits ? freeSpace - (Math.floor(freeSpace/changeUnits) * changeUnits) : freeSpace;\r\n\r\n\t\t\tundersizeCols.forEach(function(column){\r\n\t\t\t\tcolumn.width = shrinkCols ? calcShrink(column) : calcGrow(column);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn gap;\r\n\t}\r\n\r\n\tif(this.table.options.responsiveLayout && this.table.modExists(\"responsiveLayout\", true)){\r\n\t\tthis.table.modules.responsiveLayout.update();\r\n\t}\r\n\r\n\t//adjust for vertical scrollbar if present\r\n\tif(this.table.rowManager.element.scrollHeight > this.table.rowManager.element.clientHeight){\r\n\t\ttotalWidth -= this.table.rowManager.element.offsetWidth - this.table.rowManager.element.clientWidth;\r\n\t}\r\n\r\n\tcolumns.forEach(function(column){\r\n\t\tvar width, minWidth, colWidth;\r\n\r\n\t\tif(column.visible){\r\n\r\n\t\t\twidth = column.definition.width;\r\n\t\t\tminWidth = parseInt(column.minWidth);\r\n\r\n\t\t\tif(width){\r\n\r\n\t\t\t\tcolWidth = calcWidth(width);\r\n\r\n\t\t\t\tfixedWidth += colWidth > minWidth ? colWidth : minWidth;\r\n\r\n\t\t\t\tif(column.definition.widthShrink){\r\n\t\t\t\t\tfixedShrinkColumns.push({\r\n\t\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\t\twidth:colWidth > minWidth ? colWidth : minWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t\tflexShrinkUnits += column.definition.widthShrink;\r\n\t\t\t\t}\r\n\r\n\t\t\t}else{\r\n\t\t\t\tflexColumns.push({\r\n\t\t\t\t\tcolumn:column,\r\n\t\t\t\t\twidth:0,\r\n\t\t\t\t});\r\n\t\t\t\tflexGrowUnits += column.definition.widthGrow || 1;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\t//calculate available space\r\n\tflexWidth = totalWidth - fixedWidth;\r\n\r\n\t//calculate correct column size\r\n\tflexColWidth = Math.floor(flexWidth / flexGrowUnits);\r\n\r\n\t//generate column widths\r\n\tgapFill = scaleColumns(flexColumns, flexWidth, flexColWidth, false);\r\n\r\n\t//increase width of last column to account for rounding errors\r\n\tif(flexColumns.length && gapFill > 0){\r\n\t\tflexColumns[flexColumns.length-1].width += gapFill;\r\n\t}\r\n\r\n\t//calculate space for columns to be shrunk into\r\n\tflexColumns.forEach(function(col){\r\n\t\tflexWidth -= col.width;\r\n\t});\r\n\r\n\toverflowWidth = Math.abs(gapFill) + flexWidth;\r\n\r\n\t//shrink oversize columns if there is no available space\r\n\tif(overflowWidth > 0 && flexShrinkUnits){\r\n\t\tgapFill = scaleColumns(fixedShrinkColumns, overflowWidth, Math.floor(overflowWidth / flexShrinkUnits), true);\r\n\t}\r\n\r\n\t//decrease width of last column to account for rounding errors\r\n\tif(gapFill && fixedShrinkColumns.length){\r\n\t\tfixedShrinkColumns[fixedShrinkColumns.length-1].width -= gapFill;\r\n\t}\r\n\r\n\tflexColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n\r\n\tfixedShrinkColumns.forEach(function(col){\r\n\t\tcol.column.setWidth(col.width);\r\n\t});\r\n}","import Module from '../../core/Module.js';\r\n\r\nimport defaultModes from './defaults/modes.js';\r\n\r\nclass Layout extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table, \"layout\");\r\n\r\n\t\tthis.mode = null;\r\n\r\n\t\tthis.registerTableOption(\"layout\", \"fitData\"); //layout type\r\n\t\tthis.registerTableOption(\"layoutColumnsOnNewData\", false); //update column widths on setData\r\n\r\n\t\tthis.registerColumnOption(\"widthGrow\");\r\n\t\tthis.registerColumnOption(\"widthShrink\");\r\n\t}\r\n\r\n\t//initialize layout system\r\n\tinitialize(){\r\n\t\tvar layout = this.table.options.layout;\r\n\r\n\t\tif(Layout.modes[layout]){\r\n\t\t\tthis.mode = layout;\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Layout Error - invalid mode set, defaulting to 'fitData' : \" + layout);\r\n\t\t\tthis.mode = 'fitData';\r\n\t\t}\r\n\r\n\t\tthis.table.element.setAttribute(\"tabulator-layout\", this.mode);\r\n\t}\r\n\r\n\tgetMode(){\r\n\t\treturn this.mode;\r\n\t}\r\n\r\n\t//trigger table layout\r\n\tlayout(dataChanged){\r\n\t\tthis.dispatch(\"layout-refreshing\");\r\n\t\tLayout.modes[this.mode].call(this, this.table.columnManager.columnsByIndex, dataChanged);\r\n\t\tthis.dispatch(\"layout-refreshed\");\r\n\t}\r\n}\r\n\r\nLayout.moduleName = \"layout\";\r\n\r\n//load defaults\r\nLayout.modes = defaultModes;\r\n\r\nexport default Layout;","import Module from '../../core/Module.js';\r\n\r\nimport Helpers from '../../core/tools/Helpers.js';\r\n\r\nimport defaultLangs from './defaults/langs.js';\r\n\r\nclass Localize extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\r\n\t\tthis.locale = \"default\"; //current locale\r\n\t\tthis.lang = false; //current language\r\n\t\tthis.bindings = {}; //update events to call when locale is changed\r\n\t\tthis.langList = {};\r\n\r\n\t\tthis.registerTableOption(\"locale\", false); //current system language\r\n\t\tthis.registerTableOption(\"langs\", {});\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.langList = Helpers.deepClone(Localize.langs);\r\n\r\n\t\tif(this.table.options.columnDefaults.headerFilterPlaceholder !== false){\r\n\t\t\tthis.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder);\r\n\t\t}\r\n\r\n\t\tfor(let locale in this.table.options.langs){\r\n\t\t\tthis.installLang(locale, this.table.options.langs[locale]);\r\n\t\t}\r\n\r\n\t\tthis.setLocale(this.table.options.locale);\r\n\r\n\t\tthis.registerTableFunction(\"setLocale\", this.setLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLocale\", this.getLocale.bind(this));\r\n\t\tthis.registerTableFunction(\"getLang\", this.getLang.bind(this));\r\n\t}\r\n\r\n\t//set header placeholder\r\n\tsetHeaderFilterPlaceholder(placeholder){\r\n\t\tthis.langList.default.headerFilters.default = placeholder;\r\n\t}\r\n\r\n\t//set header filter placeholder by column\r\n\tsetHeaderFilterColumnPlaceholder(column, placeholder){\r\n\t\tthis.langList.default.headerFilters.columns[column] = placeholder;\r\n\r\n\t\tif(this.lang && !this.lang.headerFilters.columns[column]){\r\n\t\t\tthis.lang.headerFilters.columns[column] = placeholder;\r\n\t\t}\r\n\t}\r\n\r\n\t//setup a lang description object\r\n\tinstallLang(locale, lang){\r\n\t\tif(this.langList[locale]){\r\n\t\t\tthis._setLangProp(this.langList[locale], lang);\r\n\t\t}else{\r\n\t\t\tthis.langList[locale] = lang;\r\n\t\t}\r\n\t}\r\n\r\n\t_setLangProp(lang, values){\r\n\t\tfor(let key in values){\r\n\t\t\tif(lang[key] && typeof lang[key] == \"object\"){\r\n\t\t\t\tthis._setLangProp(lang[key], values[key]);\r\n\t\t\t}else{\r\n\t\t\t\tlang[key] = values[key];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t//set current locale\r\n\tsetLocale(desiredLocale){\r\n\t\tdesiredLocale = desiredLocale || \"default\";\r\n\r\n\t\t//fill in any matching language values\r\n\t\tfunction traverseLang(trans, path){\r\n\t\t\tfor(var prop in trans){\r\n\t\t\t\tif(typeof trans[prop] == \"object\"){\r\n\t\t\t\t\tif(!path[prop]){\r\n\t\t\t\t\t\tpath[prop] = {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttraverseLang(trans[prop], path[prop]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tpath[prop] = trans[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//determining correct locale to load\r\n\t\tif(desiredLocale === true && navigator.language){\r\n\t\t\t//get local from system\r\n\t\t\tdesiredLocale = navigator.language.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif(desiredLocale){\r\n\t\t\t//if locale is not set, check for matching top level locale else use default\r\n\t\t\tif(!this.langList[desiredLocale]){\r\n\t\t\t\tlet prefix = desiredLocale.split(\"-\")[0];\r\n\r\n\t\t\t\tif(this.langList[prefix]){\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Exact matching locale not found, using closest match: \", desiredLocale, prefix);\r\n\t\t\t\t\tdesiredLocale = prefix;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Localization Error - Matching locale not found, using default: \", desiredLocale);\r\n\t\t\t\t\tdesiredLocale = \"default\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.locale = desiredLocale;\r\n\r\n\t\t//load default lang template\r\n\t\tthis.lang = Helpers.deepClone(this.langList.default || {});\r\n\r\n\t\tif(desiredLocale != \"default\"){\r\n\t\t\ttraverseLang(this.langList[desiredLocale], this.lang);\r\n\t\t}\r\n\r\n\t\tthis.dispatchExternal(\"localized\", this.locale, this.lang);\r\n\r\n\t\tthis._executeBindings();\r\n\t}\r\n\r\n\t//get current locale\r\n\tgetLocale(locale){\r\n\t\treturn this.locale;\r\n\t}\r\n\r\n\t//get lang object for given local or current if none provided\r\n\tgetLang(locale){\r\n\t\treturn locale ? this.langList[locale] : this.lang;\r\n\t}\r\n\r\n\t//get text for current locale\r\n\tgetText(path, value){\r\n\t\tvar fillPath = value ? path + \"|\" + value : path,\r\n\t\tpathArray = fillPath.split(\"|\"),\r\n\t\ttext = this._getLangElement(pathArray, this.locale);\r\n\r\n\t\t// if(text === false){\r\n\t\t// \tconsole.warn(\"Localization Error - Matching localized text not found for given path: \", path);\r\n\t\t// }\r\n\r\n\t\treturn text || \"\";\r\n\t}\r\n\r\n\t//traverse langs object and find localized copy\r\n\t_getLangElement(path, locale){\r\n\t\tvar root = this.lang;\r\n\r\n\t\tpath.forEach(function(level){\r\n\t\t\tvar rootPath;\r\n\r\n\t\t\tif(root){\r\n\t\t\t\trootPath = root[level];\r\n\r\n\t\t\t\tif(typeof rootPath != \"undefined\"){\r\n\t\t\t\t\troot = rootPath;\r\n\t\t\t\t}else{\r\n\t\t\t\t\troot = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn root;\r\n\t}\r\n\r\n\t//set update binding\r\n\tbind(path, callback){\r\n\t\tif(!this.bindings[path]){\r\n\t\t\tthis.bindings[path] = [];\r\n\t\t}\r\n\r\n\t\tthis.bindings[path].push(callback);\r\n\r\n\t\tcallback(this.getText(path), this.lang);\r\n\t}\r\n\r\n\t//iterate through bindings and trigger updates\r\n\t_executeBindings(){\r\n\t\tfor(let path in this.bindings){\r\n\t\t\tthis.bindings[path].forEach((binding) => {\r\n\t\t\t\tbinding(this.getText(path), this.lang);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nLocalize.moduleName = \"localize\";\r\n\r\n//load defaults\r\nLocalize.langs = defaultLangs;\r\n\r\nexport default Localize;","export default {\r\n\t\"default\":{ //hold default locale text\r\n\t\t\"groups\":{\r\n\t\t\t\"item\":\"item\",\r\n\t\t\t\"items\":\"items\",\r\n\t\t},\r\n\t\t\"columns\":{\r\n\t\t},\r\n\t\t\"data\":{\r\n\t\t\t\"loading\":\"Loading\",\r\n\t\t\t\"error\":\"Error\",\r\n\t\t},\r\n\t\t\"pagination\":{\r\n\t\t\t\"page_size\":\"Page Size\",\r\n\t\t\t\"page_title\":\"Show Page\",\r\n\t\t\t\"first\":\"First\",\r\n\t\t\t\"first_title\":\"First Page\",\r\n\t\t\t\"last\":\"Last\",\r\n\t\t\t\"last_title\":\"Last Page\",\r\n\t\t\t\"prev\":\"Prev\",\r\n\t\t\t\"prev_title\":\"Prev Page\",\r\n\t\t\t\"next\":\"Next\",\r\n\t\t\t\"next_title\":\"Next Page\",\r\n\t\t\t\"all\":\"All\",\r\n\t\t\t\"counter\":{\r\n\t\t\t\t\"showing\": \"Showing\",\r\n\t\t\t\t\"of\": \"of\",\r\n\t\t\t\t\"rows\": \"rows\",\r\n\t\t\t\t\"pages\": \"pages\",\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"headerFilters\":{\r\n\t\t\t\"default\":\"filter column...\",\r\n\t\t\t\"columns\":{}\r\n\t\t}\r\n\t},\r\n};","import Module from '../../core/Module.js';\r\nimport TableRegistry from '../../core/tools/TableRegistry.js';\r\n\r\nclass Comms extends Module{\r\n\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n\t}\r\n\r\n\tinitialize(){\r\n\t\tthis.registerTableFunction(\"tableComms\", this.receive.bind(this));\r\n\t}\r\n\r\n\tgetConnections(selectors){\r\n\t\tvar connections = [],\r\n\t\tconnection;\r\n\r\n\t\tconnection = TableRegistry.lookupTable(selectors);\r\n\r\n\t\tconnection.forEach((con) =>{\r\n\t\t\tif(this.table !== con){\r\n\t\t\t\tconnections.push(con);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn connections;\r\n\t}\r\n\r\n\tsend(selectors, module, action, data){\r\n\t\tvar connections = this.getConnections(selectors);\r\n\r\n\t\tconnections.forEach((connection) => {\r\n\t\t\tconnection.tableComms(this.table.element, module, action, data);\r\n\t\t});\r\n\r\n\t\tif(!connections.length && selectors){\r\n\t\t\tconsole.warn(\"Table Connection Error - No tables matching selector found\", selectors);\r\n\t\t}\r\n\t}\r\n\r\n\treceive(table, module, action, data){\r\n\t\tif(this.table.modExists(module)){\r\n\t\t\treturn this.table.modules[module].commsReceived(table, action, data);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Inter-table Comms Error - no such module:\", module);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nComms.moduleName = \"comms\";\r\n\r\nexport default Comms;","import * as coreModules from '../modules/core.js';\r\nimport TableRegistry from './TableRegistry.js';\r\n\r\nexport default class ModuleBinder {\r\n\t\r\n\tconstructor(tabulator, modules){\r\n\t\tthis.bindStaticFunctionality(tabulator);\r\n\t\tthis.bindModules(tabulator, coreModules, true);\r\n\t\t\r\n\t\tif(modules){\r\n\t\t\tthis.bindModules(tabulator, modules);\r\n\t\t}\r\n\t}\r\n\t\r\n\tbindStaticFunctionality(tabulator){\r\n\t\ttabulator.moduleBindings = {};\r\n\t\t\r\n\t\ttabulator.extendModule = function(name, property, values){\r\n\t\t\tif(tabulator.moduleBindings[name]){\r\n\t\t\t\tvar source = tabulator.moduleBindings[name][property];\r\n\t\t\t\t\r\n\t\t\t\tif(source){\r\n\t\t\t\t\tif(typeof values == \"object\"){\r\n\t\t\t\t\t\tfor(let key in values){\r\n\t\t\t\t\t\t\tsource[key] = values[key];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tconsole.warn(\"Module Error - Invalid value type, it must be an object\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconsole.warn(\"Module Error - property does not exist:\", property);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Module Error - module does not exist:\", name);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModule = function(modules){\r\n\t\t\tif(!Array.isArray(modules)){\r\n\t\t\t\tmodules = [modules];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tmodules.forEach((mod) => {\r\n\t\t\t\ttabulator.registerModuleBinding(mod);\r\n\t\t\t});\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.registerModuleBinding = function(mod){\r\n\t\t\ttabulator.moduleBindings[mod.moduleName] = mod;\r\n\t\t};\r\n\t\t\r\n\t\ttabulator.findTable = function(query){\r\n\t\t\tvar results = TableRegistry.lookupTable(query, true);\r\n\t\t\treturn Array.isArray(results) && !results.length ? false : results;\r\n\t\t};\r\n\t\t\r\n\t\t//ensure that module are bound to instantiated function\r\n\t\ttabulator.prototype.bindModules = function(){\r\n\t\t\tvar orderedStartMods = [],\r\n\t\t\torderedEndMods = [],\r\n\t\t\tunOrderedMods = [];\r\n\t\t\t\r\n\t\t\tthis.modules = {};\r\n\t\t\t\r\n\t\t\tfor(var name in tabulator.moduleBindings){\r\n\t\t\t\tlet mod = tabulator.moduleBindings[name];\r\n\t\t\t\tlet module = new mod(this);\r\n\t\t\t\t\r\n\t\t\t\tthis.modules[name] = module;\r\n\t\t\t\t\r\n\t\t\t\tif(mod.prototype.moduleCore){\r\n\t\t\t\t\tthis.modulesCore.push(module);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(mod.moduleInitOrder){\r\n\t\t\t\t\t\tif(mod.moduleInitOrder < 0){\r\n\t\t\t\t\t\t\torderedStartMods.push(module);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\torderedEndMods.push(module);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tunOrderedMods.push(module);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\torderedStartMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\torderedEndMods.sort((a, b) => a.moduleInitOrder > b.moduleInitOrder ? 1 : -1);\r\n\t\t\t\r\n\t\t\tthis.modulesRegular = orderedStartMods.concat(unOrderedMods.concat(orderedEndMods));\r\n\t\t};\r\n\t}\r\n\t\r\n\tbindModules(tabulator, modules, core){\r\n\t\tvar mods = Object.values(modules);\r\n\t\t\r\n\t\tif(core){\r\n\t\t\tmods.forEach((mod) => {\r\n\t\t\t\tmod.prototype.moduleCore = true;\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\ttabulator.registerModule(mods);\r\n\t}\r\n}","import CoreFeature from '../CoreFeature.js';\r\n\r\nexport default class Alert extends CoreFeature{\r\n\tconstructor(table){\r\n\t\tsuper(table);\r\n \r\n\t\tthis.element = this._createAlertElement();\r\n\t\tthis.msgElement = this._createMsgElement();\r\n\t\tthis.type = null;\r\n \r\n\t\tthis.element.appendChild(this.msgElement);\r\n\t}\r\n \r\n\t_createAlertElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_createMsgElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-alert-msg\");\r\n\t\tel.setAttribute(\"role\", \"alert\");\r\n\t\treturn el;\r\n\t}\r\n \r\n\t_typeClass(){\r\n\t\treturn \"tabulator-alert-state-\" + this.type;\r\n\t}\r\n \r\n\talert(content, type = \"msg\"){\r\n\t\tif(content){\r\n\t\t\tthis.clear();\r\n \r\n\t\t\tthis.type = type;\r\n \r\n\t\t\twhile(this.msgElement.firstChild) this.msgElement.removeChild(this.msgElement.firstChild);\r\n \r\n\t\t\tthis.msgElement.classList.add(this._typeClass());\r\n \r\n\t\t\tif(typeof content === \"function\"){\r\n\t\t\t\tcontent = content();\r\n\t\t\t}\r\n \r\n\t\t\tif(content instanceof HTMLElement){\r\n\t\t\t\tthis.msgElement.appendChild(content);\r\n\t\t\t}else{\r\n\t\t\t\tthis.msgElement.innerHTML = content;\r\n\t\t\t}\r\n \r\n\t\t\tthis.table.element.appendChild(this.element);\r\n\t\t}\r\n\t}\r\n \r\n\tclear(){\r\n\t\tif(this.element.parentNode){\r\n\t\t\tthis.element.parentNode.removeChild(this.element);\r\n\t\t}\r\n \r\n\t\tthis.msgElement.classList.remove(this._typeClass());\r\n\t}\r\n}","'use strict';\r\n\r\nimport defaultOptions from './defaults/options.js';\r\n\r\nimport ColumnManager from './ColumnManager.js';\r\nimport RowManager from './RowManager.js';\r\nimport FooterManager from './FooterManager.js';\r\n\r\nimport InteractionMonitor from './tools/InteractionMonitor.js';\r\nimport ComponentFunctionBinder from './tools/ComponentFunctionBinder.js';\r\nimport DataLoader from './tools/DataLoader.js';\r\n\r\nimport ExternalEventBus from './tools/ExternalEventBus.js';\r\nimport InternalEventBus from './tools/InternalEventBus.js';\r\n\r\nimport DeprecationAdvisor from './tools/DeprecationAdvisor.js';\r\n\r\nimport TableRegistry from './tools/TableRegistry.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nimport OptionsList from './tools/OptionsList.js';\r\n\r\nimport Alert from './tools/Alert.js';\r\n\r\nclass Tabulator {\r\n\t\r\n\tconstructor(element, options){\r\n\t\t\r\n\t\tthis.options = {};\r\n\t\t\r\n\t\tthis.columnManager = null; // hold Column Manager\r\n\t\tthis.rowManager = null; //hold Row Manager\r\n\t\tthis.footerManager = null; //holder Footer Manager\r\n\t\tthis.alertManager = null; //hold Alert Manager\r\n\t\tthis.vdomHoz = null; //holder horizontal virtual dom\r\n\t\tthis.externalEvents = null; //handle external event messaging\r\n\t\tthis.eventBus = null; //handle internal event messaging\r\n\t\tthis.interactionMonitor = false; //track user interaction\r\n\t\tthis.browser = \"\"; //hold current browser type\r\n\t\tthis.browserSlow = false; //handle reduced functionality for slower browsers\r\n\t\tthis.browserMobile = false; //check if running on mobile, prevent resize cancelling edit on keyboard appearance\r\n\t\tthis.rtl = false; //check if the table is in RTL mode\r\n\t\tthis.originalElement = null; //hold original table element if it has been replaced\r\n\t\t\r\n\t\tthis.componentFunctionBinder = new ComponentFunctionBinder(this); //bind component functions\r\n\t\tthis.dataLoader = false; //bind component functions\r\n\t\t\r\n\t\tthis.modules = {}; //hold all modules bound to this table\r\n\t\tthis.modulesCore = []; //hold core modules bound to this table (for initialization purposes)\r\n\t\tthis.modulesRegular = []; //hold regular modules bound to this table (for initialization purposes)\r\n\t\t\r\n\t\tthis.deprecationAdvisor = new DeprecationAdvisor(this);\r\n\t\tthis.optionsList = new OptionsList(this, \"table constructor\");\r\n\t\t\r\n\t\tthis.initialized = false;\r\n\t\tthis.destroyed = false;\r\n\t\t\r\n\t\tif(this.initializeElement(element)){\r\n\t\t\t\r\n\t\t\tthis.initializeCoreSystems(options);\r\n\t\t\t\r\n\t\t\t//delay table creation to allow event bindings immediately after the constructor\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis._create();\r\n\t\t\t});\r\n\t\t}\r\n\t\t\r\n\t\tTableRegistry.register(this); //register table for inter-device communication\r\n\t}\r\n\t\r\n\tinitializeElement(element){\r\n\t\tif(typeof HTMLElement !== \"undefined\" && element instanceof HTMLElement){\r\n\t\t\tthis.element = element;\r\n\t\t\treturn true;\r\n\t\t}else if(typeof element === \"string\"){\r\n\t\t\tthis.element = document.querySelector(element);\r\n\t\t\t\r\n\t\t\tif(this.element){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Tabulator Creation Error - no element found matching selector: \", element);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.error(\"Tabulator Creation Error - Invalid element provided:\", element);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tinitializeCoreSystems(options){\r\n\t\tthis.columnManager = new ColumnManager(this);\r\n\t\tthis.rowManager = new RowManager(this);\r\n\t\tthis.footerManager = new FooterManager(this);\r\n\t\tthis.dataLoader = new DataLoader(this);\r\n\t\tthis.alertManager = new Alert(this);\r\n\t\t\r\n\t\tthis.bindModules();\r\n\t\t\r\n\t\tthis.options = this.optionsList.generate(Tabulator.defaultOptions, options);\r\n\t\t\r\n\t\tthis._clearObjectPointers();\r\n\t\t\r\n\t\tthis._mapDeprecatedFunctionality();\r\n\t\t\r\n\t\tthis.externalEvents = new ExternalEventBus(this, this.options, this.options.debugEventsExternal);\r\n\t\tthis.eventBus = new InternalEventBus(this.options.debugEventsInternal);\r\n\t\t\r\n\t\tthis.interactionMonitor = new InteractionMonitor(this);\r\n\t\t\r\n\t\tthis.dataLoader.initialize();\r\n\t\t// this.columnManager.initialize();\r\n\t\t// this.rowManager.initialize();\r\n\t\tthis.footerManager.initialize();\r\n\t}\r\n\t\r\n\t//convert deprecated functionality to new functions\r\n\t_mapDeprecatedFunctionality(){\r\n\t\t//all previously deprecated functionality removed in the 5.0 release\r\n\t}\r\n\t\r\n\t_clearSelection(){\r\n\t\t\r\n\t\tthis.element.classList.add(\"tabulator-block-select\");\r\n\t\t\r\n\t\tif (window.getSelection) {\r\n\t\t\tif (window.getSelection().empty) { // Chrome\r\n\t\t\t\twindow.getSelection().empty();\r\n\t\t\t} else if (window.getSelection().removeAllRanges) { // Firefox\r\n\t\t\t\twindow.getSelection().removeAllRanges();\r\n\t\t\t}\r\n\t\t} else if (document.selection) { // IE?\r\n\t\t\tdocument.selection.empty();\r\n\t\t}\r\n\t\t\r\n\t\tthis.element.classList.remove(\"tabulator-block-select\");\r\n\t}\r\n\t\r\n\t//create table\r\n\t_create(){\r\n\t\tthis.externalEvents.dispatch(\"tableBuilding\");\r\n\t\tthis.eventBus.dispatch(\"table-building\");\r\n\t\t\r\n\t\tthis._rtlCheck();\r\n\t\t\r\n\t\tthis._buildElement();\r\n\t\t\r\n\t\tthis._initializeTable();\r\n\t\t\r\n\t\tthis._loadInitialData();\r\n\t\t\r\n\t\tthis.initialized = true;\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(\"tableBuilt\");\r\n\t}\r\n\t\r\n\t_rtlCheck(){\r\n\t\tvar style = window.getComputedStyle(this.element);\r\n\t\t\r\n\t\tswitch(this.options.textDirection){\r\n\t\t\tcase\"auto\":\r\n\t\t\t\tif(style.direction !== \"rtl\"){\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\tcase \"rtl\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-rtl\");\r\n\t\t\t\tthis.rtl = true;\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"ltr\":\r\n\t\t\t\tthis.element.classList.add(\"tabulator-ltr\");\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthis.rtl = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//clear pointers to objects in default config object\r\n\t_clearObjectPointers(){\r\n\t\tthis.options.columns = this.options.columns.slice(0);\r\n\t\t\r\n\t\tif(Array.isArray(this.options.data) && !this.options.reactiveData){\r\n\t\t\tthis.options.data = this.options.data.slice(0);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//build tabulator element\r\n\t_buildElement(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options,\r\n\t\tnewElement;\r\n\t\t\r\n\t\tif(element.tagName === \"TABLE\"){\r\n\t\t\tthis.originalElement = this.element;\r\n\t\t\tnewElement = document.createElement(\"div\");\r\n\t\t\t\r\n\t\t\t//transfer attributes to new element\r\n\t\t\tvar attributes = element.attributes;\r\n\t\t\t\r\n\t\t\t// loop through attributes and apply them on div\r\n\t\t\tfor(var i in attributes){\r\n\t\t\t\tif(typeof attributes[i] == \"object\"){\r\n\t\t\t\t\tnewElement.setAttribute(attributes[i].name, attributes[i].value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// replace table with div element\r\n\t\t\telement.parentNode.replaceChild(newElement, element);\r\n\t\t\t\r\n\t\t\tthis.element = element = newElement;\r\n\t\t}\r\n\t\t\r\n\t\telement.classList.add(\"tabulator\");\r\n\t\telement.setAttribute(\"role\", \"grid\");\r\n\t\t\r\n\t\t//empty element\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\t\r\n\t\t//set table height\r\n\t\tif(options.height){\r\n\t\t\toptions.height = isNaN(options.height) ? options.height : options.height + \"px\";\r\n\t\t\telement.style.height = options.height;\r\n\t\t}\r\n\t\t\r\n\t\t//set table min height\r\n\t\tif(options.minHeight !== false){\r\n\t\t\toptions.minHeight = isNaN(options.minHeight) ? options.minHeight : options.minHeight + \"px\";\r\n\t\t\telement.style.minHeight = options.minHeight;\r\n\t\t}\r\n\t\t\r\n\t\t//set table maxHeight\r\n\t\tif(options.maxHeight !== false){\r\n\t\t\toptions.maxHeight = isNaN(options.maxHeight) ? options.maxHeight : options.maxHeight + \"px\";\r\n\t\t\telement.style.maxHeight = options.maxHeight;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//initialize core systems and modules\r\n\t_initializeTable(){\r\n\t\tvar element = this.element,\r\n\t\toptions = this.options;\r\n\t\t\r\n\t\tthis.interactionMonitor.initialize();\r\n\t\t\r\n\t\tthis.columnManager.initialize();\r\n\t\tthis.rowManager.initialize();\r\n\t\t\r\n\t\tthis._detectBrowser();\r\n\t\t\r\n\t\t//initialize core modules\r\n\t\tthis.modulesCore.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\t//build table elements\r\n\t\telement.appendChild(this.columnManager.getElement());\r\n\t\telement.appendChild(this.rowManager.getElement());\r\n\t\t\r\n\t\tif(options.footerElement){\r\n\t\t\tthis.footerManager.activate();\r\n\t\t}\r\n\t\t\r\n\t\tif(options.autoColumns && options.data){\r\n\t\t\t\r\n\t\t\tthis.columnManager.generateColumnsFromRowData(this.options.data);\r\n\t\t}\r\n\t\t\r\n\t\t//initialize regular modules\r\n\t\tthis.modulesRegular.forEach((mod) => {\r\n\t\t\tmod.initialize();\r\n\t\t});\r\n\t\t\r\n\t\tthis.columnManager.setColumns(options.columns);\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-built\");\r\n\t}\r\n\t\r\n\t_loadInitialData(){\r\n\t\tthis.dataLoader.load(this.options.data);\r\n\t}\r\n\t\r\n\t//deconstructor\r\n\tdestroy(){\r\n\t\tvar element = this.element;\r\n\t\t\r\n\t\tthis.destroyed = true;\r\n\t\t\r\n\t\tTableRegistry.deregister(this); //deregister table from inter-device communication\r\n\t\t\r\n\t\tthis.eventBus.dispatch(\"table-destroy\");\r\n\t\t\r\n\t\t//clear row data\r\n\t\tthis.rowManager.rows.forEach(function(row){\r\n\t\t\trow.wipe();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.rows = [];\r\n\t\tthis.rowManager.activeRows = [];\r\n\t\tthis.rowManager.displayRows = [];\r\n\t\t\r\n\t\t//clear DOM\r\n\t\twhile(element.firstChild) element.removeChild(element.firstChild);\r\n\t\telement.classList.remove(\"tabulator\");\r\n\r\n\t\tthis.externalEvents.dispatch(\"tableDestroyed\");\r\n\t}\r\n\t\r\n\t_detectBrowser(){\r\n\t\tvar ua = navigator.userAgent||navigator.vendor||window.opera;\r\n\t\t\r\n\t\tif(ua.indexOf(\"Trident\") > -1){\r\n\t\t\tthis.browser = \"ie\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Edge\") > -1){\r\n\t\t\tthis.browser = \"edge\";\r\n\t\t\tthis.browserSlow = true;\r\n\t\t}else if(ua.indexOf(\"Firefox\") > -1){\r\n\t\t\tthis.browser = \"firefox\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}else{\r\n\t\t\tthis.browser = \"other\";\r\n\t\t\tthis.browserSlow = false;\r\n\t\t}\r\n\t\t\r\n\t\tthis.browserMobile = /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(ua)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(ua.slice(0,4));\r\n\t}\r\n\t\r\n\tinitGuard(func, msg){\r\n\t\tvar stack, line;\r\n\t\t\r\n\t\tif(this.options.debugInitialization && !this.initialized){\r\n\t\t\tif(!func){\r\n\t\t\t\tstack = new Error().stack.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tline = stack[0] == \"Error\" ? stack[2] : stack[1];\r\n\t\t\t\t\r\n\t\t\t\tif(line[0] == \" \"){\r\n\t\t\t\t\tfunc = line.trim().split(\" \")[1].split(\".\")[1];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfunc = line.trim().split(\"@\")[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconsole.warn(\"Table Not Initialized - Calling the \" + func + \" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function.\" + (msg ? \" \" + msg : \"\"));\r\n\t\t}\r\n\t\t\r\n\t\treturn this.initialized;\r\n\t}\r\n\t\r\n\t////////////////// Data Handling //////////////////\r\n\t//block table redrawing\r\n\tblockRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocking\");\r\n\t\t\r\n\t\tthis.rowManager.blockRedraw();\r\n\t\tthis.columnManager.blockRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-blocked\");\r\n\t}\r\n\t\r\n\t//restore table redrawing\r\n\trestoreRedraw(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restoring\");\r\n\r\n\t\tthis.rowManager.restoreRedraw();\r\n\t\tthis.columnManager.restoreRedraw();\r\n\r\n\t\tthis.eventBus.dispatch(\"redraw-restored\");\r\n\t}\r\n\t\r\n\t//load data\r\n\tsetData(data, params, config){\r\n\t\tthis.initGuard(false, \"To set initial data please use the 'data' property in the table constructor.\");\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, false);\r\n\t}\r\n\t\r\n\t//clear data\r\n\tclearData(){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tthis.dataLoader.blockActiveLoad();\r\n\t\tthis.rowManager.clearData();\r\n\t}\r\n\t\r\n\t//get table data array\r\n\tgetData(active){\r\n\t\treturn this.rowManager.getData(active);\r\n\t}\r\n\t\r\n\t//get table data array count\r\n\tgetDataCount(active){\r\n\t\treturn this.rowManager.getDataCount(active);\r\n\t}\r\n\t\r\n\t//replace data, keeping table in position with same sort\r\n\treplaceData(data, params, config){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.dataLoader.load(data, params, config, true, true);\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateData(data){\r\n\t\tvar responses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\taddData(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data){\r\n\t\t\t\tthis.rowManager.addRows(data, pos, index)\r\n\t\t\t\t\t.then((rows) => {\r\n\t\t\t\t\t\tvar output = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\t\trows.forEach(function(row){\r\n\t\t\t\t\t\t\toutput.push(row.getComponent());\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tresolve(output);\r\n\t\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//update table data\r\n\tupdateOrAddData(data){\r\n\t\tvar rows = [],\r\n\t\tresponses = 0;\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tthis.dataLoader.blockActiveLoad();\r\n\t\t\t\r\n\t\t\tif(typeof data === \"string\"){\r\n\t\t\t\tdata = JSON.parse(data);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data && data.length > 0){\r\n\t\t\t\tdata.forEach((item) => {\r\n\t\t\t\t\tvar row = this.rowManager.findRow(item[this.options.index]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tresponses++;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(row){\r\n\t\t\t\t\t\trow.updateData(item)\r\n\t\t\t\t\t\t\t.then(()=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(row.getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.rowManager.addRows(item)\r\n\t\t\t\t\t\t\t.then((newRows)=>{\r\n\t\t\t\t\t\t\t\tresponses--;\r\n\t\t\t\t\t\t\t\trows.push(newRows[0].getComponent());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!responses){\r\n\t\t\t\t\t\t\t\t\tresolve(rows);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Update Error - No data provided\");\r\n\t\t\t\treject(\"Update Error - No data provided\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRow(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//get row object\r\n\tgetRowFromPosition(position){\r\n\t\tvar row = this.rowManager.getRowFromPosition(position);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching row found:\", position);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t//delete row from table\r\n\tdeleteRow(index){\r\n\t\tvar foundRows = [];\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(!Array.isArray(index)){\r\n\t\t\tindex = [index];\r\n\t\t}\r\n\t\t\r\n\t\t//find matching rows\r\n\t\tfor(let item of index){\r\n\t\t\tlet row = this.rowManager.findRow(item, true);\r\n\t\t\t\r\n\t\t\tif(row){\r\n\t\t\t\tfoundRows.push(row);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.error(\"Delete Error - No matching row found:\", item);\r\n\t\t\t\treturn Promise.reject(\"Delete Error - No matching row found\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//sort rows into correct order to ensure smooth delete from table\r\n\t\tfoundRows.sort((a, b) => {\r\n\t\t\treturn this.rowManager.rows.indexOf(a) > this.rowManager.rows.indexOf(b) ? 1 : -1;\r\n\t\t});\r\n\t\t\r\n\t\t//delete rows\r\n\t\tfoundRows.forEach((row) =>{\r\n\t\t\trow.delete();\r\n\t\t});\r\n\t\t\r\n\t\tthis.rowManager.reRenderInPosition();\r\n\t\t\r\n\t\treturn Promise.resolve();\r\n\t}\r\n\t\r\n\t//add row to table\r\n\taddRow(data, pos, index){\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\treturn this.rowManager.addRows(data, pos, index)\r\n\t\t\t.then((rows)=>{\r\n\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\t//update a row if it exists otherwise create it\r\n\tupdateOrAddRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn row.getComponent();\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\treturn this.rowManager.addRows(data)\r\n\t\t\t\t.then((rows)=>{\r\n\t\t\t\t\treturn rows[0].getComponent();\r\n\t\t\t\t});\r\n\t\t}\r\n\t}\r\n\t\r\n\t//update row data\r\n\tupdateRow(index, data){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.updateData(data)\r\n\t\t\t\t.then(()=>{\r\n\t\t\t\t\treturn Promise.resolve(row.getComponent());\r\n\t\t\t\t});\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Update Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Update Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to row in DOM\r\n\tscrollToRow(index, position, ifVisible){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn this.rowManager.scrollToRow(row, position, ifVisible);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Scroll Error - No matching row found:\", index);\r\n\t\t\treturn Promise.reject(\"Scroll Error - No matching row found\");\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveRow(from, to, after){\r\n\t\tvar fromRow = this.rowManager.findRow(from);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromRow){\r\n\t\t\tfromRow.moveToRow(to, after);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching row found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetRows(active){\r\n\t\treturn this.rowManager.getComponents(active);\t\r\n\t}\r\n\t\r\n\t//get position of row in table\r\n\tgetRowPosition(index){\r\n\t\tvar row = this.rowManager.findRow(index);\r\n\t\t\r\n\t\tif(row){\r\n\t\t\treturn row.getPosition();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Position Error - No matching row found:\", index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/////////////// Column Functions ///////////////\r\n\tsetColumns(definition){\r\n\t\tthis.initGuard(false, \"To set initial columns please use the 'columns' property in the table constructor\");\r\n\t\t\r\n\t\tthis.columnManager.setColumns(definition);\r\n\t}\r\n\t\r\n\tgetColumns(structured){\r\n\t\treturn this.columnManager.getComponents(structured);\r\n\t}\r\n\t\r\n\tgetColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.getComponent();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Find Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetColumnDefinitions(){\r\n\t\treturn this.columnManager.getDefinitionTree();\r\n\t}\r\n\t\r\n\tshowColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.show();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Show Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\thideColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field); \r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tcolumn.hide();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Hide Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\ttoggleColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\tif(column.visible){\r\n\t\t\t\tcolumn.hide();\r\n\t\t\t}else{\r\n\t\t\t\tcolumn.show();\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Visibility Toggle Error - No matching column found:\", field);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\taddColumn(definition, before, field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\treturn this.columnManager.addColumn(definition, before, column)\r\n\t\t\t.then((column) => {\r\n\t\t\t\treturn column.getComponent();\r\n\t\t\t});\r\n\t}\r\n\t\r\n\tdeleteColumn(field){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.delete();\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Delete Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tupdateColumnDefinition(field, definition){\r\n\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(column){\r\n\t\t\treturn column.updateDefinition(definition);\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Column Update Error - No matching column found:\", field);\r\n\t\t\treturn Promise.reject();\r\n\t\t}\r\n\t}\r\n\t\r\n\tmoveColumn(from, to, after){\r\n\t\tvar fromColumn = this.columnManager.findColumn(from),\r\n\t\ttoColumn = this.columnManager.findColumn(to);\r\n\t\t\r\n\t\tthis.initGuard();\r\n\t\t\r\n\t\tif(fromColumn){\r\n\t\t\tif(toColumn){\r\n\t\t\t\tthis.columnManager.moveColumn(fromColumn, toColumn, after);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Move Error - No matching column found:\", toColumn);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tconsole.warn(\"Move Error - No matching column found:\", from);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//scroll to column in DOM\r\n\tscrollToColumn(field, position, ifVisible){\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tvar column = this.columnManager.findColumn(field);\r\n\t\t\t\r\n\t\t\tif(column){\r\n\t\t\t\treturn this.columnManager.scrollToColumn(column, position, ifVisible);\r\n\t\t\t}else{\r\n\t\t\t\tconsole.warn(\"Scroll Error - No matching column found:\", field);\r\n\t\t\t\treturn Promise.reject(\"Scroll Error - No matching column found\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\t//////////// General Public Functions ////////////\r\n\t//redraw list without updating data\r\n\tredraw(force){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.columnManager.redraw(force);\r\n\t\tthis.rowManager.redraw(force);\r\n\t}\r\n\t\r\n\tsetHeight(height){\r\n\t\tthis.options.height = isNaN(height) ? height : height + \"px\";\r\n\t\tthis.element.style.height = this.options.height;\r\n\t\tthis.rowManager.initializeRenderer();\r\n\t\tthis.rowManager.redraw();\r\n\t}\r\n\t\r\n\t//////////////////// Event Bus ///////////////////\r\n\t\r\n\ton(key, callback){\r\n\t\tthis.externalEvents.subscribe(key, callback);\r\n\t}\r\n\t\r\n\toff(key, callback){\r\n\t\tthis.externalEvents.unsubscribe(key, callback);\r\n\t}\r\n\t\r\n\tdispatchEvent(){\r\n\t\tvar args = Array.from(arguments);\r\n\t\targs.shift();\r\n\t\t\r\n\t\tthis.externalEvents.dispatch(...arguments);\r\n\t}\r\n\r\n\t//////////////////// Alerts ///////////////////\r\n\r\n\talert(contents, type){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.alert(contents, type);\r\n\t}\r\n\r\n\tclearAlert(){\r\n\t\tthis.initGuard();\r\n\r\n\t\tthis.alertManager.clear();\r\n\t}\r\n\t\r\n\t////////////// Extension Management //////////////\r\n\tmodExists(plugin, required){\r\n\t\tif(this.modules[plugin]){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\tif(required){\r\n\t\t\t\tconsole.error(\"Tabulator Module Not Installed: \" + plugin);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tmodule(key){\r\n\t\tvar mod = this.modules[key];\r\n\t\t\r\n\t\tif(!mod){\r\n\t\t\tconsole.error(\"Tabulator module not installed: \" + key);\r\n\t\t}\r\n\t\t\r\n\t\treturn mod;\r\n\t}\r\n}\r\n\r\n//default setup options\r\nTabulator.defaultOptions = defaultOptions;\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(Tabulator);\r\n\r\nexport default Tabulator;\r\n","export default {\r\n\r\n\tdebugEventsExternal:false, //flag to console log events\r\n\tdebugEventsInternal:false, //flag to console log events\r\n\tdebugInvalidOptions:true, //allow toggling of invalid option warnings\r\n\tdebugInvalidComponentFuncs:true, //allow toggling of invalid component warnings\r\n\tdebugInitialization:true, //allow toggling of pre initialization function call warnings\r\n\tdebugDeprecation:true, //allow toggling of deprecation warnings\r\n\r\n\theight:false, //height of tabulator\r\n\tminHeight:false, //minimum height of tabulator\r\n\tmaxHeight:false, //maximum height of tabulator\r\n\r\n\tcolumnHeaderVertAlign:\"top\", //vertical alignment of column headers\r\n\r\n\tpopupContainer:false,\r\n\r\n\tcolumns:[],//store for colum header info\r\n\tcolumnDefaults:{}, //store column default props\r\n\r\n\tdata:false, //default starting data\r\n\r\n\tautoColumns:false, //build columns from data row structure\r\n\tautoColumnsDefinitions:false,\r\n\r\n\tnestedFieldSeparator:\".\", //separator for nested data\r\n\r\n\tfooterElement:false, //hold footer element\r\n\r\n\tindex:\"id\", //filed for row index\r\n\r\n\ttextDirection:\"auto\",\r\n\r\n\taddRowPos:\"bottom\", //position to insert blank rows, top|bottom\r\n\r\n\theaderVisible:true, //hide header\r\n\r\n\trenderVertical:\"virtual\",\r\n\trenderHorizontal:\"basic\",\r\n\trenderVerticalBuffer:0, // set virtual DOM buffer size\r\n\r\n\tscrollToRowPosition:\"top\",\r\n\tscrollToRowIfVisible:true,\r\n\r\n\tscrollToColumnPosition:\"left\",\r\n\tscrollToColumnIfVisible:true,\r\n\r\n\trowFormatter:false,\r\n\trowFormatterPrint:null,\r\n\trowFormatterClipboard:null,\r\n\trowFormatterHtmlOutput:null,\r\n\r\n\trowHeight:null,\r\n\r\n\tplaceholder:false,\r\n\r\n\tdataLoader:true,\r\n\tdataLoaderLoading:false,\r\n\tdataLoaderError:false,\r\n\tdataLoaderErrorTimeout:3000,\r\n\r\n\tdataSendParams:{},\r\n\r\n\tdataReceiveParams:{},\r\n};\r\n","//tabulator with all modules installed\r\nimport {default as Tabulator} from './Tabulator.js';\r\nimport * as modules from '../core/modules/optional.js';\r\nimport ModuleBinder from './tools/ModuleBinder.js';\r\n\r\nclass TabulatorFull extends Tabulator {}\r\n\r\n//bind modules and static functionality\r\nnew ModuleBinder(TabulatorFull, modules);\r\n\r\nexport default TabulatorFull;","export default class PseudoRow {\r\n\r\n\tconstructor (type){\r\n\t\tthis.type = type;\r\n\t\tthis.element = this._createElement();\r\n\t}\r\n\r\n\t_createElement(){\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tel.classList.add(\"tabulator-row\");\r\n\t\treturn el;\r\n\t}\r\n\r\n\tgetElement(){\r\n\t\treturn this.element;\r\n\t}\r\n\r\n\tgetComponent(){\r\n\t\treturn false;\r\n\t}\r\n\r\n\tgetData(){\r\n\t\treturn {};\r\n\t}\r\n\r\n\tgetHeight(){\r\n\t\treturn this.element.outerHeight;\r\n\t}\r\n\r\n\tinitialize(){}\r\n\r\n\treinitialize(){}\r\n\r\n\tnormalizeHeight(){}\r\n\r\n\tgenerateCells(){}\r\n\r\n\treinitializeHeight(){}\r\n\r\n\tcalcHeight(){}\r\n\r\n\tsetCellHeight(){}\r\n\r\n\tclearCellHeight(){}\r\n}"],"names":["CoreFeature","[object Object]","table","this","data","silent","columnsChanged","dataLoader","load","undefined","modules","localize","getText","arguments","bind","getLocale","comms","getConnections","send","layout","getMode","force","eventBus","subscribe","unsubscribe","key","subscribed","subscriptionChange","dispatch","chain","confirm","externalEvents","options","value","oldOption","newOption","deprecationAdvisor","check","msg","checkMsg","module","Helpers","el","offsetWidth","offsetHeight","box","getBoundingClientRect","top","window","pageYOffset","document","documentElement","clientTop","left","pageXOffset","clientLeft","obj","clone","list","objectProto","__proto__","arrayProto","i","Object","assign","Array","isArray","match","copy","subject","findIndex","item","unshift","deepClone","Popup","element","parent","super","container","_lookupContainer","reversedX","childPopup","blurable","blurCallback","renderedCallback","visible","hideable","classList","add","blurEvent","hide","escEvent","_escapeCheck","destroyBinding","tableDestroyed","destroyed","popupContainer","querySelector","console","warn","_checkContainerIsParent","body","parentNode","callback","e","touch","MouseEvent","x","touches","pageX","y","pageY","parentOffset","elOffset","position","containerOffset","offset","origin","parentEl","coords","HTMLElement","elementPositionCoords","containerEventCoords","style","appendChild","_fitToScreen","addEventListener","stopPropagation","scrollTop","right","Math","max","scrollHeight","parseInt","setTimeout","rowManager","keyCode","removeEventListener","removeChild","Module","name","_handler","optionsList","register","columnManager","func","args","initGuard","component","handler","componentFunctionBinder","priority","registerDataPipelineHandler","registerDisplayPipelineHandler","adjust","lookupIndex","index","displayRows","length","displayPipeline","getDisplayRows","activeRows","renderInPosition","refreshActiveData","footerManager","append","prepend","remove","menuEl","menuContainer","content","type","alertManager","alert","clear","Accessor","allowedTypes","registerColumnOption","initializeColumn","transformRow","column","config","forEach","accessor","charAt","toUpperCase","slice","definition","lookupAccessor","params","accessors","row","rowComponent","getComponent","traverse","colComponent","getFieldValue","setFieldValue","moduleName","generateParamsList","prefix","output","concat","push","serializeParams","encoded","encodeURIComponent","join","url","keys","method","toLowerCase","includes","json","headers","Content-Type","JSON","stringify","form","FormData","Ajax","urlGenerator","loaderPromise","registerTableOption","contentTypeFormatters","ajaxRequestFunc","defaultLoaderPromise","ajaxURLGenerator","defaultURLGenerator","ajaxURL","setUrl","setDefaultConfig","ajaxConfig","registerTableFunction","getUrl","requestDataCheck","requestParams","requestData","ajaxParams","call","previousData","generateConfig","sendRequest","defaultConfig","ajaxRequesting","then","ajaxResponse","Promise","reject","contentType","resolve","ajaxContentType","Accept","mode","location","credentials","fetch","response","ok","catch","error","status","statusText","defaultContentTypeFormatters","Clipboard","pasteParser","pasteAction","customSelection","rowRange","blocked","clipboard","clipboardCopyRowRange","plain","html","preventDefault","clipboardCopyFormatter","export","generateExportList","clipboardCopyConfig","clipboardCopyStyled","generateHTMLTable","generatePlainContent","clipboardData","setData","originalEvent","dispatchExternal","reset","paste","setPasteParser","clipboardPasteParser","setPasteAction","clipboardPasteAction","rowData","columns","col","getKey","range","internal","sel","textRange","getSelection","createRange","selectNodeContents","toString","removeAllRanges","addRange","selection","createTextRange","moveToElementText","select","execCommand","action","pasteActions","parser","pasteParsers","rows","checkPaseOrigin","getPasteData","modExists","mutateData","mutator","valid","target","tagName","edit","currentCell","getData","replace","update","updateOrAddData","insert","addData","headerFindSuccess","columnMap","split","find","title","trim","field","columnsByIndex","shift","CalcComponent","_row","Proxy","get","receiver","handle","transform","getElement","cells","getCells","cell","getCell","CellComponent","_cell","getValue","getOldValue","initialValue","getField","mutate","setValue","setValueActual","checkHeight","Cell","oldValue","height","width","minWidth","loaded","build","generateElement","setWidth","_configureCell","createElement","className","setAttribute","textAlign","hozAlign","vertAlign","display","alignItems","bottom","middle","justifyContent","center","cssClass","val","innerHTML","Node","firstChild","containerOnly","layoutElement","setValueProcessData","cellRendered","cellEdited","subscribedExternal","changed","_generateContents","widthStyled","minWidthStyled","maxWidth","maxWidthStyled","reinitializeHeight","heightStyled","redrawBlock","deleteCell","calcs","getCellIndex","ColumnComponent","_column","getDefinition","getTitleDownload","isGroup","show","delete","Column","scrollToColumn","to","after","toColumn","findColumn","moveColumn","nextCol","nextColumn","prevCol","prevColumn","updates","updateDefinition","getWidth","result","reinitializeWidth","rerenderColumns","maxInitialWidth","variableHeight","headerVertical","headerHozAlign","editableTitle","def","contentElement","titleHolderElement","titleElement","groupElement","createGroupElement","fieldStructure","titleDownload","titleFormatterRendered","mapDefinitions","setField","widthFixed","newCol","attachColumn","checkColumnVisibility","registerColumnField","_initialize","columnHeaderVertAlign","defaults","columnDefaults","generate","defaultOptionList","indexOf","nestedFieldSeparator","_getNestedData","_getFlatData","_setNestedData","_setFlatData","registerColumnPosition","reRegisterPosition","_buildColumnHeaderContent","_buildGroupHeader","_buildColumnHeader","setMinWidth","setMaxWidth","_buildColumnHeaderTitle","focus","langBind","text","_formatColumnHeaderTitle","contents","dataObj","structure","columnRendered","alignment","parentHeight","getGroupElement","clientHeight","getHeadersElement","minHeight","verticalAlign","paddingTop","clearVerticalAlign","getFirstColumn","getLastColumn","getColumns","getTopColumn","updateBranches","colDefs","responsiveToggle","verticalAlignHeaders","matchChildWidths","childWidth","child","splice","setWidthActual","isNaN","floor","clientWidth","min","heightInitialized","offsetParent","clearCellHeight","calcHeight","setCellHeight","ceil","cellCount","deregisterColumn","findColumnIndex","_nextVisibleColumn","getColumnByIndex","_prevVisibleColumn","fitToData","clearWidth","setTo","addColumn","defaultOptions","RowComponent","getPosition","watchPosition","scrollToRow","moveToRow","updateData","normalizeHeight","reinitialize","nextRow","prevRow","Row","manualHeight","outerHeight","initialized","positionWatchers","created","create","generateCells","deleteCells","renderer","renderRowCells","rowFormatter","rerenderRowCells","children","initialize","maxHeight","rowHeight","resizableRows","getHeight","setHeight","clearHeight","updatedData","newRowData","elVisible","tempData","parse","attrname","getColumnsByFieldRoot","findCell","nextDisplayRow","prevDisplayRow","before","toRow","findRow","moveRowActual","deleteActual","blockRedraw","detachModules","deleteRow","isDisplayed","group","avg","values","calcParams","precision","reduce","sum","Number","toFixed","parseFloat","String","count","ColumnCalcs","topCalcs","botCalcs","genColumn","topElement","botElement","topRow","botRow","topInitialized","botInitialized","cellValueChanged","initializeColumnCheck","rowsUpdated","scrollHorizontal","recalcActiveRows","recalcActiveRowsRefresh","tableRedraw","visibleRows","getResults","userRecalc","recalc","redraw","viewable","groupBy","recalcRowGroup","dataTreeStartExpanded","dataTree","recalcAll","topCalc","bottomCalc","columnCalcs","topCalcParams","botCalcParams","bottomCalcParams","calculations","initializeTopRow","botCalc","initializeBottomRow","footerRemove","adjustTableSize","insertBefore","headersElement","nextSibling","footerPrepend","rtl","marginRight","marginLeft","rowsToData","generateRow","frozenColumns","recalcGroup","groupRows","getRowGroup","getChildGroups","generateRowData","dataTreeChildColumnCalcs","open","getFilteredTreeChildren","pos","disable","enable","format","formatter","getFormatter","paramKey","results","getGroups","getGroupResults","groupObj","_getSelf","subGroups","getSubGroups","subGroupResults","subgroup","groups","defaultCalculations","DataTree","indent","collapseEl","expandEl","branchEl","elementField","startOpen","registerComponentFunction","collapseRow","expandRow","toggleRow","getTreeParent","getRowChildren","addTreeChildRow","isRowExpanded","dummyEl","dataTreeChildField","dataTreeChildIndent","dataTreeBranchElement","dataTreeCollapseElement","tabIndex","dataTreeExpandElement","initializeRow","layoutRow","rowDelete","rowDataChanged","columnMoving","initializeElementField","tableRedrawing","registerDisplayHandler","getRows","reinitializeRowChildren","firstCol","getFirstVisibleColumn","dataTreeElementColumn","getTreeChildren","redrawNeeded","refreshData","childArray","controlEl","generateControlElement","cloneNode","paddingRight","getComputedStyle","getPropertyValue","paddingLeft","oldControl","replaceChild","getChildren","allChildren","generateChildren","dataTreeFilter","filter","dataTreeSort","sort","sub","childData","childRow","getTreeParentRoot","childIndex","findChildIndex","recurse","csv","setFileContents","delimiter","fileContents","depth","bom","jsonLines","pdf","header","autoTableParams","rowGroupStyles","fontStyle","fontSize","cellPadding","fillColor","rowCalcStyles","jsPDFParams","jsPDF","parseRow","styles","colSpan","rowSpan","orientation","unit","doc","jspdf","autoTable","didDrawPage","head","documentProcessing","xlsx","sheetName","workbook","XLSX","utils","book_new","tableFeatures","generateSheet","merges","worksheet","s","c","r","a","b","j","Date","sheet_add_aoa","encode_range","SheetNames","Sheets","sheetOnly","sheets","sheet","commsSend","active","intercept","buf","ArrayBuffer","view","Uint8Array","charCodeAt","s2ab","write","bookType","bookSST","Download","mimeType","Blob","deprecatedOptionsCheck","download","downloadToTab","deprecationCheck","filename","interceptCallback","downloadFunc","downloaders","mime","triggerDownload","downloadConfig","downloadRowRange","groupHeader","groupHeaderDownload","_group","getRowCount","newTab","blob","downloadEncoder","URL","createObjectURL","navigator","msSaveOrOpenBlob","click","maskInput","mask","maskLetter","maskLetterChar","maskNumber","maskNumberChar","maskWildcard","maskWildcardChar","fillSymbols","symbol","char","maskAutoFill","placeholder","defaultDownloaders","Edit","editor","onRendered","success","cancel","editorParams","_initializeParams","displayItems","currentItems","focusedItem","input","_createInputElement","listEl","_createListElement","initialValues","isFilter","filterTimeout","filtered","typing","popup","listIteration","lastAction","actions","_deprecatedOptionsCheck","_initializeValue","_onRendered","listItemFormatter","getTable","sortValuesList","searchFunc","searchingPlaceholder","defaultValue","multiselect","headerFilterInitialListGen","cellEl","clickStop","preventScroll","_preventPopupBlur","_preventBlur","_inputKeyDown","attribs","elementAttributes","clearable","padding","boxSizing","autocomplete","cursor","caretColor","getAttribute","_bindInputEvents","valueCheck","valueKeys","verticalNavigation","placeholderLoading","placeholderEmpty","filterDelay","emptyValue","freetext","filterFunc","filterRemote","allowEmpty","listOnEmpty","valuesLookup","valuesURL","_inputFocus","_inputClick","_inputBlur","_inputSearch","_inputKeyUp","rebuildOptionsList","clearTimeout","_filterList","_resolveValue","_clearChoices","_keyUp","_keyDown","_keySide","_keyEnter","_keyEsc","_keyHomeEnd","_keySelectLetter","_keyAutoCompLetter","blockHide","restoreHide","stopImmediatePropagation","_focusItem","_chooseItem","_cancel","_scrollToValue","_filter","character","fromCharCode","filterTerm","label","startsWith","scrollIntoView","behavior","block","inline","_generateOptions","_sortOptions","_buildList","_showList","isInteger","_filterOptions","iteration","_ajaxRequest","_uniqueColumnValues","valuesLookupField","_addPlaceholder","responseValues","_parseList","_clearList","term","urlBuilder","getColumnByField","getColumn","inputValues","entries","map","_parseListItem","option","level","_parseListGroup","itemParams","selected","original","sorter","_defaultSortFunction","_sortGroup","as","bs","a1","b1","L","rx","rd","emptyAlign","isFinite","test","_defaultFilterFunc","_filterItem","matches","_buildItem","itemFormatter","_groupClick","_itemClick","_styleItem","startVis","isVisible","_setListWidth","hideOnBlur","blur","cellValue","search","onChange","selectContents","textarea","vertNav","whiteSpace","resize","getRow","heightNow","shiftKey","shiftEnterSubmit","selectionStart","number","step","blurFunc","date","inputFormat","DT","DateTime","luxon","convertDate","isDateTime","fromISO","fromFormat","toFormat","time","newDatetime","datetime","deprecationMsg","List","star","self","maxStars","getElementsByTagName","size","stars","starsHolder","createElementNS","starChange","browser","buildStar","starHolder","nextStar","changeValue","overflow","textOverflow","progress","mouseDrag","mouseDragWidth","percent","bar","updateValue","calcVal","round","backgroundColor","screenX","tickCross","tristate","indetermValue","indeterminateValue","indetermState","trueValueSet","falseValueSet","marginTop","checkedValue","checked","trueValue","falseValue","indeterminate","mouseClick","recursionBlock","invalidEdit","editedCells","editors","getEditedCells","clearCellEdited","navigatePrev","navigateNext","navigateLeft","navigateRight","navigateUp","navigateDown","cellIsEdited","clearEdited","editCell","cellCancelEdit","bindEditor","updateCellClass","columnDeleteCheck","rowDeleteCheck","cancelEdit","keybindingNavigateNext","newRow","addRow","edited","allowEdit","nextCell","findNextEditableCell","getIndex","findPrevEditableCell","prevCell","editable","clearEditor","cellEditCancelled","contains","button","forceEdit","focusCellNoEvent","getRenderMode","topEdge","bottomEdge","rowEl","offsetTop","leftEdge","scrollLeft","rightEdge","leftMargin","rightMargin","renderHorizontal","vDomPadLeft","offsetLeft","cellEditor","rendered","focusScrollAdjust","cellClick","cellEditing","validationMode","editIndex","defaultEditors","ExportRow","ExportColumn","Export","cloneTableStyle","colVisProp","getHtml","columnHeaders","headersToExportRows","generateColumnGroupHeaders","bodyToExportRows","rowLookup","generateTableElement","getVisibleRows","selectRow","selectedRows","pagination","columnGroups","colData","processColumnGroup","maxDepth","groupData","subGroup","subGroupData","columnVisCheck","visProp","headerDepth","exportRows","parseColumnGroup","rowGroups","exportCols","headerEl","bodyEl","lookupTableStyles","setup","treeElementField","mapElementStyles","generateHeaderElement","generateGroupElement","generateCalcElement","generateRowElement","evenRow","oddRow","calcRow","firstRow","firstGroup","getElementsByClassName","styleCells","firstCell","lastCell","classNames","generator","cellStyle","cellWrapper","formatCells","formatExportValue","align","holder","htmlOutputConfig","from","props","lookup","background-color","color","font-weight","font-family","font-size","text-align","border-top","border-left","border-right","border-bottom","padding-top","padding-left","padding-right","padding-bottom","fromStyle","prop","=","filterVal","rowVal","filterParams","<","<=",">",">=","!=","regex","RegExp","like","keywords","separator","keyword","matchAll","starts","ends","endsWith","in","Filter","filterList","headerFilters","headerFilterColumns","prevHeaderFilterChangeCheck","tableInitialized","searchRows","searchData","userSetFilter","userRefreshFilter","userAddFilter","getFilters","userSetHeaderFilterFocus","userGetHeaderFilterValue","userSetHeaderFilterValue","getHeaderFilters","userRemoveFilter","userClearFilter","userClearHeaderFilter","setHeaderFilterFocus","reloadHeaderFilter","getHeaderFilterValue","setHeaderFilterValue","initializeColumnHeaderFilter","hideHeaderFilterElements","showHeaderFilterElements","tableBuilt","filterMode","remoteFilterParams","registerDataHandler","initialFilter","setFilter","initialHeaderFilter","refreshFilter","addFilter","removeFilter","all","clearFilter","clearHeaderFilter","headerFilter","headerFilterPlaceholder","setHeaderFilterColumnPlaceholder","filterType","tagType","attrType","filterChangeCheck","prevSuccess","emptyFunc","headerFilterFunc","filters","headerFilterFuncParams","fieldVal","colVal","trackChanges","generateHeaderFilterElement","filterElement","editorElement","typingTimer","searchTrigger","headerElement","headerFilterEmptyCheck","headerFilterParams","langText","headerFilterLiveFilterDelay","hasAttribute","headerFilterLiveFilter","reloadData","findFilter","findSubFilters","ajax","filtersToArray","searchType","filterRecurse","rowList","activeRowComponents","filterRow","subFilter","defaultFilters","plaintext","formatterParams","emptyToSpace","sanitizeHTML","money","integer","decimal","rgx","floatVal","sign","decimalSym","thousandSym","thousand","negativeSign","symbolAfter","abs","link","urlPrefix","labelField","labelTraverse","path","urlField","image","src","urlSuffix","empty","truthy","allowTruthy","tick","tickElement","cross","crossElement","outputFormat","invalid","invalidPlaceholder","isValid","timezone","setZone","datetimediff","suffix","humanize","now","diff","toHuman","traffic","percentValue","colors","legend","legendColor","legendAlign","barEl","barContainer","legendEl","holderEl","buttonTick","buttonCross","rownum","innerText","responsiveCollapse","responsiveLayout","toggleList","isOpen","rowSelection","checkbox","selectableRangeMode","toggleSelect","handleComplexRowClick","isSelected","registerRowSelectCheckbox","deselectRow","registerHeaderSelectCheckbox","Format","formatValue","formatHeader","lookupFormatter","formatterPrint","print","formatterClipboard","formatterHtmlOutput","htmlOutput","formatters","mockCell","titleFormatter","titleFormatterParams","entityMap","&","\"","'","/","`","defaultFormatters","FrozenColumns","leftColumns","rightColumns","rightPadding","initializationMode","layoutCell","reinitializeColumns","blockLayout","unblockLayout","margin","edge","frozenCheck","frozen","calcMargins","layoutColumnPosition","layoutCalcRows","reinitializeRows","scroll","_calcSpace","tableElement","layoutGroupCalcs","groupList","allCells","leftParents","marginValue","getColGroupParentElement","deinitialize","getTableElement","FrozenRows","freezeRow","unfreezeRow","isRowFrozen","detachRow","frozenRows","initializeRows","rowType","styleRows","styleRow","GroupComponent","groupManager","_visible","toggleVisibility","Group","oldGroup","hasSubGroups","groupIDLookups","_addRowToGroup","_addRow","old","elementContents","arrowElement","createElements","addBindings","createValueGroups","wipe","arrow","movableRows","moveRow","initializeGroupHeader","allowedValues","_createGroup","groupToggleElement","groupID","groupKey","headerGenerator","conformRowData","toIndex","generateGroupHeaderContents","updateGroupRows","scrollHeader","groupValues","removeGroup","noCalc","_visSet","getHeadersAndRows","hasTopCalcs","detachElement","generateTopRow","hasBottomCalcs","generateBottomRow","groupClosedShowCalcs","prev","getPath","childNodes","GroupRows","displayHandler","setGroupBy","setGroupValues","setGroupStartOpen","setGroupHeader","userGetGroups","userGetGroupedData","rowGetGroup","groupUpdateOnCellEdit","cellUpdated","reassignRowToGroup","configureGroupSetup","rowDeleting","scrollHeaders","rowMoving","rowAddingIndex","rowSample","virtualRenderFill","groupStartOpen","langValue","lang","items","removeCalcs","getRealColumns","lookupFunc","prevValue","assignRowToGroup","moveRowInArray","getGroupedData","toGroup","fromGroup","removeRow","insertRow","generateGroups","groupComponents","groupListData","rowCount","headerContent","pullGroupListData","oldGroups","createGroup","assignRowToExistingGroup","newGroupNeeded","oldRowGroup","oldGroupPath","newGroupPath","getExpectedPath","every","groupPath","groupId","onlyGroupHeaders","History","history","clearComponentHistory","rowDeleted","rowAdded","rowMoved","undo","redo","getHistoryUndoSize","getHistoryRedoSize","posFrom","posTo","getGroup","getRowIndex","newValue","undoers","redoers","oldRow","cellEdit","rowAdd","addRowActual","_rebindRow","rowMove","HtmlTableImport","fieldIndex","hasIndex","tableElementCheck","originalElement","parseTable","_extractOptions","_extractHeaders","_generateBlankHeaders","attributes","optionsArr","attrib","_attribValue","exists","_findCol","textContent","registeredDefaults","inQuote","nextChar","array","Import","importFromFile","importFormat","loadDataCheck","loadData","importData","lookupImporter","structureData","err","importer","importers","extension","pickFile","extensions","accept","file","files","reader","FileReader","importReader","readAsArrayBuffer","readAsBinaryString","readAsDataURL","readAsText","onload","onerror","parsedData","autoColumns","structureArrayToObject","structureArrayToColumns","defaultImporters","Interaction","eventMap","rowClick","rowDblClick","rowContext","rowMouseEnter","rowMouseLeave","rowMouseOver","rowMouseOut","rowMouseMove","rowTap","rowDblTap","rowTapHold","cellDblClick","cellContext","cellMouseEnter","cellMouseLeave","cellMouseOver","cellMouseOut","cellMouseMove","cellTap","cellDblTap","cellTapHold","headerClick","headerDblClick","headerContext","headerMouseEnter","headerMouseLeave","headerMouseOver","headerMouseOut","headerMouseMove","headerTap","headerDblTap","headerTapHold","groupClick","groupDblClick","groupContext","groupMouseEnter","groupMouseLeave","groupMouseOver","groupMouseOut","groupMouseMove","groupTap","groupDblTap","groupTapHold","subscribers","touchSubscribers","columnSubscribers","touchWatchers","tap","tapDbl","tapHold","initializeExternalEvents","cellContentsSelectionFixer","selectNode","subscriptionChangeExternal","subscriptionChanged","added","subscribeTouchEvents","unsubscribeTouchEvents","handleTouch","noTouch","dispatchEvent","watchers","componentObj","Keybindings","watchKeys","pressedKeys","keyupBinding","keydownBinding","bindings","keybindings","mergedBindings","mapBindings","bindEvents","clearBindings","binding","mapBinding","symbolsList","ctrl","meta","code","checkBinding","ctrlKey","metaKey","navPrev","navNext","navUp","navDown","scrollPageUp","scrollPageDown","scrollToStart","scrollToEnd","copyToClipboard","keyBlock","newPos","displayRowsCount","scrollMax","navLeft","navRight","Menu","nestedMenuBlock","currentComponent","rootPopup","initializeRowWatchers","initializeGroupWatchers","rowContextMenu","loadMenuEvent","on","rowClickMenu","groupContextMenu","groupClickMenu","headerContextMenu","loadMenuTableColumnEvent","headerClickMenu","headerMenu","initializeColumnHeaderMenu","contextMenu","loadMenuTableCellEvent","clickMenu","headerMenuEl","icon","headerMenuIcon","menu","loadMenu","parentPopup","itemEl","disabled","MoveColumns","placeholderElement","createPlaceholderElement","hoverElement","checkTimeout","checkPeriod","moving","toCol","toColAfter","startX","autoScrollMargin","autoScrollStep","autoScrollTimeout","touchMove","moveHover","endMove","movableColumns","colEl","mousemove","which","startMove","bindTouchEvents","nextColWidth","prevColWidth","nextColWidthLast","prevColWidthLast","startXMove","passive","moveToCol","_bindMouseMove","movingCells","_unbindMouseMove","moveColumnActual","scrollPos","columnHolder","xPos","MoveRows","toRowAfter","hasHandle","startY","tableRowDropEvent","connection","connectionSelectorsTables","connectionSelectorsElements","connectionElements","connections","connectedTable","connectedRow","movableRowsConnectedTables","movableRowsConnectedElements","initializeCell","mouseup","tableRowDrop","previousSibling","rowHandle","nextRowHeight","prevRowHeight","nextRowHeightLast","prevRowHeightLast","startYMove","setStartPosition","connectToTables","pointerEvents","disconnectFromTables","moveHoverConnections","moveHoverTable","rowHolder","yPos","connectionTables","commsConnections","query","prototype","querySelectorAll","dropEvent","elementRowDrop","tabulatorElementDropEvent","sender","movableRowsSender","senders","movableRowsReceiver","receivers","connect","disconnect","dropComplete","fromRow","fromTable","toTable","Mutator","enabled","transformCell","mutateLink","lookupMutator","mutators","mutatorEdit","links","linkCell","pageSize","currentRow","currentPage","totalRows","totalPages","showingEl","valueEl","ofEl","totalEl","rowsEl","pages","Page","progressiveLoad","pageCounterElement","pageCounter","page","remoteRowCountEstimate","initialLoad","dataChanging","pageSizes","setMaxPage","setPage","userSetPageToRow","userSetPageSize","getPageSize","previousPage","nextPage","getPage","getPageMax","setPageToRow","initialLoadComplete","calculatePageSizes","footerRedraw","paginationAddRow","rowAddingPosition","paginationMode","remotePageParams","_parseRemoteData","restOnRenderBefore","initializePageCounter","initializePaginator","initializeProgressive","scrollVertical","testElRow","testElCell","paginationSize","visibility","generatePageSizeSelectList","setPageSize","dir","loading","progressiveLoadScrollMargin","pagesElement","firstBut","prevBut","nextBut","lastBut","paginationSizeSelector","pageSizeSelect","counter","paginationCounter","pageCounters","hidden","pageSelectLabel","paginationCounterHolder","paginationElement","paginationCounterElement","footerAppend","paginationInitialPage","paginationButtonCount","trigger","leftSize","rightSize","_generatePageButton","start","end","actualStartRow","actualRowPageSize","actualRows","setMaxRows","_setPageButtons","_setPageCounter","finally","last_page","last_row","addRows","progressiveLoadDelay","footer","containerElement","scrollWidth","defaultPageCounters","local","id","localStorage","getItem","cookie","cookiePos","setItem","expireDate","setDate","getDate","toUTCString","Persistence","defWatcherBlock","readFunc","writeFunc","testKey","removeItem","persistence","retrievedData","persistenceMode","persistenceID","localStorageTest","persistenceReaderFunc","readers","persistenceWriterFunc","writers","retrieveData","save","eventSave","getColumnLayout","setColumnLayout","sorters","initialSort","parseColumns","setColumns","mergeDefinition","getOwnPropertyDescriptor","defineProperty","set","current","oldCols","newCols","_findColumn","validateSorters","getSort","getGroupConfig","getPageConfig","definitions","excludedKeys","defStore","colDef","moduleInitOrder","defaultReaders","defaultWriters","rowContextPopup","loadPopupEvent","rowClickPopup","groupContextPopup","groupClickPopup","headerContextPopup","loadPopupTableColumnEvent","headerClickPopup","headerPopup","initializeColumnHeaderPopup","contextPopup","loadPopupTableCellEvent","clickPopup","headerPopupEl","headerPopupIcon","loadPopup","contentsEl","renderCallback","Print","manualBlock","printAsHtml","replaceTable","cleanup","printFullscreen","generateTable","printConfig","printStyled","printRowRange","footerContent","scrollX","scrollY","footerEl","tableEl","printHeader","printFooter","printFormatter","scrollTo","ReactiveData","origFuncs","currentVersion","reactiveData","unblock","watchRow","watchData","unwatchData","version","enumerable","configurable","arg","apply","getRowFromDataObject","pop","startRow","newRows","reverse","oldRows","reRenderInPosition","writable","watchKey","watchTreeChildren","childField","rebuildTree","ResizeColumns","startColumn","startWidth","latestX","initialNextColumn","layoutColumnHeader","layoutCellHandles","deInitializeComponent","resizeHandle","columnLayoutUpdated","deInitializeColumn","columnWidthUpdated","resizable","initializeEventWatchers","reinitializeColumn","frozenOffset","handleEl","nearestColumn","_checkResizability","handleDown","_mouseDown","oldWidth","parentElement","mouseMove","blockedBefore","blockedAfter","startDiff","moveDiff","resizableColumnFit","colWidth","browserSlow","checkCellHeights","mouseUp","ResizeRows","startHeight","prevHandle","prevHandleDown","screenY","ResizeTable","visibilityObserver","resizeObserver","containerObserver","tableHeight","tableWidth","containerHeight","containerWidth","autoResize","initialRedraw","tableStyle","IntersectionObserver","ResizeObserver","initializeVisibilityObserver","entry","browserMobile","nodeHeight","contentRect","nodeWidth","redrawTable","observe","fixedHeight","tableResized","isIntersecting","unobserve","ResponsiveLayout","hiddenColumns","collapseFormatter","collapseStartOpen","collapseHandleColumn","updateColumnVisibility","initializeResponsivity","generateCollapsedRowContent","layoutMode","responsiveLayoutCollapseFormatter","formatCollapsedData","responsiveLayoutCollapseStartOpen","responsive","order","generateCollapsedContent","colCount","working","getFlexBaseWidth","headerVisible","hideColumn","showColumn","activeRowsCount","renderEmptyScroll","generateCollapsedRowData","mockCellComponent","responsiveLayoutCollapseUseFormatters","node_content","titleData","valueData","titleHighlight","SelectRow","selecting","lastClickedRow","selectPrev","headerCheckboxElement","selectRows","deselectRows","getSelectedRows","getSelectedData","isRowSelected","selectable","clearSelectionData","rowRetrieve","selectablePersistence","_deselectRow","_rowSelectionChanged","endSelect","selectableCheck","getCurrentCell","_clearSelection","lastClickedRowIdx","getDisplayRowIndex","rowIdx","fromRowIdx","toRowIdx","toggledRows","toggledRow","_selectRow","rowMatch","rowInfo","selectableRollingSelection","checkboxEl","dataTreeSelectPropagate","childRowSelection","selectedRow","aRow","bRow","alignEmptyValues","decimalSeparator","thousandSeparator","string","locale","langLocale","localeCompare","boolean","calc","d","alphanum","Sort","sortList","userSetSort","clearSort","sortMode","remoteSortParams","setSort","refreshSort","arrowEl","sorterParams","startingDir","headerSortStartingDir","headerSortTristate","headerSort","headerSortElement","setColumnHeaderSortIcon","columnHeaderSortMulti","newSortList","sortOrderReverse","sortListActual","rowComponents","clearColumnHeaders","sortObj","findSorter","setColumnHeader","_sortItems","sortEl","sorterCount","sortItem","_sortRow","el1Comp","el2Comp","el1","el2","defaultSorters","Tooltip","tooltipSubscriber","headerSubscriber","timeout","popupInstance","deprecationCheckMsg","headerTooltip","mousemoveCheck","mouseoutCheck","tooltip","clearPopup","loadTooltip","tooltipDelay","parameters","float","numeric","minLength","maxLength","unique","cellData","required","Validate","invalidCells","getInvalidCells","userClearCellValidation","userValidate","cellIsValid","clearValidation","cellValidate","columnValidate","rowValidate","editValidate","editorClear","editedClear","previousValue","validate","cancelled","validator","_extractValidator","substring","_buildValidator","validators","failedValidators","invalidIndex","defaultValidators","OptionsList","msgType","userOptions","debugInvalidOptions","hasOwnProperty","Renderer","elementVertical","elementHorizontal","verticalFillMode","includingBuffer","clearRows","clearColumns","renderRows","renderColumns","rerenderRows","ifVisible","rowIndex","scrollToRowIfVisible","scrollToRowPosition","scrollToRowNearestTop","BasicHorizontal","VirtualDomHorizontal","leftCol","rightCol","vDomScrollPosLeft","vDomScrollPosRight","vDomPadRight","fitDataColAvg","windowBuffer","isFitData","compatibilityCheck","layoutCheck","vertScrollListen","clearVisRowCache","dataChange","buffer","cols","colPos","calcWindowBuffer","leftPos","rightPos","fitDataCheck","vdomHoz","reinitChanged","reinitializeRow","change","colEnd","layoutRefresh","addColRight","removeColLeft","addColLeft","removeColRight","changes","fitDataColActualWidthCheck","ex","message","newWidth","widthDiff","colPositionAdjust","ColumnManager","blockHozScrollEvent","columnsByField","defaultColumnOptions","redrawBlockUpdate","initializeRenderer","createHeadersElement","createHeaderElement","renderClass","renderers","virtual","RendererVirtualDomHorizontal","basic","RendererBasicHorizontal","hozAdjust","scrollColumns","autoColumnsDefinitions","_addColumn","_reIndexColumns","nextToColumn","topColumn","parentIndex","nextEl","root","structured","_moveColumnInArray","getComponents","updateRows","fromIndex","scrollToColumnPosition","scrollToColumnIfVisible","generateCell","totalWidth","fixedWidth","resetScroll","BasicVertical","rowTop","VirtualDomVertical","vDomRowHeight","vDomTop","vDomBottom","vDomScrollPosTop","vDomScrollPosBottom","vDomTopPad","vDomBottomPad","vDomMaxRenderChain","vDomWindowBuffer","vDomWindowMinTotalRows","vDomWindowMinMarginRows","vDomTopNewRows","vDomBottomNewRows","paddingBottom","_virtualRenderFill","topOffset","deinitializeHeight","_showPlaceholder","topDiff","bottomDiff","_addTopRow","vDomScrollHeight","_removeBottomRow","_addBottomRow","_removeTopRow","renderVerticalBuffer","topFound","bottomRow","forceMove","topPad","rowsHeight","heightOccupied","topPadHeight","rowsCount","fillableSpace","addedRows","paddingAdjust","_quickNormalizeRowHeight","removableRows","RowManager","createHolderElement","createTableElement","heightFixer","placeholderContents","firstRender","renderMode","activeRowsPipeline","redrawBlockRestoreConfig","redrawBlockRenderInPosition","dataPipeline","initializePlaceholder","leftDir","topDir","_positionPlaceholder","scrollRows","_setDataActual","generateColumnsFromRowData","_wipeElements","allIndex","activeIndex","setActiveRows","displayRowIterator","displayIndex","regenerateRowPositions","findAddRowPos","_clearPlaceholder","addRowPos","chainResult","findRowIndex","rowOnly","skipStage","stage","cascadeOrder","refreshPipelines","renderTable","layoutColumnsOnNewData","resetDisplayRows","setDisplayRows","setPosition","RendererVirtualDomVertical","RendererBasicVertical","renderVertical","_clearTable","initialHeight","otherHeight","external","event","createEvent","initEvent","Event","FooterManager","createContainerElement","initializeElement","footerElement","activate","deactivate","InteractionManager","abortClasses","previousTargets","listeners","componentMap","tabulator-cell","tabulator-row","tabulator-group","tabulator-col","pseudoTrackers","subscriber","pseudoTracking","buildListenerMap","bindSubscriptionWatchers","listenerMap","listener","components","pseudoMouseEnter","pseudoMouseLeave","leaveList","linkedKeys","comp","clearWatchers","bindPseudoEvents","updateEventListeners","track","composedPath","targets","findTargets","bindComponents","triggerEvents","elTargets","targetMatches","previousTarget","closest","ComponentFunctionBinder","funcName","debugInvalidComponentFuncs","DataLoader","requestOrder","requestNo","alertLoader","mapParams","dataSendParams","objectInvert","dataReceiveParams","clearAlert","alertError","dataLoaderErrorTimeout","dataLoaderLoading","dataLoaderError","ExternalEventBus","debug","events","subscriptionNotifiers","_debugDispatch","_dispatch","_notifySubscriptionChange","notifiers","callResult","log","InternalEventBus","_debugChain","_chain","_debugConfirm","_confirm","fallback","confirmed","DeprecationAdvisor","_warnUser","TableRegistry","tables","matchElement","Tabulator","lookupTable","forced","fitData","reinitializeColumnWidths","fitDataFill","fitDataGeneral","fitDataTable","fitDataStretch","colsWidth","gap","lastCol","fitColumns","flexColWidth","overflowWidth","flexWidth","flexGrowUnits","flexColumns","fixedShrinkColumns","flexShrinkUnits","gapFill","calcWidth","scaleColumns","freeSpace","shrinkCols","oversizeCols","oversizeSpace","remainingSpace","remainingFlexGrowUnits","changeUnits","undersizeCols","calcGrow","widthGrow","calcShrink","widthShrink","Layout","modes","dataChanged","defaultModes","Localize","langList","langs","setHeaderFilterPlaceholder","installLang","setLocale","getLang","default","_setLangProp","desiredLocale","language","traverseLang","trans","_executeBindings","pathArray","_getLangElement","rootPath","page_size","page_title","first","first_title","last","last_title","prev_title","next","next_title","showing","of","Comms","receive","selectors","con","tableComms","commsReceived","ModuleBinder","tabulator","bindStaticFunctionality","bindModules","coreModules","moduleBindings","extendModule","property","source","registerModule","mod","registerModuleBinding","findTable","orderedStartMods","orderedEndMods","unOrderedMods","moduleCore","modulesCore","modulesRegular","core","mods","Alert","_createAlertElement","msgElement","_createMsgElement","_typeClass","interactionMonitor","initializeCoreSystems","_create","_clearObjectPointers","_mapDeprecatedFunctionality","debugEventsExternal","debugEventsInternal","InteractionMonitor","_rtlCheck","_buildElement","_initializeTable","_loadInitialData","textDirection","direction","newElement","_detectBrowser","deregister","ua","userAgent","vendor","opera","stack","line","debugInitialization","Error","restoreRedraw","blockActiveLoad","clearData","getDataCount","responses","getRowFromPosition","foundRows","getDefinitionTree","fromColumn","plugin","debugDeprecation","rowFormatterPrint","rowFormatterClipboard","rowFormatterHtmlOutput","TabulatorFull","PseudoRow","_createElement"],"mappings":";AAAe,MAAMA,EAEpBC,YAAYC,GACXC,KAAKD,MAAQA,EAOdD,WAAWG,EAAMC,EAAQC,GACxB,OAAOH,KAAKD,MAAMK,WAAWC,KAAKJ,OAAMK,OAAWA,OAAWA,EAAWJ,EAAQC,GAOlFL,WACC,OAAOE,KAAKD,MAAMQ,QAAQC,SAASC,WAAWC,WAG/CZ,W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AAKwK,KAAOA,EACZxK,KAAKwE,QAAUxE,KAAKqlF,iBAGrBvlF,iBACC,IAAIyC,EAAKQ,SAASmU,cAAc,OAEhC,OADA3U,EAAG6C,UAAUC,IAAI,iBACV9C,EAGRzC,aACC,OAAOE,KAAKwE,QAGb1E,eACC,OAAO,EAGRA,UACC,MAAO,GAGRA,YACC,OAAOE,KAAKwE,QAAQ6c,YAGrBvhB,cAEAA,gBAEAA,mBAEAA,iBAEAA,sBAEAA,cAEAA,iBAEAA"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 512c8d885..8335adc26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.3.3", + "version": "5.3.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d8ff468c0..cbdb12e67 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabulator-tables", - "version": "5.3.3", + "version": "5.3.4", "description": "Interactive table generation JavaScript library", "style": "dist/css/tabulator.css", "main": "dist/js/tabulator.js",